Codebase list libmpc / 19a66c1
Imported Debian patch 1:0.1~r406-1 Sebastian Dröge authored 15 years ago Alessio Treglia committed 12 years ago
33 changed file(s) with 11665 addition(s) and 11654 deletion(s). Raw diff Collapse all Expand all
3232 host_triplet = @host@
3333 subdir = .
3434 DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
35 $(srcdir)/Makefile.in $(top_srcdir)/configure \
36 config/config.guess config/config.sub config/depcomp \
37 config/install-sh config/ltmain.sh config/missing
35 $(srcdir)/Makefile.in $(top_srcdir)/configure config.guess \
36 config.sub depcomp install-sh ltmain.sh missing
3837 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
3938 am__aclocal_m4_deps = $(top_srcdir)/configure.in
4039 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
2020
2121 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2222
23 # serial 52 Debian 1.5.26-3 AC_PROG_LIBTOOL
23 # serial 52 Debian 1.5.26-4 AC_PROG_LIBTOOL
2424
2525
2626 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+0
-1526
config/config.guess less more
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-01-23'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner <per@bothner.com>.
30 # Please send patches to <config-patches@gnu.org>. Submit a context
31 # diff and a properly formatted ChangeLog entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # The plan is that this can be called by configure scripts if you
38 # don't specify an explicit build system type.
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
59 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60
61 This is free software; see the source for copying conditions. There is NO
62 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64 help="
65 Try \`$me --help' for more information."
66
67 # Parse command line
68 while test $# -gt 0 ; do
69 case $1 in
70 --time-stamp | --time* | -t )
71 echo "$timestamp" ; exit ;;
72 --version | -v )
73 echo "$version" ; exit ;;
74 --help | --h* | -h )
75 echo "$usage"; exit ;;
76 -- ) # Stop option processing
77 shift; break ;;
78 - ) # Use stdin as input.
79 break ;;
80 -* )
81 echo "$me: invalid option $1$help" >&2
82 exit 1 ;;
83 * )
84 break ;;
85 esac
86 done
87
88 if test $# != 0; then
89 echo "$me: too many arguments$help" >&2
90 exit 1
91 fi
92
93 trap 'exit 1' 1 2 15
94
95 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96 # compiler to aid in system detection is discouraged as it requires
97 # temporary files to be created and, as you can see below, it is a
98 # headache to deal with in a portable fashion.
99
100 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101 # use `HOST_CC' if defined, but it is deprecated.
102
103 # Portable tmp directory creation inspired by the Autoconf team.
104
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
129
130 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133 PATH=$PATH:/.attbin ; export PATH
134 fi
135
136 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141 # Note: order is significant - the case branches are not exclusive.
142
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old
149 # object file format. This provides both forward
150 # compatibility and a consistent mechanism for selecting the
151 # object file format.
152 #
153 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
159 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165 esac
166 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep __ELF__ >/dev/null
173 then
174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175 # Return netbsd for either. FIX?
176 os=netbsd
177 else
178 os=netbsdelf
179 fi
180 ;;
181 *)
182 os=netbsd
183 ;;
184 esac
185 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
191 Debian*)
192 release='-gnu'
193 ;;
194 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212 exit ;;
213 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215 exit ;;
216 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218 exit ;;
219 alpha:OSF1:*:*)
220 case $UNAME_RELEASE in
221 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223 ;;
224 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226 ;;
227 esac
228 # According to Compaq, /usr/sbin/psrinfo has been available on
229 # OSF/1 and Tru64 systems produced since 1995. I hope that
230 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in
234 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
236 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
240 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
242 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
244 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
246 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
248 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
250 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
252 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
254 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
260 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
262 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
264 esac
265 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
281 Amiga*:UNIX_System_V:4.0:*)
282 echo m68k-unknown-sysv4
283 exit ;;
284 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
286 exit ;;
287 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
289 exit ;;
290 *:OS/390:*:*)
291 echo i370-ibm-openedition
292 exit ;;
293 *:z/VM:*:*)
294 echo s390-ibm-zvmoe
295 exit ;;
296 *:OS400:*:*)
297 echo powerpc-ibm-os400
298 exit ;;
299 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
303 echo arm-unknown-riscos
304 exit ;;
305 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
306 echo hppa1.1-hitachi-hiuxmpp
307 exit ;;
308 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
309 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
310 if test "`(/bin/universe) 2>/dev/null`" = att ; then
311 echo pyramid-pyramid-sysv3
312 else
313 echo pyramid-pyramid-bsd
314 fi
315 exit ;;
316 NILE*:*:*:dcosx)
317 echo pyramid-pyramid-svr4
318 exit ;;
319 DRS?6000:unix:4.0:6*)
320 echo sparc-icl-nx6
321 exit ;;
322 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
323 case `/usr/bin/uname -p` in
324 sparc) echo sparc-icl-nx7; exit ;;
325 esac ;;
326 sun4H:SunOS:5.*:*)
327 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
328 exit ;;
329 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
330 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331 exit ;;
332 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
333 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334 exit ;;
335 sun4*:SunOS:6*:*)
336 # According to config.sub, this is the proper way to canonicalize
337 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
338 # it's likely to be more like Solaris than SunOS4.
339 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
340 exit ;;
341 sun4*:SunOS:*:*)
342 case "`/usr/bin/arch -k`" in
343 Series*|S4*)
344 UNAME_RELEASE=`uname -v`
345 ;;
346 esac
347 # Japanese Language versions have a version number like `4.1.3-JL'.
348 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
349 exit ;;
350 sun3*:SunOS:*:*)
351 echo m68k-sun-sunos${UNAME_RELEASE}
352 exit ;;
353 sun*:*:4.2BSD:*)
354 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
355 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
356 case "`/bin/arch`" in
357 sun3)
358 echo m68k-sun-sunos${UNAME_RELEASE}
359 ;;
360 sun4)
361 echo sparc-sun-sunos${UNAME_RELEASE}
362 ;;
363 esac
364 exit ;;
365 aushp:SunOS:*:*)
366 echo sparc-auspex-sunos${UNAME_RELEASE}
367 exit ;;
368 # The situation for MiNT is a little confusing. The machine name
369 # can be virtually everything (everything which is not
370 # "atarist" or "atariste" at least should have a processor
371 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
372 # to the lowercase version "mint" (or "freemint"). Finally
373 # the system name "TOS" denotes a system which is actually not
374 # MiNT. But MiNT is downward compatible to TOS, so this should
375 # be no problem.
376 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
377 echo m68k-atari-mint${UNAME_RELEASE}
378 exit ;;
379 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
380 echo m68k-atari-mint${UNAME_RELEASE}
381 exit ;;
382 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
383 echo m68k-atari-mint${UNAME_RELEASE}
384 exit ;;
385 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
386 echo m68k-milan-mint${UNAME_RELEASE}
387 exit ;;
388 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
389 echo m68k-hades-mint${UNAME_RELEASE}
390 exit ;;
391 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
392 echo m68k-unknown-mint${UNAME_RELEASE}
393 exit ;;
394 m68k:machten:*:*)
395 echo m68k-apple-machten${UNAME_RELEASE}
396 exit ;;
397 powerpc:machten:*:*)
398 echo powerpc-apple-machten${UNAME_RELEASE}
399 exit ;;
400 RISC*:Mach:*:*)
401 echo mips-dec-mach_bsd4.3
402 exit ;;
403 RISC*:ULTRIX:*:*)
404 echo mips-dec-ultrix${UNAME_RELEASE}
405 exit ;;
406 VAX*:ULTRIX*:*:*)
407 echo vax-dec-ultrix${UNAME_RELEASE}
408 exit ;;
409 2020:CLIX:*:* | 2430:CLIX:*:*)
410 echo clipper-intergraph-clix${UNAME_RELEASE}
411 exit ;;
412 mips:*:*:UMIPS | mips:*:*:RISCos)
413 eval $set_cc_for_build
414 sed 's/^ //' << EOF >$dummy.c
415 #ifdef __cplusplus
416 #include <stdio.h> /* for printf() prototype */
417 int main (int argc, char *argv[]) {
418 #else
419 int main (argc, argv) int argc; char *argv[]; {
420 #endif
421 #if defined (host_mips) && defined (MIPSEB)
422 #if defined (SYSTYPE_SYSV)
423 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
424 #endif
425 #if defined (SYSTYPE_SVR4)
426 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
427 #endif
428 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
429 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
430 #endif
431 #endif
432 exit (-1);
433 }
434 EOF
435 $CC_FOR_BUILD -o $dummy $dummy.c &&
436 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
437 SYSTEM_NAME=`$dummy $dummyarg` &&
438 { echo "$SYSTEM_NAME"; exit; }
439 echo mips-mips-riscos${UNAME_RELEASE}
440 exit ;;
441 Motorola:PowerMAX_OS:*:*)
442 echo powerpc-motorola-powermax
443 exit ;;
444 Motorola:*:4.3:PL8-*)
445 echo powerpc-harris-powermax
446 exit ;;
447 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
448 echo powerpc-harris-powermax
449 exit ;;
450 Night_Hawk:Power_UNIX:*:*)
451 echo powerpc-harris-powerunix
452 exit ;;
453 m88k:CX/UX:7*:*)
454 echo m88k-harris-cxux7
455 exit ;;
456 m88k:*:4*:R4*)
457 echo m88k-motorola-sysv4
458 exit ;;
459 m88k:*:3*:R3*)
460 echo m88k-motorola-sysv3
461 exit ;;
462 AViiON:dgux:*:*)
463 # DG/UX returns AViiON for all architectures
464 UNAME_PROCESSOR=`/usr/bin/uname -p`
465 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
466 then
467 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
468 [ ${TARGET_BINARY_INTERFACE}x = x ]
469 then
470 echo m88k-dg-dgux${UNAME_RELEASE}
471 else
472 echo m88k-dg-dguxbcs${UNAME_RELEASE}
473 fi
474 else
475 echo i586-dg-dgux${UNAME_RELEASE}
476 fi
477 exit ;;
478 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
479 echo m88k-dolphin-sysv3
480 exit ;;
481 M88*:*:R3*:*)
482 # Delta 88k system running SVR3
483 echo m88k-motorola-sysv3
484 exit ;;
485 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
486 echo m88k-tektronix-sysv3
487 exit ;;
488 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
489 echo m68k-tektronix-bsd
490 exit ;;
491 *:IRIX*:*:*)
492 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
493 exit ;;
494 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
495 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
496 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
497 i*86:AIX:*:*)
498 echo i386-ibm-aix
499 exit ;;
500 ia64:AIX:*:*)
501 if [ -x /usr/bin/oslevel ] ; then
502 IBM_REV=`/usr/bin/oslevel`
503 else
504 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
505 fi
506 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
507 exit ;;
508 *:AIX:2:3)
509 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
510 eval $set_cc_for_build
511 sed 's/^ //' << EOF >$dummy.c
512 #include <sys/systemcfg.h>
513
514 main()
515 {
516 if (!__power_pc())
517 exit(1);
518 puts("powerpc-ibm-aix3.2.5");
519 exit(0);
520 }
521 EOF
522 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
523 then
524 echo "$SYSTEM_NAME"
525 else
526 echo rs6000-ibm-aix3.2.5
527 fi
528 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
529 echo rs6000-ibm-aix3.2.4
530 else
531 echo rs6000-ibm-aix3.2
532 fi
533 exit ;;
534 *:AIX:*:[456])
535 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
536 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
537 IBM_ARCH=rs6000
538 else
539 IBM_ARCH=powerpc
540 fi
541 if [ -x /usr/bin/oslevel ] ; then
542 IBM_REV=`/usr/bin/oslevel`
543 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
547 exit ;;
548 *:AIX:*:*)
549 echo rs6000-ibm-aix
550 exit ;;
551 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
552 echo romp-ibm-bsd4.4
553 exit ;;
554 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
555 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
556 exit ;; # report: romp-ibm BSD 4.3
557 *:BOSX:*:*)
558 echo rs6000-bull-bosx
559 exit ;;
560 DPX/2?00:B.O.S.:*:*)
561 echo m68k-bull-sysv3
562 exit ;;
563 9000/[34]??:4.3bsd:1.*:*)
564 echo m68k-hp-bsd
565 exit ;;
566 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
567 echo m68k-hp-bsd4.4
568 exit ;;
569 9000/[34678]??:HP-UX:*:*)
570 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
571 case "${UNAME_MACHINE}" in
572 9000/31? ) HP_ARCH=m68000 ;;
573 9000/[34]?? ) HP_ARCH=m68k ;;
574 9000/[678][0-9][0-9])
575 if [ -x /usr/bin/getconf ]; then
576 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
577 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
578 case "${sc_cpu_version}" in
579 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
580 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
581 532) # CPU_PA_RISC2_0
582 case "${sc_kernel_bits}" in
583 32) HP_ARCH="hppa2.0n" ;;
584 64) HP_ARCH="hppa2.0w" ;;
585 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
586 esac ;;
587 esac
588 fi
589 if [ "${HP_ARCH}" = "" ]; then
590 eval $set_cc_for_build
591 sed 's/^ //' << EOF >$dummy.c
592
593 #define _HPUX_SOURCE
594 #include <stdlib.h>
595 #include <unistd.h>
596
597 int main ()
598 {
599 #if defined(_SC_KERNEL_BITS)
600 long bits = sysconf(_SC_KERNEL_BITS);
601 #endif
602 long cpu = sysconf (_SC_CPU_VERSION);
603
604 switch (cpu)
605 {
606 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
607 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
608 case CPU_PA_RISC2_0:
609 #if defined(_SC_KERNEL_BITS)
610 switch (bits)
611 {
612 case 64: puts ("hppa2.0w"); break;
613 case 32: puts ("hppa2.0n"); break;
614 default: puts ("hppa2.0"); break;
615 } break;
616 #else /* !defined(_SC_KERNEL_BITS) */
617 puts ("hppa2.0"); break;
618 #endif
619 default: puts ("hppa1.0"); break;
620 }
621 exit (0);
622 }
623 EOF
624 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
625 test -z "$HP_ARCH" && HP_ARCH=hppa
626 fi ;;
627 esac
628 if [ ${HP_ARCH} = "hppa2.0w" ]
629 then
630 eval $set_cc_for_build
631
632 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
633 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
634 # generating 64-bit code. GNU and HP use different nomenclature:
635 #
636 # $ CC_FOR_BUILD=cc ./config.guess
637 # => hppa2.0w-hp-hpux11.23
638 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
639 # => hppa64-hp-hpux11.23
640
641 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
642 grep __LP64__ >/dev/null
643 then
644 HP_ARCH="hppa2.0w"
645 else
646 HP_ARCH="hppa64"
647 fi
648 fi
649 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
650 exit ;;
651 ia64:HP-UX:*:*)
652 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
653 echo ia64-hp-hpux${HPUX_REV}
654 exit ;;
655 3050*:HI-UX:*:*)
656 eval $set_cc_for_build
657 sed 's/^ //' << EOF >$dummy.c
658 #include <unistd.h>
659 int
660 main ()
661 {
662 long cpu = sysconf (_SC_CPU_VERSION);
663 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
664 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
665 results, however. */
666 if (CPU_IS_PA_RISC (cpu))
667 {
668 switch (cpu)
669 {
670 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
671 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
672 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
673 default: puts ("hppa-hitachi-hiuxwe2"); break;
674 }
675 }
676 else if (CPU_IS_HP_MC68K (cpu))
677 puts ("m68k-hitachi-hiuxwe2");
678 else puts ("unknown-hitachi-hiuxwe2");
679 exit (0);
680 }
681 EOF
682 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
683 { echo "$SYSTEM_NAME"; exit; }
684 echo unknown-hitachi-hiuxwe2
685 exit ;;
686 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
687 echo hppa1.1-hp-bsd
688 exit ;;
689 9000/8??:4.3bsd:*:*)
690 echo hppa1.0-hp-bsd
691 exit ;;
692 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
693 echo hppa1.0-hp-mpeix
694 exit ;;
695 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
696 echo hppa1.1-hp-osf
697 exit ;;
698 hp8??:OSF1:*:*)
699 echo hppa1.0-hp-osf
700 exit ;;
701 i*86:OSF1:*:*)
702 if [ -x /usr/sbin/sysversion ] ; then
703 echo ${UNAME_MACHINE}-unknown-osf1mk
704 else
705 echo ${UNAME_MACHINE}-unknown-osf1
706 fi
707 exit ;;
708 parisc*:Lites*:*:*)
709 echo hppa1.1-hp-lites
710 exit ;;
711 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
712 echo c1-convex-bsd
713 exit ;;
714 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
715 if getsysinfo -f scalar_acc
716 then echo c32-convex-bsd
717 else echo c2-convex-bsd
718 fi
719 exit ;;
720 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
721 echo c34-convex-bsd
722 exit ;;
723 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
724 echo c38-convex-bsd
725 exit ;;
726 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
727 echo c4-convex-bsd
728 exit ;;
729 CRAY*Y-MP:*:*:*)
730 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
731 exit ;;
732 CRAY*[A-Z]90:*:*:*)
733 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
734 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
735 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
736 -e 's/\.[^.]*$/.X/'
737 exit ;;
738 CRAY*TS:*:*:*)
739 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
740 exit ;;
741 CRAY*T3E:*:*:*)
742 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
743 exit ;;
744 CRAY*SV1:*:*:*)
745 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
746 exit ;;
747 *:UNICOS/mp:*:*)
748 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
749 exit ;;
750 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
751 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
752 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
753 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
754 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
755 exit ;;
756 5000:UNIX_System_V:4.*:*)
757 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
758 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
759 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
760 exit ;;
761 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
762 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
763 exit ;;
764 sparc*:BSD/OS:*:*)
765 echo sparc-unknown-bsdi${UNAME_RELEASE}
766 exit ;;
767 *:BSD/OS:*:*)
768 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
769 exit ;;
770 *:FreeBSD:*:*)
771 case ${UNAME_MACHINE} in
772 pc98)
773 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
774 amd64)
775 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
776 *)
777 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
778 esac
779 exit ;;
780 i*:CYGWIN*:*)
781 echo ${UNAME_MACHINE}-pc-cygwin
782 exit ;;
783 *:MINGW*:*)
784 echo ${UNAME_MACHINE}-pc-mingw32
785 exit ;;
786 i*:windows32*:*)
787 # uname -m includes "-pc" on this system.
788 echo ${UNAME_MACHINE}-mingw32
789 exit ;;
790 i*:PW*:*)
791 echo ${UNAME_MACHINE}-pc-pw32
792 exit ;;
793 *:Interix*:[3456]*)
794 case ${UNAME_MACHINE} in
795 x86)
796 echo i586-pc-interix${UNAME_RELEASE}
797 exit ;;
798 EM64T | authenticamd)
799 echo x86_64-unknown-interix${UNAME_RELEASE}
800 exit ;;
801 IA64)
802 echo ia64-unknown-interix${UNAME_RELEASE}
803 exit ;;
804 esac ;;
805 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
806 echo i${UNAME_MACHINE}-pc-mks
807 exit ;;
808 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
809 # How do we know it's Interix rather than the generic POSIX subsystem?
810 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
811 # UNAME_MACHINE based on the output of uname instead of i386?
812 echo i586-pc-interix
813 exit ;;
814 i*:UWIN*:*)
815 echo ${UNAME_MACHINE}-pc-uwin
816 exit ;;
817 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
818 echo x86_64-unknown-cygwin
819 exit ;;
820 p*:CYGWIN*:*)
821 echo powerpcle-unknown-cygwin
822 exit ;;
823 prep*:SunOS:5.*:*)
824 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
825 exit ;;
826 *:GNU:*:*)
827 # the GNU system
828 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
829 exit ;;
830 *:GNU/*:*:*)
831 # other systems with GNU libc and userland
832 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
833 exit ;;
834 i*86:Minix:*:*)
835 echo ${UNAME_MACHINE}-pc-minix
836 exit ;;
837 arm*:Linux:*:*)
838 eval $set_cc_for_build
839 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
840 | grep -q __ARM_EABI__
841 then
842 echo ${UNAME_MACHINE}-unknown-linux-gnu
843 else
844 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
845 fi
846 exit ;;
847 avr32*:Linux:*:*)
848 echo ${UNAME_MACHINE}-unknown-linux-gnu
849 exit ;;
850 cris:Linux:*:*)
851 echo cris-axis-linux-gnu
852 exit ;;
853 crisv32:Linux:*:*)
854 echo crisv32-axis-linux-gnu
855 exit ;;
856 frv:Linux:*:*)
857 echo frv-unknown-linux-gnu
858 exit ;;
859 ia64:Linux:*:*)
860 echo ${UNAME_MACHINE}-unknown-linux-gnu
861 exit ;;
862 m32r*:Linux:*:*)
863 echo ${UNAME_MACHINE}-unknown-linux-gnu
864 exit ;;
865 m68*:Linux:*:*)
866 echo ${UNAME_MACHINE}-unknown-linux-gnu
867 exit ;;
868 mips:Linux:*:*)
869 eval $set_cc_for_build
870 sed 's/^ //' << EOF >$dummy.c
871 #undef CPU
872 #undef mips
873 #undef mipsel
874 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
875 CPU=mipsel
876 #else
877 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
878 CPU=mips
879 #else
880 CPU=
881 #endif
882 #endif
883 EOF
884 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
885 /^CPU/{
886 s: ::g
887 p
888 }'`"
889 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
890 ;;
891 mips64:Linux:*:*)
892 eval $set_cc_for_build
893 sed 's/^ //' << EOF >$dummy.c
894 #undef CPU
895 #undef mips64
896 #undef mips64el
897 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
898 CPU=mips64el
899 #else
900 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
901 CPU=mips64
902 #else
903 CPU=
904 #endif
905 #endif
906 EOF
907 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
908 /^CPU/{
909 s: ::g
910 p
911 }'`"
912 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
913 ;;
914 or32:Linux:*:*)
915 echo or32-unknown-linux-gnu
916 exit ;;
917 ppc:Linux:*:*)
918 echo powerpc-unknown-linux-gnu
919 exit ;;
920 ppc64:Linux:*:*)
921 echo powerpc64-unknown-linux-gnu
922 exit ;;
923 alpha:Linux:*:*)
924 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
925 EV5) UNAME_MACHINE=alphaev5 ;;
926 EV56) UNAME_MACHINE=alphaev56 ;;
927 PCA56) UNAME_MACHINE=alphapca56 ;;
928 PCA57) UNAME_MACHINE=alphapca56 ;;
929 EV6) UNAME_MACHINE=alphaev6 ;;
930 EV67) UNAME_MACHINE=alphaev67 ;;
931 EV68*) UNAME_MACHINE=alphaev68 ;;
932 esac
933 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
934 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
935 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
936 exit ;;
937 parisc:Linux:*:* | hppa:Linux:*:*)
938 # Look for CPU level
939 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
940 PA7*) echo hppa1.1-unknown-linux-gnu ;;
941 PA8*) echo hppa2.0-unknown-linux-gnu ;;
942 *) echo hppa-unknown-linux-gnu ;;
943 esac
944 exit ;;
945 parisc64:Linux:*:* | hppa64:Linux:*:*)
946 echo hppa64-unknown-linux-gnu
947 exit ;;
948 s390:Linux:*:* | s390x:Linux:*:*)
949 echo ${UNAME_MACHINE}-ibm-linux
950 exit ;;
951 sh64*:Linux:*:*)
952 echo ${UNAME_MACHINE}-unknown-linux-gnu
953 exit ;;
954 sh*:Linux:*:*)
955 echo ${UNAME_MACHINE}-unknown-linux-gnu
956 exit ;;
957 sparc:Linux:*:* | sparc64:Linux:*:*)
958 echo ${UNAME_MACHINE}-unknown-linux-gnu
959 exit ;;
960 vax:Linux:*:*)
961 echo ${UNAME_MACHINE}-dec-linux-gnu
962 exit ;;
963 x86_64:Linux:*:*)
964 echo x86_64-unknown-linux-gnu
965 exit ;;
966 xtensa*:Linux:*:*)
967 echo ${UNAME_MACHINE}-unknown-linux-gnu
968 exit ;;
969 i*86:Linux:*:*)
970 # The BFD linker knows what the default object file format is, so
971 # first see if it will tell us. cd to the root directory to prevent
972 # problems with other programs or directories called `ld' in the path.
973 # Set LC_ALL=C to ensure ld outputs messages in English.
974 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
975 | sed -ne '/supported targets:/!d
976 s/[ ][ ]*/ /g
977 s/.*supported targets: *//
978 s/ .*//
979 p'`
980 case "$ld_supported_targets" in
981 elf32-i386)
982 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
983 ;;
984 a.out-i386-linux)
985 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
986 exit ;;
987 coff-i386)
988 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
989 exit ;;
990 "")
991 # Either a pre-BFD a.out linker (linux-gnuoldld) or
992 # one that does not give us useful --help.
993 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
994 exit ;;
995 esac
996 # Determine whether the default compiler is a.out or elf
997 eval $set_cc_for_build
998 sed 's/^ //' << EOF >$dummy.c
999 #include <features.h>
1000 #ifdef __ELF__
1001 # ifdef __GLIBC__
1002 # if __GLIBC__ >= 2
1003 LIBC=gnu
1004 # else
1005 LIBC=gnulibc1
1006 # endif
1007 # else
1008 LIBC=gnulibc1
1009 # endif
1010 #else
1011 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1012 LIBC=gnu
1013 #else
1014 LIBC=gnuaout
1015 #endif
1016 #endif
1017 #ifdef __dietlibc__
1018 LIBC=dietlibc
1019 #endif
1020 EOF
1021 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1022 /^LIBC/{
1023 s: ::g
1024 p
1025 }'`"
1026 test x"${LIBC}" != x && {
1027 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1028 exit
1029 }
1030 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1031 ;;
1032 i*86:DYNIX/ptx:4*:*)
1033 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1034 # earlier versions are messed up and put the nodename in both
1035 # sysname and nodename.
1036 echo i386-sequent-sysv4
1037 exit ;;
1038 i*86:UNIX_SV:4.2MP:2.*)
1039 # Unixware is an offshoot of SVR4, but it has its own version
1040 # number series starting with 2...
1041 # I am not positive that other SVR4 systems won't match this,
1042 # I just have to hope. -- rms.
1043 # Use sysv4.2uw... so that sysv4* matches it.
1044 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1045 exit ;;
1046 i*86:OS/2:*:*)
1047 # If we were able to find `uname', then EMX Unix compatibility
1048 # is probably installed.
1049 echo ${UNAME_MACHINE}-pc-os2-emx
1050 exit ;;
1051 i*86:XTS-300:*:STOP)
1052 echo ${UNAME_MACHINE}-unknown-stop
1053 exit ;;
1054 i*86:atheos:*:*)
1055 echo ${UNAME_MACHINE}-unknown-atheos
1056 exit ;;
1057 i*86:syllable:*:*)
1058 echo ${UNAME_MACHINE}-pc-syllable
1059 exit ;;
1060 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1061 echo i386-unknown-lynxos${UNAME_RELEASE}
1062 exit ;;
1063 i*86:*DOS:*:*)
1064 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1065 exit ;;
1066 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1067 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1068 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1069 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1070 else
1071 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1072 fi
1073 exit ;;
1074 i*86:*:5:[678]*)
1075 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1076 case `/bin/uname -X | grep "^Machine"` in
1077 *486*) UNAME_MACHINE=i486 ;;
1078 *Pentium) UNAME_MACHINE=i586 ;;
1079 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1080 esac
1081 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1082 exit ;;
1083 i*86:*:3.2:*)
1084 if test -f /usr/options/cb.name; then
1085 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1086 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1087 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1088 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1089 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1090 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1091 && UNAME_MACHINE=i586
1092 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1093 && UNAME_MACHINE=i686
1094 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1095 && UNAME_MACHINE=i686
1096 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1097 else
1098 echo ${UNAME_MACHINE}-pc-sysv32
1099 fi
1100 exit ;;
1101 pc:*:*:*)
1102 # Left here for compatibility:
1103 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1104 # the processor, so we play safe by assuming i386.
1105 echo i386-pc-msdosdjgpp
1106 exit ;;
1107 Intel:Mach:3*:*)
1108 echo i386-pc-mach3
1109 exit ;;
1110 paragon:*:*:*)
1111 echo i860-intel-osf1
1112 exit ;;
1113 i860:*:4.*:*) # i860-SVR4
1114 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1115 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1116 else # Add other i860-SVR4 vendors below as they are discovered.
1117 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1118 fi
1119 exit ;;
1120 mini*:CTIX:SYS*5:*)
1121 # "miniframe"
1122 echo m68010-convergent-sysv
1123 exit ;;
1124 mc68k:UNIX:SYSTEM5:3.51m)
1125 echo m68k-convergent-sysv
1126 exit ;;
1127 M680?0:D-NIX:5.3:*)
1128 echo m68k-diab-dnix
1129 exit ;;
1130 M68*:*:R3V[5678]*:*)
1131 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1132 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)
1133 OS_REL=''
1134 test -r /etc/.relid \
1135 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1136 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1137 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1138 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1139 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1140 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1141 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1142 && { echo i486-ncr-sysv4; exit; } ;;
1143 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1144 echo m68k-unknown-lynxos${UNAME_RELEASE}
1145 exit ;;
1146 mc68030:UNIX_System_V:4.*:*)
1147 echo m68k-atari-sysv4
1148 exit ;;
1149 TSUNAMI:LynxOS:2.*:*)
1150 echo sparc-unknown-lynxos${UNAME_RELEASE}
1151 exit ;;
1152 rs6000:LynxOS:2.*:*)
1153 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1154 exit ;;
1155 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1156 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1157 exit ;;
1158 SM[BE]S:UNIX_SV:*:*)
1159 echo mips-dde-sysv${UNAME_RELEASE}
1160 exit ;;
1161 RM*:ReliantUNIX-*:*:*)
1162 echo mips-sni-sysv4
1163 exit ;;
1164 RM*:SINIX-*:*:*)
1165 echo mips-sni-sysv4
1166 exit ;;
1167 *:SINIX-*:*:*)
1168 if uname -p 2>/dev/null >/dev/null ; then
1169 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1170 echo ${UNAME_MACHINE}-sni-sysv4
1171 else
1172 echo ns32k-sni-sysv
1173 fi
1174 exit ;;
1175 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1176 # says <Richard.M.Bartel@ccMail.Census.GOV>
1177 echo i586-unisys-sysv4
1178 exit ;;
1179 *:UNIX_System_V:4*:FTX*)
1180 # From Gerald Hewes <hewes@openmarket.com>.
1181 # How about differentiating between stratus architectures? -djm
1182 echo hppa1.1-stratus-sysv4
1183 exit ;;
1184 *:*:*:FTX*)
1185 # From seanf@swdc.stratus.com.
1186 echo i860-stratus-sysv4
1187 exit ;;
1188 i*86:VOS:*:*)
1189 # From Paul.Green@stratus.com.
1190 echo ${UNAME_MACHINE}-stratus-vos
1191 exit ;;
1192 *:VOS:*:*)
1193 # From Paul.Green@stratus.com.
1194 echo hppa1.1-stratus-vos
1195 exit ;;
1196 mc68*:A/UX:*:*)
1197 echo m68k-apple-aux${UNAME_RELEASE}
1198 exit ;;
1199 news*:NEWS-OS:6*:*)
1200 echo mips-sony-newsos6
1201 exit ;;
1202 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1203 if [ -d /usr/nec ]; then
1204 echo mips-nec-sysv${UNAME_RELEASE}
1205 else
1206 echo mips-unknown-sysv${UNAME_RELEASE}
1207 fi
1208 exit ;;
1209 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1210 echo powerpc-be-beos
1211 exit ;;
1212 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1213 echo powerpc-apple-beos
1214 exit ;;
1215 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1216 echo i586-pc-beos
1217 exit ;;
1218 SX-4:SUPER-UX:*:*)
1219 echo sx4-nec-superux${UNAME_RELEASE}
1220 exit ;;
1221 SX-5:SUPER-UX:*:*)
1222 echo sx5-nec-superux${UNAME_RELEASE}
1223 exit ;;
1224 SX-6:SUPER-UX:*:*)
1225 echo sx6-nec-superux${UNAME_RELEASE}
1226 exit ;;
1227 SX-7:SUPER-UX:*:*)
1228 echo sx7-nec-superux${UNAME_RELEASE}
1229 exit ;;
1230 SX-8:SUPER-UX:*:*)
1231 echo sx8-nec-superux${UNAME_RELEASE}
1232 exit ;;
1233 SX-8R:SUPER-UX:*:*)
1234 echo sx8r-nec-superux${UNAME_RELEASE}
1235 exit ;;
1236 Power*:Rhapsody:*:*)
1237 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1238 exit ;;
1239 *:Rhapsody:*:*)
1240 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1241 exit ;;
1242 *:Darwin:*:*)
1243 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1244 case $UNAME_PROCESSOR in
1245 unknown) UNAME_PROCESSOR=powerpc ;;
1246 esac
1247 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1248 exit ;;
1249 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1250 UNAME_PROCESSOR=`uname -p`
1251 if test "$UNAME_PROCESSOR" = "x86"; then
1252 UNAME_PROCESSOR=i386
1253 UNAME_MACHINE=pc
1254 fi
1255 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1256 exit ;;
1257 *:QNX:*:4*)
1258 echo i386-pc-qnx
1259 exit ;;
1260 NSE-?:NONSTOP_KERNEL:*:*)
1261 echo nse-tandem-nsk${UNAME_RELEASE}
1262 exit ;;
1263 NSR-?:NONSTOP_KERNEL:*:*)
1264 echo nsr-tandem-nsk${UNAME_RELEASE}
1265 exit ;;
1266 *:NonStop-UX:*:*)
1267 echo mips-compaq-nonstopux
1268 exit ;;
1269 BS2000:POSIX*:*:*)
1270 echo bs2000-siemens-sysv
1271 exit ;;
1272 DS/*:UNIX_System_V:*:*)
1273 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1274 exit ;;
1275 *:Plan9:*:*)
1276 # "uname -m" is not consistent, so use $cputype instead. 386
1277 # is converted to i386 for consistency with other x86
1278 # operating systems.
1279 if test "$cputype" = "386"; then
1280 UNAME_MACHINE=i386
1281 else
1282 UNAME_MACHINE="$cputype"
1283 fi
1284 echo ${UNAME_MACHINE}-unknown-plan9
1285 exit ;;
1286 *:TOPS-10:*:*)
1287 echo pdp10-unknown-tops10
1288 exit ;;
1289 *:TENEX:*:*)
1290 echo pdp10-unknown-tenex
1291 exit ;;
1292 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1293 echo pdp10-dec-tops20
1294 exit ;;
1295 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1296 echo pdp10-xkl-tops20
1297 exit ;;
1298 *:TOPS-20:*:*)
1299 echo pdp10-unknown-tops20
1300 exit ;;
1301 *:ITS:*:*)
1302 echo pdp10-unknown-its
1303 exit ;;
1304 SEI:*:*:SEIUX)
1305 echo mips-sei-seiux${UNAME_RELEASE}
1306 exit ;;
1307 *:DragonFly:*:*)
1308 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1309 exit ;;
1310 *:*VMS:*:*)
1311 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1312 case "${UNAME_MACHINE}" in
1313 A*) echo alpha-dec-vms ; exit ;;
1314 I*) echo ia64-dec-vms ; exit ;;
1315 V*) echo vax-dec-vms ; exit ;;
1316 esac ;;
1317 *:XENIX:*:SysV)
1318 echo i386-pc-xenix
1319 exit ;;
1320 i*86:skyos:*:*)
1321 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1322 exit ;;
1323 i*86:rdos:*:*)
1324 echo ${UNAME_MACHINE}-pc-rdos
1325 exit ;;
1326 esac
1327
1328 #echo '(No uname command or uname output not recognized.)' 1>&2
1329 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1330
1331 eval $set_cc_for_build
1332 cat >$dummy.c <<EOF
1333 #ifdef _SEQUENT_
1334 # include <sys/types.h>
1335 # include <sys/utsname.h>
1336 #endif
1337 main ()
1338 {
1339 #if defined (sony)
1340 #if defined (MIPSEB)
1341 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1342 I don't know.... */
1343 printf ("mips-sony-bsd\n"); exit (0);
1344 #else
1345 #include <sys/param.h>
1346 printf ("m68k-sony-newsos%s\n",
1347 #ifdef NEWSOS4
1348 "4"
1349 #else
1350 ""
1351 #endif
1352 ); exit (0);
1353 #endif
1354 #endif
1355
1356 #if defined (__arm) && defined (__acorn) && defined (__unix)
1357 printf ("arm-acorn-riscix\n"); exit (0);
1358 #endif
1359
1360 #if defined (hp300) && !defined (hpux)
1361 printf ("m68k-hp-bsd\n"); exit (0);
1362 #endif
1363
1364 #if defined (NeXT)
1365 #if !defined (__ARCHITECTURE__)
1366 #define __ARCHITECTURE__ "m68k"
1367 #endif
1368 int version;
1369 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1370 if (version < 4)
1371 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1372 else
1373 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1374 exit (0);
1375 #endif
1376
1377 #if defined (MULTIMAX) || defined (n16)
1378 #if defined (UMAXV)
1379 printf ("ns32k-encore-sysv\n"); exit (0);
1380 #else
1381 #if defined (CMU)
1382 printf ("ns32k-encore-mach\n"); exit (0);
1383 #else
1384 printf ("ns32k-encore-bsd\n"); exit (0);
1385 #endif
1386 #endif
1387 #endif
1388
1389 #if defined (__386BSD__)
1390 printf ("i386-pc-bsd\n"); exit (0);
1391 #endif
1392
1393 #if defined (sequent)
1394 #if defined (i386)
1395 printf ("i386-sequent-dynix\n"); exit (0);
1396 #endif
1397 #if defined (ns32000)
1398 printf ("ns32k-sequent-dynix\n"); exit (0);
1399 #endif
1400 #endif
1401
1402 #if defined (_SEQUENT_)
1403 struct utsname un;
1404
1405 uname(&un);
1406
1407 if (strncmp(un.version, "V2", 2) == 0) {
1408 printf ("i386-sequent-ptx2\n"); exit (0);
1409 }
1410 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1411 printf ("i386-sequent-ptx1\n"); exit (0);
1412 }
1413 printf ("i386-sequent-ptx\n"); exit (0);
1414
1415 #endif
1416
1417 #if defined (vax)
1418 # if !defined (ultrix)
1419 # include <sys/param.h>
1420 # if defined (BSD)
1421 # if BSD == 43
1422 printf ("vax-dec-bsd4.3\n"); exit (0);
1423 # else
1424 # if BSD == 199006
1425 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1426 # else
1427 printf ("vax-dec-bsd\n"); exit (0);
1428 # endif
1429 # endif
1430 # else
1431 printf ("vax-dec-bsd\n"); exit (0);
1432 # endif
1433 # else
1434 printf ("vax-dec-ultrix\n"); exit (0);
1435 # endif
1436 #endif
1437
1438 #if defined (alliant) && defined (i860)
1439 printf ("i860-alliant-bsd\n"); exit (0);
1440 #endif
1441
1442 exit (1);
1443 }
1444 EOF
1445
1446 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1447 { echo "$SYSTEM_NAME"; exit; }
1448
1449 # Apollos put the system type in the environment.
1450
1451 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1452
1453 # Convex versions that predate uname can use getsysinfo(1)
1454
1455 if [ -x /usr/convex/getsysinfo ]
1456 then
1457 case `getsysinfo -f cpu_type` in
1458 c1*)
1459 echo c1-convex-bsd
1460 exit ;;
1461 c2*)
1462 if getsysinfo -f scalar_acc
1463 then echo c32-convex-bsd
1464 else echo c2-convex-bsd
1465 fi
1466 exit ;;
1467 c34*)
1468 echo c34-convex-bsd
1469 exit ;;
1470 c38*)
1471 echo c38-convex-bsd
1472 exit ;;
1473 c4*)
1474 echo c4-convex-bsd
1475 exit ;;
1476 esac
1477 fi
1478
1479 cat >&2 <<EOF
1480 $0: unable to guess system type
1481
1482 This script, last modified $timestamp, has failed to recognize
1483 the operating system you are using. It is advised that you
1484 download the most up to date version of the config scripts from
1485
1486 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1487 and
1488 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1489
1490 If the version you run ($0) is already up to date, please
1491 send the following data and any information you think might be
1492 pertinent to <config-patches@gnu.org> in order to provide the needed
1493 information to handle your system.
1494
1495 config.guess timestamp = $timestamp
1496
1497 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1498 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1499 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1500 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1501
1502 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1503 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1504
1505 hostinfo = `(hostinfo) 2>/dev/null`
1506 /bin/universe = `(/bin/universe) 2>/dev/null`
1507 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1508 /bin/arch = `(/bin/arch) 2>/dev/null`
1509 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1510 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1511
1512 UNAME_MACHINE = ${UNAME_MACHINE}
1513 UNAME_RELEASE = ${UNAME_RELEASE}
1514 UNAME_SYSTEM = ${UNAME_SYSTEM}
1515 UNAME_VERSION = ${UNAME_VERSION}
1516 EOF
1517
1518 exit 1
1519
1520 # Local variables:
1521 # eval: (add-hook 'write-file-hooks 'time-stamp)
1522 # time-stamp-start: "timestamp='"
1523 # time-stamp-format: "%:y-%02m-%02d"
1524 # time-stamp-end: "'"
1525 # End:
+0
-1658
config/config.sub less more
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-01-16'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # This file is supposed to be the same for all GNU packages
42 # and recognize all the CPU types, system types and aliases
43 # that are meaningful with *any* GNU software.
44 # Each package is responsible for reporting which valid configurations
45 # it does not support. The user should be able to distinguish
46 # a failure to support a valid configuration from a meaningless
47 # configuration.
48
49 # The goal of this file is to map all the various variations of a given
50 # machine specification into a single specification in the form:
51 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
52 # or in some cases, the newer four-part form:
53 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
54 # It is wrong to echo any other type of specification.
55
56 me=`echo "$0" | sed -e 's,.*/,,'`
57
58 usage="\
59 Usage: $0 [OPTION] CPU-MFR-OPSYS
60 $0 [OPTION] ALIAS
61
62 Canonicalize a configuration name.
63
64 Operation modes:
65 -h, --help print this help, then exit
66 -t, --time-stamp print date of last modification, then exit
67 -v, --version print version number, then exit
68
69 Report bugs and patches to <config-patches@gnu.org>."
70
71 version="\
72 GNU config.sub ($timestamp)
73
74 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
75 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
76
77 This is free software; see the source for copying conditions. There is NO
78 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
79
80 help="
81 Try \`$me --help' for more information."
82
83 # Parse command line
84 while test $# -gt 0 ; do
85 case $1 in
86 --time-stamp | --time* | -t )
87 echo "$timestamp" ; exit ;;
88 --version | -v )
89 echo "$version" ; exit ;;
90 --help | --h* | -h )
91 echo "$usage"; exit ;;
92 -- ) # Stop option processing
93 shift; break ;;
94 - ) # Use stdin as input.
95 break ;;
96 -* )
97 echo "$me: invalid option $1$help"
98 exit 1 ;;
99
100 *local*)
101 # First pass through any local machine types.
102 echo $1
103 exit ;;
104
105 * )
106 break ;;
107 esac
108 done
109
110 case $# in
111 0) echo "$me: missing argument$help" >&2
112 exit 1;;
113 1) ;;
114 *) echo "$me: too many arguments$help" >&2
115 exit 1;;
116 esac
117
118 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
119 # Here we must recognize all the valid KERNEL-OS combinations.
120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121 case $maybe_os in
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 storm-chaos* | os2-emx* | rtmk-nova*)
125 os=-$maybe_os
126 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
127 ;;
128 *)
129 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
130 if [ $basic_machine != $1 ]
131 then os=`echo $1 | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
134 esac
135
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray)
151 os=
152 basic_machine=$1
153 ;;
154 -sim | -cisco | -oki | -wec | -winbond)
155 os=
156 basic_machine=$1
157 ;;
158 -scout)
159 ;;
160 -wrs)
161 os=-vxworks
162 basic_machine=$1
163 ;;
164 -chorusos*)
165 os=-chorusos
166 basic_machine=$1
167 ;;
168 -chorusrdb)
169 os=-chorusrdb
170 basic_machine=$1
171 ;;
172 -hiux*)
173 os=-hiuxwe2
174 ;;
175 -sco6)
176 os=-sco5v6
177 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
178 ;;
179 -sco5)
180 os=-sco3.2v5
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco4)
184 os=-sco3.2v4
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco3.2.[4-9]*)
188 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2v[4-9]*)
192 # Don't forget version if it is 3.2v4 or newer.
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco5v6*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco*)
200 os=-sco3.2v2
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -udk*)
204 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -isc)
207 os=-isc2.2
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -clix*)
211 basic_machine=clipper-intergraph
212 ;;
213 -isc*)
214 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215 ;;
216 -lynx*)
217 os=-lynxos
218 ;;
219 -ptx*)
220 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
221 ;;
222 -windowsnt*)
223 os=`echo $os | sed -e 's/windowsnt/winnt/'`
224 ;;
225 -psos*)
226 os=-psos
227 ;;
228 -mint | -mint[0-9]*)
229 basic_machine=m68k-atari
230 os=-mint
231 ;;
232 esac
233
234 # Decode aliases for certain CPU-COMPANY combinations.
235 case $basic_machine in
236 # Recognize the basic CPU types without company name.
237 # Some are omitted here because they have special meanings below.
238 1750a | 580 \
239 | a29k \
240 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
241 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
242 | am33_2.0 \
243 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
244 | bfin \
245 | c4x | clipper \
246 | d10v | d30v | dlx | dsp16xx \
247 | fido | fr30 | frv \
248 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
249 | i370 | i860 | i960 | ia64 \
250 | ip2k | iq2000 \
251 | m32c | m32r | m32rle | m68000 | m68k | m88k \
252 | maxq | mb | microblaze | mcore | mep \
253 | mips | mipsbe | mipseb | mipsel | mipsle \
254 | mips16 \
255 | mips64 | mips64el \
256 | mips64vr | mips64vrel \
257 | mips64orion | mips64orionel \
258 | mips64vr4100 | mips64vr4100el \
259 | mips64vr4300 | mips64vr4300el \
260 | mips64vr5000 | mips64vr5000el \
261 | mips64vr5900 | mips64vr5900el \
262 | mipsisa32 | mipsisa32el \
263 | mipsisa32r2 | mipsisa32r2el \
264 | mipsisa64 | mipsisa64el \
265 | mipsisa64r2 | mipsisa64r2el \
266 | mipsisa64sb1 | mipsisa64sb1el \
267 | mipsisa64sr71k | mipsisa64sr71kel \
268 | mipstx39 | mipstx39el \
269 | mn10200 | mn10300 \
270 | mt \
271 | msp430 \
272 | nios | nios2 \
273 | ns16k | ns32k \
274 | or32 \
275 | pdp10 | pdp11 | pj | pjl \
276 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
277 | pyramid \
278 | score \
279 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
280 | sh64 | sh64le \
281 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
282 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
283 | spu | strongarm \
284 | tahoe | thumb | tic4x | tic80 | tron \
285 | v850 | v850e \
286 | we32k \
287 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
288 | z8k)
289 basic_machine=$basic_machine-unknown
290 ;;
291 m6811 | m68hc11 | m6812 | m68hc12)
292 # Motorola 68HC11/12.
293 basic_machine=$basic_machine-unknown
294 os=-none
295 ;;
296 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
297 ;;
298 ms1)
299 basic_machine=mt-unknown
300 ;;
301
302 # We use `pc' rather than `unknown'
303 # because (1) that's what they normally are, and
304 # (2) the word "unknown" tends to confuse beginning users.
305 i*86 | x86_64)
306 basic_machine=$basic_machine-pc
307 ;;
308 # Object if more than one company name word.
309 *-*-*)
310 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
311 exit 1
312 ;;
313 # Recognize the basic CPU types with company name.
314 580-* \
315 | a29k-* \
316 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
317 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
318 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
319 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
320 | avr-* | avr32-* \
321 | bfin-* | bs2000-* \
322 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
323 | clipper-* | craynv-* | cydra-* \
324 | d10v-* | d30v-* | dlx-* \
325 | elxsi-* \
326 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
327 | h8300-* | h8500-* \
328 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
329 | i*86-* | i860-* | i960-* | ia64-* \
330 | ip2k-* | iq2000-* \
331 | m32c-* | m32r-* | m32rle-* \
332 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
333 | m88110-* | m88k-* | maxq-* | mcore-* \
334 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
335 | mips16-* \
336 | mips64-* | mips64el-* \
337 | mips64vr-* | mips64vrel-* \
338 | mips64orion-* | mips64orionel-* \
339 | mips64vr4100-* | mips64vr4100el-* \
340 | mips64vr4300-* | mips64vr4300el-* \
341 | mips64vr5000-* | mips64vr5000el-* \
342 | mips64vr5900-* | mips64vr5900el-* \
343 | mipsisa32-* | mipsisa32el-* \
344 | mipsisa32r2-* | mipsisa32r2el-* \
345 | mipsisa64-* | mipsisa64el-* \
346 | mipsisa64r2-* | mipsisa64r2el-* \
347 | mipsisa64sb1-* | mipsisa64sb1el-* \
348 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
349 | mipstx39-* | mipstx39el-* \
350 | mmix-* \
351 | mt-* \
352 | msp430-* \
353 | nios-* | nios2-* \
354 | none-* | np1-* | ns16k-* | ns32k-* \
355 | orion-* \
356 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
357 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
358 | pyramid-* \
359 | romp-* | rs6000-* \
360 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
361 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
362 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
363 | sparclite-* \
364 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
365 | tahoe-* | thumb-* \
366 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
367 | tron-* \
368 | v850-* | v850e-* | vax-* \
369 | we32k-* \
370 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
371 | xstormy16-* | xtensa*-* \
372 | ymp-* \
373 | z8k-*)
374 ;;
375 # Recognize the basic CPU types without company name, with glob match.
376 xtensa*)
377 basic_machine=$basic_machine-unknown
378 ;;
379 # Recognize the various machine names and aliases which stand
380 # for a CPU type and a company and sometimes even an OS.
381 386bsd)
382 basic_machine=i386-unknown
383 os=-bsd
384 ;;
385 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
386 basic_machine=m68000-att
387 ;;
388 3b*)
389 basic_machine=we32k-att
390 ;;
391 a29khif)
392 basic_machine=a29k-amd
393 os=-udi
394 ;;
395 abacus)
396 basic_machine=abacus-unknown
397 ;;
398 adobe68k)
399 basic_machine=m68010-adobe
400 os=-scout
401 ;;
402 alliant | fx80)
403 basic_machine=fx80-alliant
404 ;;
405 altos | altos3068)
406 basic_machine=m68k-altos
407 ;;
408 am29k)
409 basic_machine=a29k-none
410 os=-bsd
411 ;;
412 amd64)
413 basic_machine=x86_64-pc
414 ;;
415 amd64-*)
416 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
417 ;;
418 amdahl)
419 basic_machine=580-amdahl
420 os=-sysv
421 ;;
422 amiga | amiga-*)
423 basic_machine=m68k-unknown
424 ;;
425 amigaos | amigados)
426 basic_machine=m68k-unknown
427 os=-amigaos
428 ;;
429 amigaunix | amix)
430 basic_machine=m68k-unknown
431 os=-sysv4
432 ;;
433 apollo68)
434 basic_machine=m68k-apollo
435 os=-sysv
436 ;;
437 apollo68bsd)
438 basic_machine=m68k-apollo
439 os=-bsd
440 ;;
441 aux)
442 basic_machine=m68k-apple
443 os=-aux
444 ;;
445 balance)
446 basic_machine=ns32k-sequent
447 os=-dynix
448 ;;
449 blackfin)
450 basic_machine=bfin-unknown
451 os=-linux
452 ;;
453 blackfin-*)
454 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
455 os=-linux
456 ;;
457 c90)
458 basic_machine=c90-cray
459 os=-unicos
460 ;;
461 convex-c1)
462 basic_machine=c1-convex
463 os=-bsd
464 ;;
465 convex-c2)
466 basic_machine=c2-convex
467 os=-bsd
468 ;;
469 convex-c32)
470 basic_machine=c32-convex
471 os=-bsd
472 ;;
473 convex-c34)
474 basic_machine=c34-convex
475 os=-bsd
476 ;;
477 convex-c38)
478 basic_machine=c38-convex
479 os=-bsd
480 ;;
481 cray | j90)
482 basic_machine=j90-cray
483 os=-unicos
484 ;;
485 craynv)
486 basic_machine=craynv-cray
487 os=-unicosmp
488 ;;
489 cr16)
490 basic_machine=cr16-unknown
491 os=-elf
492 ;;
493 crds | unos)
494 basic_machine=m68k-crds
495 ;;
496 crisv32 | crisv32-* | etraxfs*)
497 basic_machine=crisv32-axis
498 ;;
499 cris | cris-* | etrax*)
500 basic_machine=cris-axis
501 ;;
502 crx)
503 basic_machine=crx-unknown
504 os=-elf
505 ;;
506 da30 | da30-*)
507 basic_machine=m68k-da30
508 ;;
509 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
510 basic_machine=mips-dec
511 ;;
512 decsystem10* | dec10*)
513 basic_machine=pdp10-dec
514 os=-tops10
515 ;;
516 decsystem20* | dec20*)
517 basic_machine=pdp10-dec
518 os=-tops20
519 ;;
520 delta | 3300 | motorola-3300 | motorola-delta \
521 | 3300-motorola | delta-motorola)
522 basic_machine=m68k-motorola
523 ;;
524 delta88)
525 basic_machine=m88k-motorola
526 os=-sysv3
527 ;;
528 djgpp)
529 basic_machine=i586-pc
530 os=-msdosdjgpp
531 ;;
532 dpx20 | dpx20-*)
533 basic_machine=rs6000-bull
534 os=-bosx
535 ;;
536 dpx2* | dpx2*-bull)
537 basic_machine=m68k-bull
538 os=-sysv3
539 ;;
540 ebmon29k)
541 basic_machine=a29k-amd
542 os=-ebmon
543 ;;
544 elxsi)
545 basic_machine=elxsi-elxsi
546 os=-bsd
547 ;;
548 encore | umax | mmax)
549 basic_machine=ns32k-encore
550 ;;
551 es1800 | OSE68k | ose68k | ose | OSE)
552 basic_machine=m68k-ericsson
553 os=-ose
554 ;;
555 fx2800)
556 basic_machine=i860-alliant
557 ;;
558 genix)
559 basic_machine=ns32k-ns
560 ;;
561 gmicro)
562 basic_machine=tron-gmicro
563 os=-sysv
564 ;;
565 go32)
566 basic_machine=i386-pc
567 os=-go32
568 ;;
569 h3050r* | hiux*)
570 basic_machine=hppa1.1-hitachi
571 os=-hiuxwe2
572 ;;
573 h8300hms)
574 basic_machine=h8300-hitachi
575 os=-hms
576 ;;
577 h8300xray)
578 basic_machine=h8300-hitachi
579 os=-xray
580 ;;
581 h8500hms)
582 basic_machine=h8500-hitachi
583 os=-hms
584 ;;
585 harris)
586 basic_machine=m88k-harris
587 os=-sysv3
588 ;;
589 hp300-*)
590 basic_machine=m68k-hp
591 ;;
592 hp300bsd)
593 basic_machine=m68k-hp
594 os=-bsd
595 ;;
596 hp300hpux)
597 basic_machine=m68k-hp
598 os=-hpux
599 ;;
600 hp3k9[0-9][0-9] | hp9[0-9][0-9])
601 basic_machine=hppa1.0-hp
602 ;;
603 hp9k2[0-9][0-9] | hp9k31[0-9])
604 basic_machine=m68000-hp
605 ;;
606 hp9k3[2-9][0-9])
607 basic_machine=m68k-hp
608 ;;
609 hp9k6[0-9][0-9] | hp6[0-9][0-9])
610 basic_machine=hppa1.0-hp
611 ;;
612 hp9k7[0-79][0-9] | hp7[0-79][0-9])
613 basic_machine=hppa1.1-hp
614 ;;
615 hp9k78[0-9] | hp78[0-9])
616 # FIXME: really hppa2.0-hp
617 basic_machine=hppa1.1-hp
618 ;;
619 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
620 # FIXME: really hppa2.0-hp
621 basic_machine=hppa1.1-hp
622 ;;
623 hp9k8[0-9][13679] | hp8[0-9][13679])
624 basic_machine=hppa1.1-hp
625 ;;
626 hp9k8[0-9][0-9] | hp8[0-9][0-9])
627 basic_machine=hppa1.0-hp
628 ;;
629 hppa-next)
630 os=-nextstep3
631 ;;
632 hppaosf)
633 basic_machine=hppa1.1-hp
634 os=-osf
635 ;;
636 hppro)
637 basic_machine=hppa1.1-hp
638 os=-proelf
639 ;;
640 i370-ibm* | ibm*)
641 basic_machine=i370-ibm
642 ;;
643 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
644 i*86v32)
645 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
646 os=-sysv32
647 ;;
648 i*86v4*)
649 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
650 os=-sysv4
651 ;;
652 i*86v)
653 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
654 os=-sysv
655 ;;
656 i*86sol2)
657 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
658 os=-solaris2
659 ;;
660 i386mach)
661 basic_machine=i386-mach
662 os=-mach
663 ;;
664 i386-vsta | vsta)
665 basic_machine=i386-unknown
666 os=-vsta
667 ;;
668 iris | iris4d)
669 basic_machine=mips-sgi
670 case $os in
671 -irix*)
672 ;;
673 *)
674 os=-irix4
675 ;;
676 esac
677 ;;
678 isi68 | isi)
679 basic_machine=m68k-isi
680 os=-sysv
681 ;;
682 m68knommu)
683 basic_machine=m68k-unknown
684 os=-linux
685 ;;
686 m68knommu-*)
687 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
688 os=-linux
689 ;;
690 m88k-omron*)
691 basic_machine=m88k-omron
692 ;;
693 magnum | m3230)
694 basic_machine=mips-mips
695 os=-sysv
696 ;;
697 merlin)
698 basic_machine=ns32k-utek
699 os=-sysv
700 ;;
701 mingw32)
702 basic_machine=i386-pc
703 os=-mingw32
704 ;;
705 mingw32ce)
706 basic_machine=arm-unknown
707 os=-mingw32ce
708 ;;
709 miniframe)
710 basic_machine=m68000-convergent
711 ;;
712 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
713 basic_machine=m68k-atari
714 os=-mint
715 ;;
716 mips3*-*)
717 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
718 ;;
719 mips3*)
720 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
721 ;;
722 monitor)
723 basic_machine=m68k-rom68k
724 os=-coff
725 ;;
726 morphos)
727 basic_machine=powerpc-unknown
728 os=-morphos
729 ;;
730 msdos)
731 basic_machine=i386-pc
732 os=-msdos
733 ;;
734 ms1-*)
735 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
736 ;;
737 mvs)
738 basic_machine=i370-ibm
739 os=-mvs
740 ;;
741 ncr3000)
742 basic_machine=i486-ncr
743 os=-sysv4
744 ;;
745 netbsd386)
746 basic_machine=i386-unknown
747 os=-netbsd
748 ;;
749 netwinder)
750 basic_machine=armv4l-rebel
751 os=-linux
752 ;;
753 news | news700 | news800 | news900)
754 basic_machine=m68k-sony
755 os=-newsos
756 ;;
757 news1000)
758 basic_machine=m68030-sony
759 os=-newsos
760 ;;
761 news-3600 | risc-news)
762 basic_machine=mips-sony
763 os=-newsos
764 ;;
765 necv70)
766 basic_machine=v70-nec
767 os=-sysv
768 ;;
769 next | m*-next )
770 basic_machine=m68k-next
771 case $os in
772 -nextstep* )
773 ;;
774 -ns2*)
775 os=-nextstep2
776 ;;
777 *)
778 os=-nextstep3
779 ;;
780 esac
781 ;;
782 nh3000)
783 basic_machine=m68k-harris
784 os=-cxux
785 ;;
786 nh[45]000)
787 basic_machine=m88k-harris
788 os=-cxux
789 ;;
790 nindy960)
791 basic_machine=i960-intel
792 os=-nindy
793 ;;
794 mon960)
795 basic_machine=i960-intel
796 os=-mon960
797 ;;
798 nonstopux)
799 basic_machine=mips-compaq
800 os=-nonstopux
801 ;;
802 np1)
803 basic_machine=np1-gould
804 ;;
805 nsr-tandem)
806 basic_machine=nsr-tandem
807 ;;
808 op50n-* | op60c-*)
809 basic_machine=hppa1.1-oki
810 os=-proelf
811 ;;
812 openrisc | openrisc-*)
813 basic_machine=or32-unknown
814 ;;
815 os400)
816 basic_machine=powerpc-ibm
817 os=-os400
818 ;;
819 OSE68000 | ose68000)
820 basic_machine=m68000-ericsson
821 os=-ose
822 ;;
823 os68k)
824 basic_machine=m68k-none
825 os=-os68k
826 ;;
827 pa-hitachi)
828 basic_machine=hppa1.1-hitachi
829 os=-hiuxwe2
830 ;;
831 paragon)
832 basic_machine=i860-intel
833 os=-osf
834 ;;
835 parisc)
836 basic_machine=hppa-unknown
837 os=-linux
838 ;;
839 parisc-*)
840 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
841 os=-linux
842 ;;
843 pbd)
844 basic_machine=sparc-tti
845 ;;
846 pbb)
847 basic_machine=m68k-tti
848 ;;
849 pc532 | pc532-*)
850 basic_machine=ns32k-pc532
851 ;;
852 pc98)
853 basic_machine=i386-pc
854 ;;
855 pc98-*)
856 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
857 ;;
858 pentium | p5 | k5 | k6 | nexgen | viac3)
859 basic_machine=i586-pc
860 ;;
861 pentiumpro | p6 | 6x86 | athlon | athlon_*)
862 basic_machine=i686-pc
863 ;;
864 pentiumii | pentium2 | pentiumiii | pentium3)
865 basic_machine=i686-pc
866 ;;
867 pentium4)
868 basic_machine=i786-pc
869 ;;
870 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
871 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
872 ;;
873 pentiumpro-* | p6-* | 6x86-* | athlon-*)
874 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
875 ;;
876 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
877 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
878 ;;
879 pentium4-*)
880 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
881 ;;
882 pn)
883 basic_machine=pn-gould
884 ;;
885 power) basic_machine=power-ibm
886 ;;
887 ppc) basic_machine=powerpc-unknown
888 ;;
889 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
890 ;;
891 ppcle | powerpclittle | ppc-le | powerpc-little)
892 basic_machine=powerpcle-unknown
893 ;;
894 ppcle-* | powerpclittle-*)
895 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
896 ;;
897 ppc64) basic_machine=powerpc64-unknown
898 ;;
899 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
900 ;;
901 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
902 basic_machine=powerpc64le-unknown
903 ;;
904 ppc64le-* | powerpc64little-*)
905 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
906 ;;
907 ps2)
908 basic_machine=i386-ibm
909 ;;
910 pw32)
911 basic_machine=i586-unknown
912 os=-pw32
913 ;;
914 rdos)
915 basic_machine=i386-pc
916 os=-rdos
917 ;;
918 rom68k)
919 basic_machine=m68k-rom68k
920 os=-coff
921 ;;
922 rm[46]00)
923 basic_machine=mips-siemens
924 ;;
925 rtpc | rtpc-*)
926 basic_machine=romp-ibm
927 ;;
928 s390 | s390-*)
929 basic_machine=s390-ibm
930 ;;
931 s390x | s390x-*)
932 basic_machine=s390x-ibm
933 ;;
934 sa29200)
935 basic_machine=a29k-amd
936 os=-udi
937 ;;
938 sb1)
939 basic_machine=mipsisa64sb1-unknown
940 ;;
941 sb1el)
942 basic_machine=mipsisa64sb1el-unknown
943 ;;
944 sde)
945 basic_machine=mipsisa32-sde
946 os=-elf
947 ;;
948 sei)
949 basic_machine=mips-sei
950 os=-seiux
951 ;;
952 sequent)
953 basic_machine=i386-sequent
954 ;;
955 sh)
956 basic_machine=sh-hitachi
957 os=-hms
958 ;;
959 sh5el)
960 basic_machine=sh5le-unknown
961 ;;
962 sh64)
963 basic_machine=sh64-unknown
964 ;;
965 sparclite-wrs | simso-wrs)
966 basic_machine=sparclite-wrs
967 os=-vxworks
968 ;;
969 sps7)
970 basic_machine=m68k-bull
971 os=-sysv2
972 ;;
973 spur)
974 basic_machine=spur-unknown
975 ;;
976 st2000)
977 basic_machine=m68k-tandem
978 ;;
979 stratus)
980 basic_machine=i860-stratus
981 os=-sysv4
982 ;;
983 sun2)
984 basic_machine=m68000-sun
985 ;;
986 sun2os3)
987 basic_machine=m68000-sun
988 os=-sunos3
989 ;;
990 sun2os4)
991 basic_machine=m68000-sun
992 os=-sunos4
993 ;;
994 sun3os3)
995 basic_machine=m68k-sun
996 os=-sunos3
997 ;;
998 sun3os4)
999 basic_machine=m68k-sun
1000 os=-sunos4
1001 ;;
1002 sun4os3)
1003 basic_machine=sparc-sun
1004 os=-sunos3
1005 ;;
1006 sun4os4)
1007 basic_machine=sparc-sun
1008 os=-sunos4
1009 ;;
1010 sun4sol2)
1011 basic_machine=sparc-sun
1012 os=-solaris2
1013 ;;
1014 sun3 | sun3-*)
1015 basic_machine=m68k-sun
1016 ;;
1017 sun4)
1018 basic_machine=sparc-sun
1019 ;;
1020 sun386 | sun386i | roadrunner)
1021 basic_machine=i386-sun
1022 ;;
1023 sv1)
1024 basic_machine=sv1-cray
1025 os=-unicos
1026 ;;
1027 symmetry)
1028 basic_machine=i386-sequent
1029 os=-dynix
1030 ;;
1031 t3e)
1032 basic_machine=alphaev5-cray
1033 os=-unicos
1034 ;;
1035 t90)
1036 basic_machine=t90-cray
1037 os=-unicos
1038 ;;
1039 tic54x | c54x*)
1040 basic_machine=tic54x-unknown
1041 os=-coff
1042 ;;
1043 tic55x | c55x*)
1044 basic_machine=tic55x-unknown
1045 os=-coff
1046 ;;
1047 tic6x | c6x*)
1048 basic_machine=tic6x-unknown
1049 os=-coff
1050 ;;
1051 tile*)
1052 basic_machine=tile-unknown
1053 os=-linux-gnu
1054 ;;
1055 tx39)
1056 basic_machine=mipstx39-unknown
1057 ;;
1058 tx39el)
1059 basic_machine=mipstx39el-unknown
1060 ;;
1061 toad1)
1062 basic_machine=pdp10-xkl
1063 os=-tops20
1064 ;;
1065 tower | tower-32)
1066 basic_machine=m68k-ncr
1067 ;;
1068 tpf)
1069 basic_machine=s390x-ibm
1070 os=-tpf
1071 ;;
1072 udi29k)
1073 basic_machine=a29k-amd
1074 os=-udi
1075 ;;
1076 ultra3)
1077 basic_machine=a29k-nyu
1078 os=-sym1
1079 ;;
1080 v810 | necv810)
1081 basic_machine=v810-nec
1082 os=-none
1083 ;;
1084 vaxv)
1085 basic_machine=vax-dec
1086 os=-sysv
1087 ;;
1088 vms)
1089 basic_machine=vax-dec
1090 os=-vms
1091 ;;
1092 vpp*|vx|vx-*)
1093 basic_machine=f301-fujitsu
1094 ;;
1095 vxworks960)
1096 basic_machine=i960-wrs
1097 os=-vxworks
1098 ;;
1099 vxworks68)
1100 basic_machine=m68k-wrs
1101 os=-vxworks
1102 ;;
1103 vxworks29k)
1104 basic_machine=a29k-wrs
1105 os=-vxworks
1106 ;;
1107 w65*)
1108 basic_machine=w65-wdc
1109 os=-none
1110 ;;
1111 w89k-*)
1112 basic_machine=hppa1.1-winbond
1113 os=-proelf
1114 ;;
1115 xbox)
1116 basic_machine=i686-pc
1117 os=-mingw32
1118 ;;
1119 xps | xps100)
1120 basic_machine=xps100-honeywell
1121 ;;
1122 ymp)
1123 basic_machine=ymp-cray
1124 os=-unicos
1125 ;;
1126 z8k-*-coff)
1127 basic_machine=z8k-unknown
1128 os=-sim
1129 ;;
1130 none)
1131 basic_machine=none-none
1132 os=-none
1133 ;;
1134
1135 # Here we handle the default manufacturer of certain CPU types. It is in
1136 # some cases the only manufacturer, in others, it is the most popular.
1137 w89k)
1138 basic_machine=hppa1.1-winbond
1139 ;;
1140 op50n)
1141 basic_machine=hppa1.1-oki
1142 ;;
1143 op60c)
1144 basic_machine=hppa1.1-oki
1145 ;;
1146 romp)
1147 basic_machine=romp-ibm
1148 ;;
1149 mmix)
1150 basic_machine=mmix-knuth
1151 ;;
1152 rs6000)
1153 basic_machine=rs6000-ibm
1154 ;;
1155 vax)
1156 basic_machine=vax-dec
1157 ;;
1158 pdp10)
1159 # there are many clones, so DEC is not a safe bet
1160 basic_machine=pdp10-unknown
1161 ;;
1162 pdp11)
1163 basic_machine=pdp11-dec
1164 ;;
1165 we32k)
1166 basic_machine=we32k-att
1167 ;;
1168 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1169 basic_machine=sh-unknown
1170 ;;
1171 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1172 basic_machine=sparc-sun
1173 ;;
1174 cydra)
1175 basic_machine=cydra-cydrome
1176 ;;
1177 orion)
1178 basic_machine=orion-highlevel
1179 ;;
1180 orion105)
1181 basic_machine=clipper-highlevel
1182 ;;
1183 mac | mpw | mac-mpw)
1184 basic_machine=m68k-apple
1185 ;;
1186 pmac | pmac-mpw)
1187 basic_machine=powerpc-apple
1188 ;;
1189 *-unknown)
1190 # Make sure to match an already-canonicalized machine name.
1191 ;;
1192 *)
1193 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1194 exit 1
1195 ;;
1196 esac
1197
1198 # Here we canonicalize certain aliases for manufacturers.
1199 case $basic_machine in
1200 *-digital*)
1201 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1202 ;;
1203 *-commodore*)
1204 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1205 ;;
1206 *)
1207 ;;
1208 esac
1209
1210 # Decode manufacturer-specific aliases for certain operating systems.
1211
1212 if [ x"$os" != x"" ]
1213 then
1214 case $os in
1215 # First match some system type aliases
1216 # that might get confused with valid system types.
1217 # -solaris* is a basic system type, with this one exception.
1218 -solaris1 | -solaris1.*)
1219 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1220 ;;
1221 -solaris)
1222 os=-solaris2
1223 ;;
1224 -svr4*)
1225 os=-sysv4
1226 ;;
1227 -unixware*)
1228 os=-sysv4.2uw
1229 ;;
1230 -gnu/linux*)
1231 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1232 ;;
1233 # First accept the basic system types.
1234 # The portable systems comes first.
1235 # Each alternative MUST END IN A *, to match a version number.
1236 # -sysv* is not here because it comes later, after sysvr4.
1237 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1238 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1239 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1240 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1241 | -aos* \
1242 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1243 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1244 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1245 | -openbsd* | -solidbsd* \
1246 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1247 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1248 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1249 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1250 | -chorusos* | -chorusrdb* \
1251 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1252 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1253 | -uxpv* | -beos* | -mpeix* | -udk* \
1254 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1255 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1256 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1257 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1258 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1259 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1260 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1261 # Remember, each alternative MUST END IN *, to match a version number.
1262 ;;
1263 -qnx*)
1264 case $basic_machine in
1265 x86-* | i*86-*)
1266 ;;
1267 *)
1268 os=-nto$os
1269 ;;
1270 esac
1271 ;;
1272 -nto-qnx*)
1273 ;;
1274 -nto*)
1275 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1276 ;;
1277 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1278 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1279 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1280 ;;
1281 -mac*)
1282 os=`echo $os | sed -e 's|mac|macos|'`
1283 ;;
1284 -linux-dietlibc)
1285 os=-linux-dietlibc
1286 ;;
1287 -linux*)
1288 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1289 ;;
1290 -sunos5*)
1291 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1292 ;;
1293 -sunos6*)
1294 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1295 ;;
1296 -opened*)
1297 os=-openedition
1298 ;;
1299 -os400*)
1300 os=-os400
1301 ;;
1302 -wince*)
1303 os=-wince
1304 ;;
1305 -osfrose*)
1306 os=-osfrose
1307 ;;
1308 -osf*)
1309 os=-osf
1310 ;;
1311 -utek*)
1312 os=-bsd
1313 ;;
1314 -dynix*)
1315 os=-bsd
1316 ;;
1317 -acis*)
1318 os=-aos
1319 ;;
1320 -atheos*)
1321 os=-atheos
1322 ;;
1323 -syllable*)
1324 os=-syllable
1325 ;;
1326 -386bsd)
1327 os=-bsd
1328 ;;
1329 -ctix* | -uts*)
1330 os=-sysv
1331 ;;
1332 -nova*)
1333 os=-rtmk-nova
1334 ;;
1335 -ns2 )
1336 os=-nextstep2
1337 ;;
1338 -nsk*)
1339 os=-nsk
1340 ;;
1341 # Preserve the version number of sinix5.
1342 -sinix5.*)
1343 os=`echo $os | sed -e 's|sinix|sysv|'`
1344 ;;
1345 -sinix*)
1346 os=-sysv4
1347 ;;
1348 -tpf*)
1349 os=-tpf
1350 ;;
1351 -triton*)
1352 os=-sysv3
1353 ;;
1354 -oss*)
1355 os=-sysv3
1356 ;;
1357 -svr4)
1358 os=-sysv4
1359 ;;
1360 -svr3)
1361 os=-sysv3
1362 ;;
1363 -sysvr4)
1364 os=-sysv4
1365 ;;
1366 # This must come after -sysvr4.
1367 -sysv*)
1368 ;;
1369 -ose*)
1370 os=-ose
1371 ;;
1372 -es1800*)
1373 os=-ose
1374 ;;
1375 -xenix)
1376 os=-xenix
1377 ;;
1378 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1379 os=-mint
1380 ;;
1381 -aros*)
1382 os=-aros
1383 ;;
1384 -kaos*)
1385 os=-kaos
1386 ;;
1387 -zvmoe)
1388 os=-zvmoe
1389 ;;
1390 -none)
1391 ;;
1392 *)
1393 # Get rid of the `-' at the beginning of $os.
1394 os=`echo $os | sed 's/[^-]*-//'`
1395 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1396 exit 1
1397 ;;
1398 esac
1399 else
1400
1401 # Here we handle the default operating systems that come with various machines.
1402 # The value should be what the vendor currently ships out the door with their
1403 # machine or put another way, the most popular os provided with the machine.
1404
1405 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1406 # "-sun"), then you have to tell the case statement up towards the top
1407 # that MANUFACTURER isn't an operating system. Otherwise, code above
1408 # will signal an error saying that MANUFACTURER isn't an operating
1409 # system, and we'll never get to this point.
1410
1411 case $basic_machine in
1412 score-*)
1413 os=-elf
1414 ;;
1415 spu-*)
1416 os=-elf
1417 ;;
1418 *-acorn)
1419 os=-riscix1.2
1420 ;;
1421 arm*-rebel)
1422 os=-linux
1423 ;;
1424 arm*-semi)
1425 os=-aout
1426 ;;
1427 c4x-* | tic4x-*)
1428 os=-coff
1429 ;;
1430 # This must come before the *-dec entry.
1431 pdp10-*)
1432 os=-tops20
1433 ;;
1434 pdp11-*)
1435 os=-none
1436 ;;
1437 *-dec | vax-*)
1438 os=-ultrix4.2
1439 ;;
1440 m68*-apollo)
1441 os=-domain
1442 ;;
1443 i386-sun)
1444 os=-sunos4.0.2
1445 ;;
1446 m68000-sun)
1447 os=-sunos3
1448 # This also exists in the configure program, but was not the
1449 # default.
1450 # os=-sunos4
1451 ;;
1452 m68*-cisco)
1453 os=-aout
1454 ;;
1455 mep-*)
1456 os=-elf
1457 ;;
1458 mips*-cisco)
1459 os=-elf
1460 ;;
1461 mips*-*)
1462 os=-elf
1463 ;;
1464 or32-*)
1465 os=-coff
1466 ;;
1467 *-tti) # must be before sparc entry or we get the wrong os.
1468 os=-sysv3
1469 ;;
1470 sparc-* | *-sun)
1471 os=-sunos4.1.1
1472 ;;
1473 *-be)
1474 os=-beos
1475 ;;
1476 *-haiku)
1477 os=-haiku
1478 ;;
1479 *-ibm)
1480 os=-aix
1481 ;;
1482 *-knuth)
1483 os=-mmixware
1484 ;;
1485 *-wec)
1486 os=-proelf
1487 ;;
1488 *-winbond)
1489 os=-proelf
1490 ;;
1491 *-oki)
1492 os=-proelf
1493 ;;
1494 *-hp)
1495 os=-hpux
1496 ;;
1497 *-hitachi)
1498 os=-hiux
1499 ;;
1500 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1501 os=-sysv
1502 ;;
1503 *-cbm)
1504 os=-amigaos
1505 ;;
1506 *-dg)
1507 os=-dgux
1508 ;;
1509 *-dolphin)
1510 os=-sysv3
1511 ;;
1512 m68k-ccur)
1513 os=-rtu
1514 ;;
1515 m88k-omron*)
1516 os=-luna
1517 ;;
1518 *-next )
1519 os=-nextstep
1520 ;;
1521 *-sequent)
1522 os=-ptx
1523 ;;
1524 *-crds)
1525 os=-unos
1526 ;;
1527 *-ns)
1528 os=-genix
1529 ;;
1530 i370-*)
1531 os=-mvs
1532 ;;
1533 *-next)
1534 os=-nextstep3
1535 ;;
1536 *-gould)
1537 os=-sysv
1538 ;;
1539 *-highlevel)
1540 os=-bsd
1541 ;;
1542 *-encore)
1543 os=-bsd
1544 ;;
1545 *-sgi)
1546 os=-irix
1547 ;;
1548 *-siemens)
1549 os=-sysv4
1550 ;;
1551 *-masscomp)
1552 os=-rtu
1553 ;;
1554 f30[01]-fujitsu | f700-fujitsu)
1555 os=-uxpv
1556 ;;
1557 *-rom68k)
1558 os=-coff
1559 ;;
1560 *-*bug)
1561 os=-coff
1562 ;;
1563 *-apple)
1564 os=-macos
1565 ;;
1566 *-atari*)
1567 os=-mint
1568 ;;
1569 *)
1570 os=-none
1571 ;;
1572 esac
1573 fi
1574
1575 # Here we handle the case where we know the os, and the CPU type, but not the
1576 # manufacturer. We pick the logical manufacturer.
1577 vendor=unknown
1578 case $basic_machine in
1579 *-unknown)
1580 case $os in
1581 -riscix*)
1582 vendor=acorn
1583 ;;
1584 -sunos*)
1585 vendor=sun
1586 ;;
1587 -aix*)
1588 vendor=ibm
1589 ;;
1590 -beos*)
1591 vendor=be
1592 ;;
1593 -hpux*)
1594 vendor=hp
1595 ;;
1596 -mpeix*)
1597 vendor=hp
1598 ;;
1599 -hiux*)
1600 vendor=hitachi
1601 ;;
1602 -unos*)
1603 vendor=crds
1604 ;;
1605 -dgux*)
1606 vendor=dg
1607 ;;
1608 -luna*)
1609 vendor=omron
1610 ;;
1611 -genix*)
1612 vendor=ns
1613 ;;
1614 -mvs* | -opened*)
1615 vendor=ibm
1616 ;;
1617 -os400*)
1618 vendor=ibm
1619 ;;
1620 -ptx*)
1621 vendor=sequent
1622 ;;
1623 -tpf*)
1624 vendor=ibm
1625 ;;
1626 -vxsim* | -vxworks* | -windiss*)
1627 vendor=wrs
1628 ;;
1629 -aux*)
1630 vendor=apple
1631 ;;
1632 -hms*)
1633 vendor=hitachi
1634 ;;
1635 -mpw* | -macos*)
1636 vendor=apple
1637 ;;
1638 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1639 vendor=atari
1640 ;;
1641 -vos*)
1642 vendor=stratus
1643 ;;
1644 esac
1645 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1646 ;;
1647 esac
1648
1649 echo $basic_machine$os
1650 exit
1651
1652 # Local variables:
1653 # eval: (add-hook 'write-file-hooks 'time-stamp)
1654 # time-stamp-start: "timestamp='"
1655 # time-stamp-format: "%:y-%02m-%02d"
1656 # time-stamp-end: "'"
1657 # End:
+0
-589
config/depcomp less more
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2007-03-29.01
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
6 # Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
29
30 case $1 in
31 '')
32 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
33 exit 1;
34 ;;
35 -h | --h*)
36 cat <<\EOF
37 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
38
39 Run PROGRAMS ARGS to compile a file, generating dependencies
40 as side-effects.
41
42 Environment variables:
43 depmode Dependency tracking mode.
44 source Source file read by `PROGRAMS ARGS'.
45 object Object file output by `PROGRAMS ARGS'.
46 DEPDIR directory where to store dependencies.
47 depfile Dependency file to output.
48 tmpdepfile Temporary file to use when outputing dependencies.
49 libtool Whether libtool is used (yes/no).
50
51 Report bugs to <bug-automake@gnu.org>.
52 EOF
53 exit $?
54 ;;
55 -v | --v*)
56 echo "depcomp $scriptversion"
57 exit $?
58 ;;
59 esac
60
61 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
62 echo "depcomp: Variables source, object and depmode must be set" 1>&2
63 exit 1
64 fi
65
66 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
67 depfile=${depfile-`echo "$object" |
68 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
69 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
70
71 rm -f "$tmpdepfile"
72
73 # Some modes work just like other modes, but use different flags. We
74 # parameterize here, but still list the modes in the big case below,
75 # to make depend.m4 easier to write. Note that we *cannot* use a case
76 # here, because this file can only contain one case statement.
77 if test "$depmode" = hp; then
78 # HP compiler uses -M and no extra arg.
79 gccflag=-M
80 depmode=gcc
81 fi
82
83 if test "$depmode" = dashXmstdout; then
84 # This is just like dashmstdout with a different argument.
85 dashmflag=-xM
86 depmode=dashmstdout
87 fi
88
89 case "$depmode" in
90 gcc3)
91 ## gcc 3 implements dependency tracking that does exactly what
92 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
93 ## it if -MD -MP comes after the -MF stuff. Hmm.
94 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
95 ## the command line argument order; so add the flags where they
96 ## appear in depend2.am. Note that the slowdown incurred here
97 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
98 for arg
99 do
100 case $arg in
101 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
102 *) set fnord "$@" "$arg" ;;
103 esac
104 shift # fnord
105 shift # $arg
106 done
107 "$@"
108 stat=$?
109 if test $stat -eq 0; then :
110 else
111 rm -f "$tmpdepfile"
112 exit $stat
113 fi
114 mv "$tmpdepfile" "$depfile"
115 ;;
116
117 gcc)
118 ## There are various ways to get dependency output from gcc. Here's
119 ## why we pick this rather obscure method:
120 ## - Don't want to use -MD because we'd like the dependencies to end
121 ## up in a subdir. Having to rename by hand is ugly.
122 ## (We might end up doing this anyway to support other compilers.)
123 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
124 ## -MM, not -M (despite what the docs say).
125 ## - Using -M directly means running the compiler twice (even worse
126 ## than renaming).
127 if test -z "$gccflag"; then
128 gccflag=-MD,
129 fi
130 "$@" -Wp,"$gccflag$tmpdepfile"
131 stat=$?
132 if test $stat -eq 0; then :
133 else
134 rm -f "$tmpdepfile"
135 exit $stat
136 fi
137 rm -f "$depfile"
138 echo "$object : \\" > "$depfile"
139 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
140 ## The second -e expression handles DOS-style file names with drive letters.
141 sed -e 's/^[^:]*: / /' \
142 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
143 ## This next piece of magic avoids the `deleted header file' problem.
144 ## The problem is that when a header file which appears in a .P file
145 ## is deleted, the dependency causes make to die (because there is
146 ## typically no way to rebuild the header). We avoid this by adding
147 ## dummy dependencies for each header file. Too bad gcc doesn't do
148 ## this for us directly.
149 tr ' ' '
150 ' < "$tmpdepfile" |
151 ## Some versions of gcc put a space before the `:'. On the theory
152 ## that the space means something, we add a space to the output as
153 ## well.
154 ## Some versions of the HPUX 10.20 sed can't process this invocation
155 ## correctly. Breaking it into two sed invocations is a workaround.
156 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
157 rm -f "$tmpdepfile"
158 ;;
159
160 hp)
161 # This case exists only to let depend.m4 do its work. It works by
162 # looking at the text of this script. This case will never be run,
163 # since it is checked for above.
164 exit 1
165 ;;
166
167 sgi)
168 if test "$libtool" = yes; then
169 "$@" "-Wp,-MDupdate,$tmpdepfile"
170 else
171 "$@" -MDupdate "$tmpdepfile"
172 fi
173 stat=$?
174 if test $stat -eq 0; then :
175 else
176 rm -f "$tmpdepfile"
177 exit $stat
178 fi
179 rm -f "$depfile"
180
181 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
182 echo "$object : \\" > "$depfile"
183
184 # Clip off the initial element (the dependent). Don't try to be
185 # clever and replace this with sed code, as IRIX sed won't handle
186 # lines with more than a fixed number of characters (4096 in
187 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
188 # the IRIX cc adds comments like `#:fec' to the end of the
189 # dependency line.
190 tr ' ' '
191 ' < "$tmpdepfile" \
192 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
193 tr '
194 ' ' ' >> $depfile
195 echo >> $depfile
196
197 # The second pass generates a dummy entry for each header file.
198 tr ' ' '
199 ' < "$tmpdepfile" \
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
201 >> $depfile
202 else
203 # The sourcefile does not contain any dependencies, so just
204 # store a dummy comment line, to avoid errors with the Makefile
205 # "include basename.Plo" scheme.
206 echo "#dummy" > "$depfile"
207 fi
208 rm -f "$tmpdepfile"
209 ;;
210
211 aix)
212 # The C for AIX Compiler uses -M and outputs the dependencies
213 # in a .u file. In older versions, this file always lives in the
214 # current directory. Also, the AIX compiler puts `$object:' at the
215 # start of each line; $object doesn't have directory information.
216 # Version 6 uses the directory in both cases.
217 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
218 test "x$dir" = "x$object" && dir=
219 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
220 if test "$libtool" = yes; then
221 tmpdepfile1=$dir$base.u
222 tmpdepfile2=$base.u
223 tmpdepfile3=$dir.libs/$base.u
224 "$@" -Wc,-M
225 else
226 tmpdepfile1=$dir$base.u
227 tmpdepfile2=$dir$base.u
228 tmpdepfile3=$dir$base.u
229 "$@" -M
230 fi
231 stat=$?
232
233 if test $stat -eq 0; then :
234 else
235 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
236 exit $stat
237 fi
238
239 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
240 do
241 test -f "$tmpdepfile" && break
242 done
243 if test -f "$tmpdepfile"; then
244 # Each line is of the form `foo.o: dependent.h'.
245 # Do two passes, one to just change these to
246 # `$object: dependent.h' and one to simply `dependent.h:'.
247 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
248 # That's a tab and a space in the [].
249 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
250 else
251 # The sourcefile does not contain any dependencies, so just
252 # store a dummy comment line, to avoid errors with the Makefile
253 # "include basename.Plo" scheme.
254 echo "#dummy" > "$depfile"
255 fi
256 rm -f "$tmpdepfile"
257 ;;
258
259 icc)
260 # Intel's C compiler understands `-MD -MF file'. However on
261 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
262 # ICC 7.0 will fill foo.d with something like
263 # foo.o: sub/foo.c
264 # foo.o: sub/foo.h
265 # which is wrong. We want:
266 # sub/foo.o: sub/foo.c
267 # sub/foo.o: sub/foo.h
268 # sub/foo.c:
269 # sub/foo.h:
270 # ICC 7.1 will output
271 # foo.o: sub/foo.c sub/foo.h
272 # and will wrap long lines using \ :
273 # foo.o: sub/foo.c ... \
274 # sub/foo.h ... \
275 # ...
276
277 "$@" -MD -MF "$tmpdepfile"
278 stat=$?
279 if test $stat -eq 0; then :
280 else
281 rm -f "$tmpdepfile"
282 exit $stat
283 fi
284 rm -f "$depfile"
285 # Each line is of the form `foo.o: dependent.h',
286 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
287 # Do two passes, one to just change these to
288 # `$object: dependent.h' and one to simply `dependent.h:'.
289 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
290 # Some versions of the HPUX 10.20 sed can't process this invocation
291 # correctly. Breaking it into two sed invocations is a workaround.
292 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
293 sed -e 's/$/ :/' >> "$depfile"
294 rm -f "$tmpdepfile"
295 ;;
296
297 hp2)
298 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
299 # compilers, which have integrated preprocessors. The correct option
300 # to use with these is +Maked; it writes dependencies to a file named
301 # 'foo.d', which lands next to the object file, wherever that
302 # happens to be.
303 # Much of this is similar to the tru64 case; see comments there.
304 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
305 test "x$dir" = "x$object" && dir=
306 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
307 if test "$libtool" = yes; then
308 tmpdepfile1=$dir$base.d
309 tmpdepfile2=$dir.libs/$base.d
310 "$@" -Wc,+Maked
311 else
312 tmpdepfile1=$dir$base.d
313 tmpdepfile2=$dir$base.d
314 "$@" +Maked
315 fi
316 stat=$?
317 if test $stat -eq 0; then :
318 else
319 rm -f "$tmpdepfile1" "$tmpdepfile2"
320 exit $stat
321 fi
322
323 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
324 do
325 test -f "$tmpdepfile" && break
326 done
327 if test -f "$tmpdepfile"; then
328 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
329 # Add `dependent.h:' lines.
330 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
331 else
332 echo "#dummy" > "$depfile"
333 fi
334 rm -f "$tmpdepfile" "$tmpdepfile2"
335 ;;
336
337 tru64)
338 # The Tru64 compiler uses -MD to generate dependencies as a side
339 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
340 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
341 # dependencies in `foo.d' instead, so we check for that too.
342 # Subdirectories are respected.
343 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
344 test "x$dir" = "x$object" && dir=
345 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
346
347 if test "$libtool" = yes; then
348 # With Tru64 cc, shared objects can also be used to make a
349 # static library. This mechanism is used in libtool 1.4 series to
350 # handle both shared and static libraries in a single compilation.
351 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
352 #
353 # With libtool 1.5 this exception was removed, and libtool now
354 # generates 2 separate objects for the 2 libraries. These two
355 # compilations output dependencies in $dir.libs/$base.o.d and
356 # in $dir$base.o.d. We have to check for both files, because
357 # one of the two compilations can be disabled. We should prefer
358 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
359 # automatically cleaned when .libs/ is deleted, while ignoring
360 # the former would cause a distcleancheck panic.
361 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
362 tmpdepfile2=$dir$base.o.d # libtool 1.5
363 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
364 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
365 "$@" -Wc,-MD
366 else
367 tmpdepfile1=$dir$base.o.d
368 tmpdepfile2=$dir$base.d
369 tmpdepfile3=$dir$base.d
370 tmpdepfile4=$dir$base.d
371 "$@" -MD
372 fi
373
374 stat=$?
375 if test $stat -eq 0; then :
376 else
377 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
378 exit $stat
379 fi
380
381 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
382 do
383 test -f "$tmpdepfile" && break
384 done
385 if test -f "$tmpdepfile"; then
386 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
387 # That's a tab and a space in the [].
388 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
389 else
390 echo "#dummy" > "$depfile"
391 fi
392 rm -f "$tmpdepfile"
393 ;;
394
395 #nosideeffect)
396 # This comment above is used by automake to tell side-effect
397 # dependency tracking mechanisms from slower ones.
398
399 dashmstdout)
400 # Important note: in order to support this mode, a compiler *must*
401 # always write the preprocessed file to stdout, regardless of -o.
402 "$@" || exit $?
403
404 # Remove the call to Libtool.
405 if test "$libtool" = yes; then
406 while test $1 != '--mode=compile'; do
407 shift
408 done
409 shift
410 fi
411
412 # Remove `-o $object'.
413 IFS=" "
414 for arg
415 do
416 case $arg in
417 -o)
418 shift
419 ;;
420 $object)
421 shift
422 ;;
423 *)
424 set fnord "$@" "$arg"
425 shift # fnord
426 shift # $arg
427 ;;
428 esac
429 done
430
431 test -z "$dashmflag" && dashmflag=-M
432 # Require at least two characters before searching for `:'
433 # in the target name. This is to cope with DOS-style filenames:
434 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
435 "$@" $dashmflag |
436 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
437 rm -f "$depfile"
438 cat < "$tmpdepfile" > "$depfile"
439 tr ' ' '
440 ' < "$tmpdepfile" | \
441 ## Some versions of the HPUX 10.20 sed can't process this invocation
442 ## correctly. Breaking it into two sed invocations is a workaround.
443 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
444 rm -f "$tmpdepfile"
445 ;;
446
447 dashXmstdout)
448 # This case only exists to satisfy depend.m4. It is never actually
449 # run, as this mode is specially recognized in the preamble.
450 exit 1
451 ;;
452
453 makedepend)
454 "$@" || exit $?
455 # Remove any Libtool call
456 if test "$libtool" = yes; then
457 while test $1 != '--mode=compile'; do
458 shift
459 done
460 shift
461 fi
462 # X makedepend
463 shift
464 cleared=no
465 for arg in "$@"; do
466 case $cleared in
467 no)
468 set ""; shift
469 cleared=yes ;;
470 esac
471 case "$arg" in
472 -D*|-I*)
473 set fnord "$@" "$arg"; shift ;;
474 # Strip any option that makedepend may not understand. Remove
475 # the object too, otherwise makedepend will parse it as a source file.
476 -*|$object)
477 ;;
478 *)
479 set fnord "$@" "$arg"; shift ;;
480 esac
481 done
482 obj_suffix="`echo $object | sed 's/^.*\././'`"
483 touch "$tmpdepfile"
484 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
485 rm -f "$depfile"
486 cat < "$tmpdepfile" > "$depfile"
487 sed '1,2d' "$tmpdepfile" | tr ' ' '
488 ' | \
489 ## Some versions of the HPUX 10.20 sed can't process this invocation
490 ## correctly. Breaking it into two sed invocations is a workaround.
491 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
492 rm -f "$tmpdepfile" "$tmpdepfile".bak
493 ;;
494
495 cpp)
496 # Important note: in order to support this mode, a compiler *must*
497 # always write the preprocessed file to stdout.
498 "$@" || exit $?
499
500 # Remove the call to Libtool.
501 if test "$libtool" = yes; then
502 while test $1 != '--mode=compile'; do
503 shift
504 done
505 shift
506 fi
507
508 # Remove `-o $object'.
509 IFS=" "
510 for arg
511 do
512 case $arg in
513 -o)
514 shift
515 ;;
516 $object)
517 shift
518 ;;
519 *)
520 set fnord "$@" "$arg"
521 shift # fnord
522 shift # $arg
523 ;;
524 esac
525 done
526
527 "$@" -E |
528 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
529 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
530 sed '$ s: \\$::' > "$tmpdepfile"
531 rm -f "$depfile"
532 echo "$object : \\" > "$depfile"
533 cat < "$tmpdepfile" >> "$depfile"
534 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
535 rm -f "$tmpdepfile"
536 ;;
537
538 msvisualcpp)
539 # Important note: in order to support this mode, a compiler *must*
540 # always write the preprocessed file to stdout, regardless of -o,
541 # because we must use -o when running libtool.
542 "$@" || exit $?
543 IFS=" "
544 for arg
545 do
546 case "$arg" in
547 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
548 set fnord "$@"
549 shift
550 shift
551 ;;
552 *)
553 set fnord "$@" "$arg"
554 shift
555 shift
556 ;;
557 esac
558 done
559 "$@" -E |
560 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
561 rm -f "$depfile"
562 echo "$object : \\" > "$depfile"
563 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
564 echo " " >> "$depfile"
565 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
566 rm -f "$tmpdepfile"
567 ;;
568
569 none)
570 exec "$@"
571 ;;
572
573 *)
574 echo "Unknown depmode $depmode" 1>&2
575 exit 1
576 ;;
577 esac
578
579 exit 0
580
581 # Local Variables:
582 # mode: shell-script
583 # sh-indentation: 2
584 # eval: (add-hook 'write-file-hooks 'time-stamp)
585 # time-stamp-start: "scriptversion="
586 # time-stamp-format: "%:y-%02m-%02d.%02H"
587 # time-stamp-end: "$"
588 # End:
+0
-519
config/install-sh less more
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2006-12-25.00
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 shift;;
159
160 -T) no_target_directory=true;;
161
162 --version) echo "$0 $scriptversion"; exit $?;;
163
164 --) shift
165 break;;
166
167 -*) echo "$0: invalid option: $1" >&2
168 exit 1;;
169
170 *) break;;
171 esac
172 shift
173 done
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 done
189 fi
190
191 if test $# -eq 0; then
192 if test -z "$dir_arg"; then
193 echo "$0: no input file specified." >&2
194 exit 1
195 fi
196 # It's OK to call `install-sh -d' without argument.
197 # This can happen when creating conditional directories.
198 exit 0
199 fi
200
201 if test -z "$dir_arg"; then
202 trap '(exit $?); exit' 1 2 13 15
203
204 # Set umask so as not to create temps with too-generous modes.
205 # However, 'strip' requires both read and write access to temps.
206 case $mode in
207 # Optimize common cases.
208 *644) cp_umask=133;;
209 *755) cp_umask=22;;
210
211 *[0-7])
212 if test -z "$stripcmd"; then
213 u_plus_rw=
214 else
215 u_plus_rw='% 200'
216 fi
217 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
218 *)
219 if test -z "$stripcmd"; then
220 u_plus_rw=
221 else
222 u_plus_rw=,u+rw
223 fi
224 cp_umask=$mode$u_plus_rw;;
225 esac
226 fi
227
228 for src
229 do
230 # Protect names starting with `-'.
231 case $src in
232 -*) src=./$src;;
233 esac
234
235 if test -n "$dir_arg"; then
236 dst=$src
237 dstdir=$dst
238 test -d "$dstdir"
239 dstdir_status=$?
240 else
241
242 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
243 # might cause directories to be created, which would be especially bad
244 # if $src (and thus $dsttmp) contains '*'.
245 if test ! -f "$src" && test ! -d "$src"; then
246 echo "$0: $src does not exist." >&2
247 exit 1
248 fi
249
250 if test -z "$dst_arg"; then
251 echo "$0: no destination specified." >&2
252 exit 1
253 fi
254
255 dst=$dst_arg
256 # Protect names starting with `-'.
257 case $dst in
258 -*) dst=./$dst;;
259 esac
260
261 # If destination is a directory, append the input filename; won't work
262 # if double slashes aren't ignored.
263 if test -d "$dst"; then
264 if test -n "$no_target_directory"; then
265 echo "$0: $dst_arg: Is a directory" >&2
266 exit 1
267 fi
268 dstdir=$dst
269 dst=$dstdir/`basename "$src"`
270 dstdir_status=0
271 else
272 # Prefer dirname, but fall back on a substitute if dirname fails.
273 dstdir=`
274 (dirname "$dst") 2>/dev/null ||
275 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
276 X"$dst" : 'X\(//\)[^/]' \| \
277 X"$dst" : 'X\(//\)$' \| \
278 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
279 echo X"$dst" |
280 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
281 s//\1/
282 q
283 }
284 /^X\(\/\/\)[^/].*/{
285 s//\1/
286 q
287 }
288 /^X\(\/\/\)$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\).*/{
293 s//\1/
294 q
295 }
296 s/.*/./; q'
297 `
298
299 test -d "$dstdir"
300 dstdir_status=$?
301 fi
302 fi
303
304 obsolete_mkdir_used=false
305
306 if test $dstdir_status != 0; then
307 case $posix_mkdir in
308 '')
309 # Create intermediate dirs using mode 755 as modified by the umask.
310 # This is like FreeBSD 'install' as of 1997-10-28.
311 umask=`umask`
312 case $stripcmd.$umask in
313 # Optimize common cases.
314 *[2367][2367]) mkdir_umask=$umask;;
315 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
316
317 *[0-7])
318 mkdir_umask=`expr $umask + 22 \
319 - $umask % 100 % 40 + $umask % 20 \
320 - $umask % 10 % 4 + $umask % 2
321 `;;
322 *) mkdir_umask=$umask,go-w;;
323 esac
324
325 # With -d, create the new directory with the user-specified mode.
326 # Otherwise, rely on $mkdir_umask.
327 if test -n "$dir_arg"; then
328 mkdir_mode=-m$mode
329 else
330 mkdir_mode=
331 fi
332
333 posix_mkdir=false
334 case $umask in
335 *[123567][0-7][0-7])
336 # POSIX mkdir -p sets u+wx bits regardless of umask, which
337 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
338 ;;
339 *)
340 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
341 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
342
343 if (umask $mkdir_umask &&
344 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 then
346 if test -z "$dir_arg" || {
347 # Check for POSIX incompatibilities with -m.
348 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
349 # other-writeable bit of parent directory when it shouldn't.
350 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
351 ls_ld_tmpdir=`ls -ld "$tmpdir"`
352 case $ls_ld_tmpdir in
353 d????-?r-*) different_mode=700;;
354 d????-?--*) different_mode=755;;
355 *) false;;
356 esac &&
357 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
358 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
359 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
360 }
361 }
362 then posix_mkdir=:
363 fi
364 rmdir "$tmpdir/d" "$tmpdir"
365 else
366 # Remove any dirs left behind by ancient mkdir implementations.
367 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
368 fi
369 trap '' 0;;
370 esac;;
371 esac
372
373 if
374 $posix_mkdir && (
375 umask $mkdir_umask &&
376 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
377 )
378 then :
379 else
380
381 # The umask is ridiculous, or mkdir does not conform to POSIX,
382 # or it failed possibly due to a race condition. Create the
383 # directory the slow way, step by step, checking for races as we go.
384
385 case $dstdir in
386 /*) prefix='/';;
387 -*) prefix='./';;
388 *) prefix='';;
389 esac
390
391 eval "$initialize_posix_glob"
392
393 oIFS=$IFS
394 IFS=/
395 $posix_glob set -f
396 set fnord $dstdir
397 shift
398 $posix_glob set +f
399 IFS=$oIFS
400
401 prefixes=
402
403 for d
404 do
405 test -z "$d" && continue
406
407 prefix=$prefix$d
408 if test -d "$prefix"; then
409 prefixes=
410 else
411 if $posix_mkdir; then
412 (umask=$mkdir_umask &&
413 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
414 # Don't fail if two instances are running concurrently.
415 test -d "$prefix" || exit 1
416 else
417 case $prefix in
418 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
419 *) qprefix=$prefix;;
420 esac
421 prefixes="$prefixes '$qprefix'"
422 fi
423 fi
424 prefix=$prefix/
425 done
426
427 if test -n "$prefixes"; then
428 # Don't fail if two instances are running concurrently.
429 (umask $mkdir_umask &&
430 eval "\$doit_exec \$mkdirprog $prefixes") ||
431 test -d "$dstdir" || exit 1
432 obsolete_mkdir_used=true
433 fi
434 fi
435 fi
436
437 if test -n "$dir_arg"; then
438 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
439 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
440 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
441 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
442 else
443
444 # Make a couple of temp file names in the proper directory.
445 dsttmp=$dstdir/_inst.$$_
446 rmtmp=$dstdir/_rm.$$_
447
448 # Trap to clean up those temp files at exit.
449 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
450
451 # Copy the file name to the temp name.
452 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453
454 # and set any options; do chmod last to preserve setuid bits.
455 #
456 # If any of these fail, we abort the whole thing. If we want to
457 # ignore errors from any of these, just make sure not to ignore
458 # errors from the above "$doit $cpprog $src $dsttmp" command.
459 #
460 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
461 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
462 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
463 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
464
465 # If -C, don't bother to copy if it wouldn't change the file.
466 if $copy_on_change &&
467 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
468 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
469
470 eval "$initialize_posix_glob" &&
471 $posix_glob set -f &&
472 set X $old && old=:$2:$4:$5:$6 &&
473 set X $new && new=:$2:$4:$5:$6 &&
474 $posix_glob set +f &&
475
476 test "$old" = "$new" &&
477 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
478 then
479 rm -f "$dsttmp"
480 else
481 # Rename the file to the real destination.
482 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
483
484 # The rename failed, perhaps because mv can't rename something else
485 # to itself, or perhaps because mv is so ancient that it does not
486 # support -f.
487 {
488 # Now remove or move aside any old file at destination location.
489 # We try this two ways since rm can't unlink itself on some
490 # systems and the destination file might be busy for other
491 # reasons. In this case, the final cleanup might fail but the new
492 # file should still install successfully.
493 {
494 test ! -f "$dst" ||
495 $doit $rmcmd -f "$dst" 2>/dev/null ||
496 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
497 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
498 } ||
499 { echo "$0: cannot unlink or rename $dst" >&2
500 (exit 1); exit 1
501 }
502 } &&
503
504 # Now rename the file to the real destination.
505 $doit $mvcmd "$dsttmp" "$dst"
506 }
507 fi || exit 1
508
509 trap '' 0
510 fi
511 done
512
513 # Local variables:
514 # eval: (add-hook 'write-file-hooks 'time-stamp)
515 # time-stamp-start: "scriptversion="
516 # time-stamp-format: "%:y-%02m-%02d.%02H"
517 # time-stamp-end: "$"
518 # End:
+0
-6964
config/ltmain.sh less more
0 # ltmain.sh - Provide generalized library-building support services.
1 # NOTE: Changing this file will not affect anything until you rerun configure.
2 #
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
4 # 2007, 2008 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 basename="s,^.*/,,g"
27
28 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
29 # is ksh but when the shell is invoked as "sh" and the current value of
30 # the _XPG environment variable is not equal to 1 (one), the special
31 # positional parameter $0, within a function call, is the name of the
32 # function.
33 progpath="$0"
34
35 # The name of this program:
36 progname=`echo "$progpath" | $SED $basename`
37 modename="$progname"
38
39 # Global variables:
40 EXIT_SUCCESS=0
41 EXIT_FAILURE=1
42
43 PROGRAM=ltmain.sh
44 PACKAGE=libtool
45 VERSION="1.5.26 Debian 1.5.26-3"
46 TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
47
48 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
49 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
50 emulate sh
51 NULLCMD=:
52 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
53 # is contrary to our usage. Disable this feature.
54 alias -g '${1+"$@"}'='"$@"'
55 setopt NO_GLOB_SUBST
56 else
57 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
58 fi
59 BIN_SH=xpg4; export BIN_SH # for Tru64
60 DUALCASE=1; export DUALCASE # for MKS sh
61
62 # Check that we have a working $echo.
63 if test "X$1" = X--no-reexec; then
64 # Discard the --no-reexec flag, and continue.
65 shift
66 elif test "X$1" = X--fallback-echo; then
67 # Avoid inline document here, it may be left over
68 :
69 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
70 # Yippee, $echo works!
71 :
72 else
73 # Restart under the correct shell, and then maybe $echo will work.
74 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
75 fi
76
77 if test "X$1" = X--fallback-echo; then
78 # used as fallback echo
79 shift
80 cat <<EOF
81 $*
82 EOF
83 exit $EXIT_SUCCESS
84 fi
85
86 default_mode=
87 help="Try \`$progname --help' for more information."
88 magic="%%%MAGIC variable%%%"
89 mkdir="mkdir"
90 mv="mv -f"
91 rm="rm -f"
92
93 # Sed substitution that helps us do robust quoting. It backslashifies
94 # metacharacters that are still active within double-quoted strings.
95 Xsed="${SED}"' -e 1s/^X//'
96 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
97 # test EBCDIC or ASCII
98 case `echo X|tr X '\101'` in
99 A) # ASCII based system
100 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
101 SP2NL='tr \040 \012'
102 NL2SP='tr \015\012 \040\040'
103 ;;
104 *) # EBCDIC based system
105 SP2NL='tr \100 \n'
106 NL2SP='tr \r\n \100\100'
107 ;;
108 esac
109
110 # NLS nuisances.
111 # Only set LANG and LC_ALL to C if already set.
112 # These must not be set unconditionally because not all systems understand
113 # e.g. LANG=C (notably SCO).
114 # We save the old values to restore during execute mode.
115 lt_env=
116 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
117 do
118 eval "if test \"\${$lt_var+set}\" = set; then
119 save_$lt_var=\$$lt_var
120 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
121 $lt_var=C
122 export $lt_var
123 fi"
124 done
125
126 if test -n "$lt_env"; then
127 lt_env="env $lt_env"
128 fi
129
130 # Make sure IFS has a sensible default
131 lt_nl='
132 '
133 IFS=" $lt_nl"
134
135 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
136 $echo "$modename: not configured to build any kind of library" 1>&2
137 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
138 exit $EXIT_FAILURE
139 fi
140
141 # Global variables.
142 mode=$default_mode
143 nonopt=
144 prev=
145 prevopt=
146 run=
147 show="$echo"
148 show_help=
149 execute_dlfiles=
150 duplicate_deps=no
151 preserve_args=
152 lo2o="s/\\.lo\$/.${objext}/"
153 o2lo="s/\\.${objext}\$/.lo/"
154 extracted_archives=
155 extracted_serial=0
156
157 #####################################
158 # Shell function definitions:
159 # This seems to be the best place for them
160
161 # func_mktempdir [string]
162 # Make a temporary directory that won't clash with other running
163 # libtool processes, and avoids race conditions if possible. If
164 # given, STRING is the basename for that directory.
165 func_mktempdir ()
166 {
167 my_template="${TMPDIR-/tmp}/${1-$progname}"
168
169 if test "$run" = ":"; then
170 # Return a directory name, but don't create it in dry-run mode
171 my_tmpdir="${my_template}-$$"
172 else
173
174 # If mktemp works, use that first and foremost
175 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
176
177 if test ! -d "$my_tmpdir"; then
178 # Failing that, at least try and use $RANDOM to avoid a race
179 my_tmpdir="${my_template}-${RANDOM-0}$$"
180
181 save_mktempdir_umask=`umask`
182 umask 0077
183 $mkdir "$my_tmpdir"
184 umask $save_mktempdir_umask
185 fi
186
187 # If we're not in dry-run mode, bomb out on failure
188 test -d "$my_tmpdir" || {
189 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
190 exit $EXIT_FAILURE
191 }
192 fi
193
194 $echo "X$my_tmpdir" | $Xsed
195 }
196
197
198 # func_win32_libid arg
199 # return the library type of file 'arg'
200 #
201 # Need a lot of goo to handle *both* DLLs and import libs
202 # Has to be a shell function in order to 'eat' the argument
203 # that is supplied when $file_magic_command is called.
204 func_win32_libid ()
205 {
206 win32_libid_type="unknown"
207 win32_fileres=`file -L $1 2>/dev/null`
208 case $win32_fileres in
209 *ar\ archive\ import\ library*) # definitely import
210 win32_libid_type="x86 archive import"
211 ;;
212 *ar\ archive*) # could be an import, or static
213 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
214 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
215 win32_nmres=`eval $NM -f posix -A $1 | \
216 $SED -n -e '1,100{
217 / I /{
218 s,.*,import,
219 p
220 q
221 }
222 }'`
223 case $win32_nmres in
224 import*) win32_libid_type="x86 archive import";;
225 *) win32_libid_type="x86 archive static";;
226 esac
227 fi
228 ;;
229 *DLL*)
230 win32_libid_type="x86 DLL"
231 ;;
232 *executable*) # but shell scripts are "executable" too...
233 case $win32_fileres in
234 *MS\ Windows\ PE\ Intel*)
235 win32_libid_type="x86 DLL"
236 ;;
237 esac
238 ;;
239 esac
240 $echo $win32_libid_type
241 }
242
243
244 # func_infer_tag arg
245 # Infer tagged configuration to use if any are available and
246 # if one wasn't chosen via the "--tag" command line option.
247 # Only attempt this if the compiler in the base compile
248 # command doesn't match the default compiler.
249 # arg is usually of the form 'gcc ...'
250 func_infer_tag ()
251 {
252 if test -n "$available_tags" && test -z "$tagname"; then
253 CC_quoted=
254 for arg in $CC; do
255 case $arg in
256 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
257 arg="\"$arg\""
258 ;;
259 esac
260 CC_quoted="$CC_quoted $arg"
261 done
262 case $@ in
263 # Blanks in the command may have been stripped by the calling shell,
264 # but not from the CC environment variable when configure was run.
265 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
266 # Blanks at the start of $base_compile will cause this to fail
267 # if we don't check for them as well.
268 *)
269 for z in $available_tags; do
270 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
271 # Evaluate the configuration.
272 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
273 CC_quoted=
274 for arg in $CC; do
275 # Double-quote args containing other shell metacharacters.
276 case $arg in
277 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
278 arg="\"$arg\""
279 ;;
280 esac
281 CC_quoted="$CC_quoted $arg"
282 done
283 case "$@ " in
284 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
285 # The compiler in the base compile command matches
286 # the one in the tagged configuration.
287 # Assume this is the tagged configuration we want.
288 tagname=$z
289 break
290 ;;
291 esac
292 fi
293 done
294 # If $tagname still isn't set, then no tagged configuration
295 # was found and let the user know that the "--tag" command
296 # line option must be used.
297 if test -z "$tagname"; then
298 $echo "$modename: unable to infer tagged configuration"
299 $echo "$modename: specify a tag with \`--tag'" 1>&2
300 exit $EXIT_FAILURE
301 # else
302 # $echo "$modename: using $tagname tagged configuration"
303 fi
304 ;;
305 esac
306 fi
307 }
308
309
310 # func_extract_an_archive dir oldlib
311 func_extract_an_archive ()
312 {
313 f_ex_an_ar_dir="$1"; shift
314 f_ex_an_ar_oldlib="$1"
315
316 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
317 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
318 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
319 :
320 else
321 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
322 exit $EXIT_FAILURE
323 fi
324 }
325
326 # func_extract_archives gentop oldlib ...
327 func_extract_archives ()
328 {
329 my_gentop="$1"; shift
330 my_oldlibs=${1+"$@"}
331 my_oldobjs=""
332 my_xlib=""
333 my_xabs=""
334 my_xdir=""
335 my_status=""
336
337 $show "${rm}r $my_gentop"
338 $run ${rm}r "$my_gentop"
339 $show "$mkdir $my_gentop"
340 $run $mkdir "$my_gentop"
341 my_status=$?
342 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
343 exit $my_status
344 fi
345
346 for my_xlib in $my_oldlibs; do
347 # Extract the objects.
348 case $my_xlib in
349 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
350 *) my_xabs=`pwd`"/$my_xlib" ;;
351 esac
352 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
353 my_xlib_u=$my_xlib
354 while :; do
355 case " $extracted_archives " in
356 *" $my_xlib_u "*)
357 extracted_serial=`expr $extracted_serial + 1`
358 my_xlib_u=lt$extracted_serial-$my_xlib ;;
359 *) break ;;
360 esac
361 done
362 extracted_archives="$extracted_archives $my_xlib_u"
363 my_xdir="$my_gentop/$my_xlib_u"
364
365 $show "${rm}r $my_xdir"
366 $run ${rm}r "$my_xdir"
367 $show "$mkdir $my_xdir"
368 $run $mkdir "$my_xdir"
369 exit_status=$?
370 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
371 exit $exit_status
372 fi
373 case $host in
374 *-darwin*)
375 $show "Extracting $my_xabs"
376 # Do not bother doing anything if just a dry run
377 if test -z "$run"; then
378 darwin_orig_dir=`pwd`
379 cd $my_xdir || exit $?
380 darwin_archive=$my_xabs
381 darwin_curdir=`pwd`
382 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
383 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
384 if test -n "$darwin_arches"; then
385 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
386 darwin_arch=
387 $show "$darwin_base_archive has multiple architectures $darwin_arches"
388 for darwin_arch in $darwin_arches ; do
389 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
390 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
391 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
392 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
393 cd "$darwin_curdir"
394 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
395 done # $darwin_arches
396 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
397 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
398 darwin_file=
399 darwin_files=
400 for darwin_file in $darwin_filelist; do
401 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
402 lipo -create -output "$darwin_file" $darwin_files
403 done # $darwin_filelist
404 ${rm}r unfat-$$
405 cd "$darwin_orig_dir"
406 else
407 cd "$darwin_orig_dir"
408 func_extract_an_archive "$my_xdir" "$my_xabs"
409 fi # $darwin_arches
410 fi # $run
411 ;;
412 *)
413 func_extract_an_archive "$my_xdir" "$my_xabs"
414 ;;
415 esac
416 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
417 done
418 func_extract_archives_result="$my_oldobjs"
419 }
420 # End of Shell function definitions
421 #####################################
422
423 # Darwin sucks
424 eval std_shrext=\"$shrext_cmds\"
425
426 disable_libs=no
427
428 # Parse our command line options once, thoroughly.
429 while test "$#" -gt 0
430 do
431 arg="$1"
432 shift
433
434 case $arg in
435 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
436 *) optarg= ;;
437 esac
438
439 # If the previous option needs an argument, assign it.
440 if test -n "$prev"; then
441 case $prev in
442 execute_dlfiles)
443 execute_dlfiles="$execute_dlfiles $arg"
444 ;;
445 tag)
446 tagname="$arg"
447 preserve_args="${preserve_args}=$arg"
448
449 # Check whether tagname contains only valid characters
450 case $tagname in
451 *[!-_A-Za-z0-9,/]*)
452 $echo "$progname: invalid tag name: $tagname" 1>&2
453 exit $EXIT_FAILURE
454 ;;
455 esac
456
457 case $tagname in
458 CC)
459 # Don't test for the "default" C tag, as we know, it's there, but
460 # not specially marked.
461 ;;
462 *)
463 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
464 taglist="$taglist $tagname"
465 # Evaluate the configuration.
466 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
467 else
468 $echo "$progname: ignoring unknown tag $tagname" 1>&2
469 fi
470 ;;
471 esac
472 ;;
473 *)
474 eval "$prev=\$arg"
475 ;;
476 esac
477
478 prev=
479 prevopt=
480 continue
481 fi
482
483 # Have we seen a non-optional argument yet?
484 case $arg in
485 --help)
486 show_help=yes
487 ;;
488
489 --version)
490 echo "\
491 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
492
493 Copyright (C) 2008 Free Software Foundation, Inc.
494 This is free software; see the source for copying conditions. There is NO
495 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
496 exit $?
497 ;;
498
499 --config)
500 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
501 # Now print the configurations for the tags.
502 for tagname in $taglist; do
503 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
504 done
505 exit $?
506 ;;
507
508 --debug)
509 $echo "$progname: enabling shell trace mode"
510 set -x
511 preserve_args="$preserve_args $arg"
512 ;;
513
514 --dry-run | -n)
515 run=:
516 ;;
517
518 --features)
519 $echo "host: $host"
520 if test "$build_libtool_libs" = yes; then
521 $echo "enable shared libraries"
522 else
523 $echo "disable shared libraries"
524 fi
525 if test "$build_old_libs" = yes; then
526 $echo "enable static libraries"
527 else
528 $echo "disable static libraries"
529 fi
530 exit $?
531 ;;
532
533 --finish) mode="finish" ;;
534
535 --mode) prevopt="--mode" prev=mode ;;
536 --mode=*) mode="$optarg" ;;
537
538 --preserve-dup-deps) duplicate_deps="yes" ;;
539
540 --quiet | --silent)
541 show=:
542 preserve_args="$preserve_args $arg"
543 ;;
544
545 --tag)
546 prevopt="--tag"
547 prev=tag
548 preserve_args="$preserve_args --tag"
549 ;;
550 --tag=*)
551 set tag "$optarg" ${1+"$@"}
552 shift
553 prev=tag
554 preserve_args="$preserve_args --tag"
555 ;;
556
557 -dlopen)
558 prevopt="-dlopen"
559 prev=execute_dlfiles
560 ;;
561
562 -*)
563 $echo "$modename: unrecognized option \`$arg'" 1>&2
564 $echo "$help" 1>&2
565 exit $EXIT_FAILURE
566 ;;
567
568 *)
569 nonopt="$arg"
570 break
571 ;;
572 esac
573 done
574
575 if test -n "$prevopt"; then
576 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
577 $echo "$help" 1>&2
578 exit $EXIT_FAILURE
579 fi
580
581 case $disable_libs in
582 no)
583 ;;
584 shared)
585 build_libtool_libs=no
586 build_old_libs=yes
587 ;;
588 static)
589 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
590 ;;
591 esac
592
593 # If this variable is set in any of the actions, the command in it
594 # will be execed at the end. This prevents here-documents from being
595 # left over by shells.
596 exec_cmd=
597
598 if test -z "$show_help"; then
599
600 # Infer the operation mode.
601 if test -z "$mode"; then
602 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
603 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
604 case $nonopt in
605 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
606 mode=link
607 for arg
608 do
609 case $arg in
610 -c)
611 mode=compile
612 break
613 ;;
614 esac
615 done
616 ;;
617 *db | *dbx | *strace | *truss)
618 mode=execute
619 ;;
620 *install*|cp|mv)
621 mode=install
622 ;;
623 *rm)
624 mode=uninstall
625 ;;
626 *)
627 # If we have no mode, but dlfiles were specified, then do execute mode.
628 test -n "$execute_dlfiles" && mode=execute
629
630 # Just use the default operation mode.
631 if test -z "$mode"; then
632 if test -n "$nonopt"; then
633 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
634 else
635 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
636 fi
637 fi
638 ;;
639 esac
640 fi
641
642 # Only execute mode is allowed to have -dlopen flags.
643 if test -n "$execute_dlfiles" && test "$mode" != execute; then
644 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
645 $echo "$help" 1>&2
646 exit $EXIT_FAILURE
647 fi
648
649 # Change the help message to a mode-specific one.
650 generic_help="$help"
651 help="Try \`$modename --help --mode=$mode' for more information."
652
653 # These modes are in order of execution frequency so that they run quickly.
654 case $mode in
655 # libtool compile mode
656 compile)
657 modename="$modename: compile"
658 # Get the compilation command and the source file.
659 base_compile=
660 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
661 suppress_opt=yes
662 suppress_output=
663 arg_mode=normal
664 libobj=
665 later=
666
667 for arg
668 do
669 case $arg_mode in
670 arg )
671 # do not "continue". Instead, add this to base_compile
672 lastarg="$arg"
673 arg_mode=normal
674 ;;
675
676 target )
677 libobj="$arg"
678 arg_mode=normal
679 continue
680 ;;
681
682 normal )
683 # Accept any command-line options.
684 case $arg in
685 -o)
686 if test -n "$libobj" ; then
687 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
688 exit $EXIT_FAILURE
689 fi
690 arg_mode=target
691 continue
692 ;;
693
694 -static | -prefer-pic | -prefer-non-pic)
695 later="$later $arg"
696 continue
697 ;;
698
699 -no-suppress)
700 suppress_opt=no
701 continue
702 ;;
703
704 -Xcompiler)
705 arg_mode=arg # the next one goes into the "base_compile" arg list
706 continue # The current "srcfile" will either be retained or
707 ;; # replaced later. I would guess that would be a bug.
708
709 -Wc,*)
710 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
711 lastarg=
712 save_ifs="$IFS"; IFS=','
713 for arg in $args; do
714 IFS="$save_ifs"
715
716 # Double-quote args containing other shell metacharacters.
717 # Many Bourne shells cannot handle close brackets correctly
718 # in scan sets, so we specify it separately.
719 case $arg in
720 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
721 arg="\"$arg\""
722 ;;
723 esac
724 lastarg="$lastarg $arg"
725 done
726 IFS="$save_ifs"
727 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
728
729 # Add the arguments to base_compile.
730 base_compile="$base_compile $lastarg"
731 continue
732 ;;
733
734 * )
735 # Accept the current argument as the source file.
736 # The previous "srcfile" becomes the current argument.
737 #
738 lastarg="$srcfile"
739 srcfile="$arg"
740 ;;
741 esac # case $arg
742 ;;
743 esac # case $arg_mode
744
745 # Aesthetically quote the previous argument.
746 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
747
748 case $lastarg in
749 # Double-quote args containing other shell metacharacters.
750 # Many Bourne shells cannot handle close brackets correctly
751 # in scan sets, and some SunOS ksh mistreat backslash-escaping
752 # in scan sets (worked around with variable expansion),
753 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
754 # at all, so we specify them separately.
755 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
756 lastarg="\"$lastarg\""
757 ;;
758 esac
759
760 base_compile="$base_compile $lastarg"
761 done # for arg
762
763 case $arg_mode in
764 arg)
765 $echo "$modename: you must specify an argument for -Xcompile"
766 exit $EXIT_FAILURE
767 ;;
768 target)
769 $echo "$modename: you must specify a target with \`-o'" 1>&2
770 exit $EXIT_FAILURE
771 ;;
772 *)
773 # Get the name of the library object.
774 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
775 ;;
776 esac
777
778 # Recognize several different file suffixes.
779 # If the user specifies -o file.o, it is replaced with file.lo
780 xform='[cCFSifmso]'
781 case $libobj in
782 *.ada) xform=ada ;;
783 *.adb) xform=adb ;;
784 *.ads) xform=ads ;;
785 *.asm) xform=asm ;;
786 *.c++) xform=c++ ;;
787 *.cc) xform=cc ;;
788 *.ii) xform=ii ;;
789 *.class) xform=class ;;
790 *.cpp) xform=cpp ;;
791 *.cxx) xform=cxx ;;
792 *.[fF][09]?) xform=[fF][09]. ;;
793 *.for) xform=for ;;
794 *.java) xform=java ;;
795 *.obj) xform=obj ;;
796 *.sx) xform=sx ;;
797 esac
798
799 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
800
801 case $libobj in
802 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
803 *)
804 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
805 exit $EXIT_FAILURE
806 ;;
807 esac
808
809 func_infer_tag $base_compile
810
811 for arg in $later; do
812 case $arg in
813 -static)
814 build_old_libs=yes
815 continue
816 ;;
817
818 -prefer-pic)
819 pic_mode=yes
820 continue
821 ;;
822
823 -prefer-non-pic)
824 pic_mode=no
825 continue
826 ;;
827 esac
828 done
829
830 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
831 case $qlibobj in
832 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
833 qlibobj="\"$qlibobj\"" ;;
834 esac
835 test "X$libobj" != "X$qlibobj" \
836 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
837 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
838 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
839 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
840 if test "X$xdir" = "X$obj"; then
841 xdir=
842 else
843 xdir=$xdir/
844 fi
845 lobj=${xdir}$objdir/$objname
846
847 if test -z "$base_compile"; then
848 $echo "$modename: you must specify a compilation command" 1>&2
849 $echo "$help" 1>&2
850 exit $EXIT_FAILURE
851 fi
852
853 # Delete any leftover library objects.
854 if test "$build_old_libs" = yes; then
855 removelist="$obj $lobj $libobj ${libobj}T"
856 else
857 removelist="$lobj $libobj ${libobj}T"
858 fi
859
860 $run $rm $removelist
861 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
862
863 # On Cygwin there's no "real" PIC flag so we must build both object types
864 case $host_os in
865 cygwin* | mingw* | pw32* | os2*)
866 pic_mode=default
867 ;;
868 esac
869 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
870 # non-PIC code in shared libraries is not supported
871 pic_mode=default
872 fi
873
874 # Calculate the filename of the output object if compiler does
875 # not support -o with -c
876 if test "$compiler_c_o" = no; then
877 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
878 lockfile="$output_obj.lock"
879 removelist="$removelist $output_obj $lockfile"
880 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
881 else
882 output_obj=
883 need_locks=no
884 lockfile=
885 fi
886
887 # Lock this critical section if it is needed
888 # We use this script file to make the link, it avoids creating a new file
889 if test "$need_locks" = yes; then
890 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
891 $show "Waiting for $lockfile to be removed"
892 sleep 2
893 done
894 elif test "$need_locks" = warn; then
895 if test -f "$lockfile"; then
896 $echo "\
897 *** ERROR, $lockfile exists and contains:
898 `cat $lockfile 2>/dev/null`
899
900 This indicates that another process is trying to use the same
901 temporary object file, and libtool could not work around it because
902 your compiler does not support \`-c' and \`-o' together. If you
903 repeat this compilation, it may succeed, by chance, but you had better
904 avoid parallel builds (make -j) in this platform, or get a better
905 compiler."
906
907 $run $rm $removelist
908 exit $EXIT_FAILURE
909 fi
910 $echo "$srcfile" > "$lockfile"
911 fi
912
913 if test -n "$fix_srcfile_path"; then
914 eval srcfile=\"$fix_srcfile_path\"
915 fi
916 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
917 case $qsrcfile in
918 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
919 qsrcfile="\"$qsrcfile\"" ;;
920 esac
921
922 $run $rm "$libobj" "${libobj}T"
923
924 # Create a libtool object file (analogous to a ".la" file),
925 # but don't create it if we're doing a dry run.
926 test -z "$run" && cat > ${libobj}T <<EOF
927 # $libobj - a libtool object file
928 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
929 #
930 # Please DO NOT delete this file!
931 # It is necessary for linking the library.
932
933 # Name of the PIC object.
934 EOF
935
936 # Only build a PIC object if we are building libtool libraries.
937 if test "$build_libtool_libs" = yes; then
938 # Without this assignment, base_compile gets emptied.
939 fbsd_hideous_sh_bug=$base_compile
940
941 if test "$pic_mode" != no; then
942 command="$base_compile $qsrcfile $pic_flag"
943 else
944 # Don't build PIC code
945 command="$base_compile $qsrcfile"
946 fi
947
948 if test ! -d "${xdir}$objdir"; then
949 $show "$mkdir ${xdir}$objdir"
950 $run $mkdir ${xdir}$objdir
951 exit_status=$?
952 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
953 exit $exit_status
954 fi
955 fi
956
957 if test -z "$output_obj"; then
958 # Place PIC objects in $objdir
959 command="$command -o $lobj"
960 fi
961
962 $run $rm "$lobj" "$output_obj"
963
964 $show "$command"
965 if $run eval $lt_env "$command"; then :
966 else
967 test -n "$output_obj" && $run $rm $removelist
968 exit $EXIT_FAILURE
969 fi
970
971 if test "$need_locks" = warn &&
972 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
973 $echo "\
974 *** ERROR, $lockfile contains:
975 `cat $lockfile 2>/dev/null`
976
977 but it should contain:
978 $srcfile
979
980 This indicates that another process is trying to use the same
981 temporary object file, and libtool could not work around it because
982 your compiler does not support \`-c' and \`-o' together. If you
983 repeat this compilation, it may succeed, by chance, but you had better
984 avoid parallel builds (make -j) in this platform, or get a better
985 compiler."
986
987 $run $rm $removelist
988 exit $EXIT_FAILURE
989 fi
990
991 # Just move the object if needed, then go on to compile the next one
992 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
993 $show "$mv $output_obj $lobj"
994 if $run $mv $output_obj $lobj; then :
995 else
996 error=$?
997 $run $rm $removelist
998 exit $error
999 fi
1000 fi
1001
1002 # Append the name of the PIC object to the libtool object file.
1003 test -z "$run" && cat >> ${libobj}T <<EOF
1004 pic_object='$objdir/$objname'
1005
1006 EOF
1007
1008 # Allow error messages only from the first compilation.
1009 if test "$suppress_opt" = yes; then
1010 suppress_output=' >/dev/null 2>&1'
1011 fi
1012 else
1013 # No PIC object so indicate it doesn't exist in the libtool
1014 # object file.
1015 test -z "$run" && cat >> ${libobj}T <<EOF
1016 pic_object=none
1017
1018 EOF
1019 fi
1020
1021 # Only build a position-dependent object if we build old libraries.
1022 if test "$build_old_libs" = yes; then
1023 if test "$pic_mode" != yes; then
1024 # Don't build PIC code
1025 command="$base_compile $qsrcfile"
1026 else
1027 command="$base_compile $qsrcfile $pic_flag"
1028 fi
1029 if test "$compiler_c_o" = yes; then
1030 command="$command -o $obj"
1031 fi
1032
1033 # Suppress compiler output if we already did a PIC compilation.
1034 command="$command$suppress_output"
1035 $run $rm "$obj" "$output_obj"
1036 $show "$command"
1037 if $run eval $lt_env "$command"; then :
1038 else
1039 $run $rm $removelist
1040 exit $EXIT_FAILURE
1041 fi
1042
1043 if test "$need_locks" = warn &&
1044 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1045 $echo "\
1046 *** ERROR, $lockfile contains:
1047 `cat $lockfile 2>/dev/null`
1048
1049 but it should contain:
1050 $srcfile
1051
1052 This indicates that another process is trying to use the same
1053 temporary object file, and libtool could not work around it because
1054 your compiler does not support \`-c' and \`-o' together. If you
1055 repeat this compilation, it may succeed, by chance, but you had better
1056 avoid parallel builds (make -j) in this platform, or get a better
1057 compiler."
1058
1059 $run $rm $removelist
1060 exit $EXIT_FAILURE
1061 fi
1062
1063 # Just move the object if needed
1064 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1065 $show "$mv $output_obj $obj"
1066 if $run $mv $output_obj $obj; then :
1067 else
1068 error=$?
1069 $run $rm $removelist
1070 exit $error
1071 fi
1072 fi
1073
1074 # Append the name of the non-PIC object the libtool object file.
1075 # Only append if the libtool object file exists.
1076 test -z "$run" && cat >> ${libobj}T <<EOF
1077 # Name of the non-PIC object.
1078 non_pic_object='$objname'
1079
1080 EOF
1081 else
1082 # Append the name of the non-PIC object the libtool object file.
1083 # Only append if the libtool object file exists.
1084 test -z "$run" && cat >> ${libobj}T <<EOF
1085 # Name of the non-PIC object.
1086 non_pic_object=none
1087
1088 EOF
1089 fi
1090
1091 $run $mv "${libobj}T" "${libobj}"
1092
1093 # Unlock the critical section if it was locked
1094 if test "$need_locks" != no; then
1095 $run $rm "$lockfile"
1096 fi
1097
1098 exit $EXIT_SUCCESS
1099 ;;
1100
1101 # libtool link mode
1102 link | relink)
1103 modename="$modename: link"
1104 case $host in
1105 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1106 # It is impossible to link a dll without this setting, and
1107 # we shouldn't force the makefile maintainer to figure out
1108 # which system we are compiling for in order to pass an extra
1109 # flag for every libtool invocation.
1110 # allow_undefined=no
1111
1112 # FIXME: Unfortunately, there are problems with the above when trying
1113 # to make a dll which has undefined symbols, in which case not
1114 # even a static library is built. For now, we need to specify
1115 # -no-undefined on the libtool link line when we can be certain
1116 # that all symbols are satisfied, otherwise we get a static library.
1117 allow_undefined=yes
1118 ;;
1119 *)
1120 allow_undefined=yes
1121 ;;
1122 esac
1123 libtool_args="$nonopt"
1124 base_compile="$nonopt $@"
1125 compile_command="$nonopt"
1126 finalize_command="$nonopt"
1127
1128 compile_rpath=
1129 finalize_rpath=
1130 compile_shlibpath=
1131 finalize_shlibpath=
1132 convenience=
1133 old_convenience=
1134 deplibs=
1135 old_deplibs=
1136 compiler_flags=
1137 linker_flags=
1138 dllsearchpath=
1139 lib_search_path=`pwd`
1140 inst_prefix_dir=
1141
1142 avoid_version=no
1143 dlfiles=
1144 dlprefiles=
1145 dlself=no
1146 export_dynamic=no
1147 export_symbols=
1148 export_symbols_regex=
1149 generated=
1150 libobjs=
1151 ltlibs=
1152 module=no
1153 no_install=no
1154 objs=
1155 non_pic_objects=
1156 notinst_path= # paths that contain not-installed libtool libraries
1157 precious_files_regex=
1158 prefer_static_libs=no
1159 preload=no
1160 prev=
1161 prevarg=
1162 release=
1163 rpath=
1164 xrpath=
1165 perm_rpath=
1166 temp_rpath=
1167 thread_safe=no
1168 vinfo=
1169 vinfo_number=no
1170 single_module="${wl}-single_module"
1171
1172 func_infer_tag $base_compile
1173
1174 # We need to know -static, to get the right output filenames.
1175 for arg
1176 do
1177 case $arg in
1178 -all-static | -static | -static-libtool-libs)
1179 case $arg in
1180 -all-static)
1181 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1182 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1183 fi
1184 if test -n "$link_static_flag"; then
1185 dlopen_self=$dlopen_self_static
1186 fi
1187 prefer_static_libs=yes
1188 ;;
1189 -static)
1190 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1191 dlopen_self=$dlopen_self_static
1192 fi
1193 prefer_static_libs=built
1194 ;;
1195 -static-libtool-libs)
1196 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1197 dlopen_self=$dlopen_self_static
1198 fi
1199 prefer_static_libs=yes
1200 ;;
1201 esac
1202 build_libtool_libs=no
1203 build_old_libs=yes
1204 break
1205 ;;
1206 esac
1207 done
1208
1209 # See if our shared archives depend on static archives.
1210 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1211
1212 # Go through the arguments, transforming them on the way.
1213 while test "$#" -gt 0; do
1214 arg="$1"
1215 shift
1216 case $arg in
1217 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1218 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1219 ;;
1220 *) qarg=$arg ;;
1221 esac
1222 libtool_args="$libtool_args $qarg"
1223
1224 # If the previous option needs an argument, assign it.
1225 if test -n "$prev"; then
1226 case $prev in
1227 output)
1228 compile_command="$compile_command @OUTPUT@"
1229 finalize_command="$finalize_command @OUTPUT@"
1230 ;;
1231 esac
1232
1233 case $prev in
1234 dlfiles|dlprefiles)
1235 if test "$preload" = no; then
1236 # Add the symbol object into the linking commands.
1237 compile_command="$compile_command @SYMFILE@"
1238 finalize_command="$finalize_command @SYMFILE@"
1239 preload=yes
1240 fi
1241 case $arg in
1242 *.la | *.lo) ;; # We handle these cases below.
1243 force)
1244 if test "$dlself" = no; then
1245 dlself=needless
1246 export_dynamic=yes
1247 fi
1248 prev=
1249 continue
1250 ;;
1251 self)
1252 if test "$prev" = dlprefiles; then
1253 dlself=yes
1254 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1255 dlself=yes
1256 else
1257 dlself=needless
1258 export_dynamic=yes
1259 fi
1260 prev=
1261 continue
1262 ;;
1263 *)
1264 if test "$prev" = dlfiles; then
1265 dlfiles="$dlfiles $arg"
1266 else
1267 dlprefiles="$dlprefiles $arg"
1268 fi
1269 prev=
1270 continue
1271 ;;
1272 esac
1273 ;;
1274 expsyms)
1275 export_symbols="$arg"
1276 if test ! -f "$arg"; then
1277 $echo "$modename: symbol file \`$arg' does not exist"
1278 exit $EXIT_FAILURE
1279 fi
1280 prev=
1281 continue
1282 ;;
1283 expsyms_regex)
1284 export_symbols_regex="$arg"
1285 prev=
1286 continue
1287 ;;
1288 inst_prefix)
1289 inst_prefix_dir="$arg"
1290 prev=
1291 continue
1292 ;;
1293 precious_regex)
1294 precious_files_regex="$arg"
1295 prev=
1296 continue
1297 ;;
1298 release)
1299 release="-$arg"
1300 prev=
1301 continue
1302 ;;
1303 objectlist)
1304 if test -f "$arg"; then
1305 save_arg=$arg
1306 moreargs=
1307 for fil in `cat $save_arg`
1308 do
1309 # moreargs="$moreargs $fil"
1310 arg=$fil
1311 # A libtool-controlled object.
1312
1313 # Check to see that this really is a libtool object.
1314 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1315 pic_object=
1316 non_pic_object=
1317
1318 # Read the .lo file
1319 # If there is no directory component, then add one.
1320 case $arg in
1321 */* | *\\*) . $arg ;;
1322 *) . ./$arg ;;
1323 esac
1324
1325 if test -z "$pic_object" || \
1326 test -z "$non_pic_object" ||
1327 test "$pic_object" = none && \
1328 test "$non_pic_object" = none; then
1329 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1330 exit $EXIT_FAILURE
1331 fi
1332
1333 # Extract subdirectory from the argument.
1334 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1335 if test "X$xdir" = "X$arg"; then
1336 xdir=
1337 else
1338 xdir="$xdir/"
1339 fi
1340
1341 if test "$pic_object" != none; then
1342 # Prepend the subdirectory the object is found in.
1343 pic_object="$xdir$pic_object"
1344
1345 if test "$prev" = dlfiles; then
1346 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1347 dlfiles="$dlfiles $pic_object"
1348 prev=
1349 continue
1350 else
1351 # If libtool objects are unsupported, then we need to preload.
1352 prev=dlprefiles
1353 fi
1354 fi
1355
1356 # CHECK ME: I think I busted this. -Ossama
1357 if test "$prev" = dlprefiles; then
1358 # Preload the old-style object.
1359 dlprefiles="$dlprefiles $pic_object"
1360 prev=
1361 fi
1362
1363 # A PIC object.
1364 libobjs="$libobjs $pic_object"
1365 arg="$pic_object"
1366 fi
1367
1368 # Non-PIC object.
1369 if test "$non_pic_object" != none; then
1370 # Prepend the subdirectory the object is found in.
1371 non_pic_object="$xdir$non_pic_object"
1372
1373 # A standard non-PIC object
1374 non_pic_objects="$non_pic_objects $non_pic_object"
1375 if test -z "$pic_object" || test "$pic_object" = none ; then
1376 arg="$non_pic_object"
1377 fi
1378 else
1379 # If the PIC object exists, use it instead.
1380 # $xdir was prepended to $pic_object above.
1381 non_pic_object="$pic_object"
1382 non_pic_objects="$non_pic_objects $non_pic_object"
1383 fi
1384 else
1385 # Only an error if not doing a dry-run.
1386 if test -z "$run"; then
1387 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1388 exit $EXIT_FAILURE
1389 else
1390 # Dry-run case.
1391
1392 # Extract subdirectory from the argument.
1393 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1394 if test "X$xdir" = "X$arg"; then
1395 xdir=
1396 else
1397 xdir="$xdir/"
1398 fi
1399
1400 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1401 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1402 libobjs="$libobjs $pic_object"
1403 non_pic_objects="$non_pic_objects $non_pic_object"
1404 fi
1405 fi
1406 done
1407 else
1408 $echo "$modename: link input file \`$save_arg' does not exist"
1409 exit $EXIT_FAILURE
1410 fi
1411 arg=$save_arg
1412 prev=
1413 continue
1414 ;;
1415 rpath | xrpath)
1416 # We need an absolute path.
1417 case $arg in
1418 [\\/]* | [A-Za-z]:[\\/]*) ;;
1419 *)
1420 $echo "$modename: only absolute run-paths are allowed" 1>&2
1421 exit $EXIT_FAILURE
1422 ;;
1423 esac
1424 if test "$prev" = rpath; then
1425 case "$rpath " in
1426 *" $arg "*) ;;
1427 *) rpath="$rpath $arg" ;;
1428 esac
1429 else
1430 case "$xrpath " in
1431 *" $arg "*) ;;
1432 *) xrpath="$xrpath $arg" ;;
1433 esac
1434 fi
1435 prev=
1436 continue
1437 ;;
1438 xcompiler)
1439 compiler_flags="$compiler_flags $qarg"
1440 prev=
1441 compile_command="$compile_command $qarg"
1442 finalize_command="$finalize_command $qarg"
1443 continue
1444 ;;
1445 xlinker)
1446 linker_flags="$linker_flags $qarg"
1447 compiler_flags="$compiler_flags $wl$qarg"
1448 prev=
1449 compile_command="$compile_command $wl$qarg"
1450 finalize_command="$finalize_command $wl$qarg"
1451 continue
1452 ;;
1453 xcclinker)
1454 linker_flags="$linker_flags $qarg"
1455 compiler_flags="$compiler_flags $qarg"
1456 prev=
1457 compile_command="$compile_command $qarg"
1458 finalize_command="$finalize_command $qarg"
1459 continue
1460 ;;
1461 shrext)
1462 shrext_cmds="$arg"
1463 prev=
1464 continue
1465 ;;
1466 darwin_framework|darwin_framework_skip)
1467 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1468 compile_command="$compile_command $arg"
1469 finalize_command="$finalize_command $arg"
1470 prev=
1471 continue
1472 ;;
1473 *)
1474 eval "$prev=\"\$arg\""
1475 prev=
1476 continue
1477 ;;
1478 esac
1479 fi # test -n "$prev"
1480
1481 prevarg="$arg"
1482
1483 case $arg in
1484 -all-static)
1485 if test -n "$link_static_flag"; then
1486 compile_command="$compile_command $link_static_flag"
1487 finalize_command="$finalize_command $link_static_flag"
1488 fi
1489 continue
1490 ;;
1491
1492 -allow-undefined)
1493 # FIXME: remove this flag sometime in the future.
1494 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1495 continue
1496 ;;
1497
1498 -avoid-version)
1499 avoid_version=yes
1500 continue
1501 ;;
1502
1503 -dlopen)
1504 prev=dlfiles
1505 continue
1506 ;;
1507
1508 -dlpreopen)
1509 prev=dlprefiles
1510 continue
1511 ;;
1512
1513 -export-dynamic)
1514 export_dynamic=yes
1515 continue
1516 ;;
1517
1518 -export-symbols | -export-symbols-regex)
1519 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1520 $echo "$modename: more than one -exported-symbols argument is not allowed"
1521 exit $EXIT_FAILURE
1522 fi
1523 if test "X$arg" = "X-export-symbols"; then
1524 prev=expsyms
1525 else
1526 prev=expsyms_regex
1527 fi
1528 continue
1529 ;;
1530
1531 -framework|-arch|-isysroot)
1532 case " $CC " in
1533 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1534 prev=darwin_framework_skip ;;
1535 *) compiler_flags="$compiler_flags $arg"
1536 prev=darwin_framework ;;
1537 esac
1538 compile_command="$compile_command $arg"
1539 finalize_command="$finalize_command $arg"
1540 continue
1541 ;;
1542
1543 -inst-prefix-dir)
1544 prev=inst_prefix
1545 continue
1546 ;;
1547
1548 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1549 # so, if we see these flags be careful not to treat them like -L
1550 -L[A-Z][A-Z]*:*)
1551 case $with_gcc/$host in
1552 no/*-*-irix* | /*-*-irix*)
1553 compile_command="$compile_command $arg"
1554 finalize_command="$finalize_command $arg"
1555 ;;
1556 esac
1557 continue
1558 ;;
1559
1560 -L*)
1561 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1562 # We need an absolute path.
1563 case $dir in
1564 [\\/]* | [A-Za-z]:[\\/]*) ;;
1565 *)
1566 absdir=`cd "$dir" && pwd`
1567 if test -z "$absdir"; then
1568 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1569 absdir="$dir"
1570 notinst_path="$notinst_path $dir"
1571 fi
1572 dir="$absdir"
1573 ;;
1574 esac
1575 case "$deplibs " in
1576 *" -L$dir "*) ;;
1577 *)
1578 deplibs="$deplibs -L$dir"
1579 lib_search_path="$lib_search_path $dir"
1580 ;;
1581 esac
1582 case $host in
1583 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1584 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1585 case :$dllsearchpath: in
1586 *":$dir:"*) ;;
1587 *) dllsearchpath="$dllsearchpath:$dir";;
1588 esac
1589 case :$dllsearchpath: in
1590 *":$testbindir:"*) ;;
1591 *) dllsearchpath="$dllsearchpath:$testbindir";;
1592 esac
1593 ;;
1594 esac
1595 continue
1596 ;;
1597
1598 -l*)
1599 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1600 case $host in
1601 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1602 # These systems don't actually have a C or math library (as such)
1603 continue
1604 ;;
1605 *-*-os2*)
1606 # These systems don't actually have a C library (as such)
1607 test "X$arg" = "X-lc" && continue
1608 ;;
1609 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1610 # Do not include libc due to us having libc/libc_r.
1611 test "X$arg" = "X-lc" && continue
1612 ;;
1613 *-*-rhapsody* | *-*-darwin1.[012])
1614 # Rhapsody C and math libraries are in the System framework
1615 deplibs="$deplibs -framework System"
1616 continue
1617 ;;
1618 *-*-sco3.2v5* | *-*-sco5v6*)
1619 # Causes problems with __ctype
1620 test "X$arg" = "X-lc" && continue
1621 ;;
1622 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1623 # Compiler inserts libc in the correct place for threads to work
1624 test "X$arg" = "X-lc" && continue
1625 ;;
1626 esac
1627 elif test "X$arg" = "X-lc_r"; then
1628 case $host in
1629 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1630 # Do not include libc_r directly, use -pthread flag.
1631 continue
1632 ;;
1633 esac
1634 fi
1635 deplibs="$deplibs $arg"
1636 continue
1637 ;;
1638
1639 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1640 # classes, name mangling, and exception handling.
1641 -model)
1642 compile_command="$compile_command $arg"
1643 compiler_flags="$compiler_flags $arg"
1644 finalize_command="$finalize_command $arg"
1645 prev=xcompiler
1646 continue
1647 ;;
1648
1649 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1650 compiler_flags="$compiler_flags $arg"
1651 compile_command="$compile_command $arg"
1652 finalize_command="$finalize_command $arg"
1653 continue
1654 ;;
1655
1656 -multi_module)
1657 single_module="${wl}-multi_module"
1658 continue
1659 ;;
1660
1661 -module)
1662 module=yes
1663 continue
1664 ;;
1665
1666 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1667 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1668 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1669 # +DA*, +DD* enable 64-bit mode on the HP compiler
1670 # -q* pass through compiler args for the IBM compiler
1671 # -m* pass through architecture-specific compiler args for GCC
1672 # -m*, -t[45]*, -txscale* pass through architecture-specific
1673 # compiler args for GCC
1674 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1675 # -F/path gives path to uninstalled frameworks, gcc on darwin
1676 # @file GCC response files
1677 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1678 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1679
1680 # Unknown arguments in both finalize_command and compile_command need
1681 # to be aesthetically quoted because they are evaled later.
1682 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1683 case $arg in
1684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1685 arg="\"$arg\""
1686 ;;
1687 esac
1688 compile_command="$compile_command $arg"
1689 finalize_command="$finalize_command $arg"
1690 compiler_flags="$compiler_flags $arg"
1691 continue
1692 ;;
1693
1694 -shrext)
1695 prev=shrext
1696 continue
1697 ;;
1698
1699 -no-fast-install)
1700 fast_install=no
1701 continue
1702 ;;
1703
1704 -no-install)
1705 case $host in
1706 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1707 # The PATH hackery in wrapper scripts is required on Windows
1708 # and Darwin in order for the loader to find any dlls it needs.
1709 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1710 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1711 fast_install=no
1712 ;;
1713 *) no_install=yes ;;
1714 esac
1715 continue
1716 ;;
1717
1718 -no-undefined)
1719 allow_undefined=no
1720 continue
1721 ;;
1722
1723 -objectlist)
1724 prev=objectlist
1725 continue
1726 ;;
1727
1728 -o) prev=output ;;
1729
1730 -precious-files-regex)
1731 prev=precious_regex
1732 continue
1733 ;;
1734
1735 -release)
1736 prev=release
1737 continue
1738 ;;
1739
1740 -rpath)
1741 prev=rpath
1742 continue
1743 ;;
1744
1745 -R)
1746 prev=xrpath
1747 continue
1748 ;;
1749
1750 -R*)
1751 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1752 # We need an absolute path.
1753 case $dir in
1754 [\\/]* | [A-Za-z]:[\\/]*) ;;
1755 *)
1756 $echo "$modename: only absolute run-paths are allowed" 1>&2
1757 exit $EXIT_FAILURE
1758 ;;
1759 esac
1760 case "$xrpath " in
1761 *" $dir "*) ;;
1762 *) xrpath="$xrpath $dir" ;;
1763 esac
1764 continue
1765 ;;
1766
1767 -static | -static-libtool-libs)
1768 # The effects of -static are defined in a previous loop.
1769 # We used to do the same as -all-static on platforms that
1770 # didn't have a PIC flag, but the assumption that the effects
1771 # would be equivalent was wrong. It would break on at least
1772 # Digital Unix and AIX.
1773 continue
1774 ;;
1775
1776 -thread-safe)
1777 thread_safe=yes
1778 continue
1779 ;;
1780
1781 -version-info)
1782 prev=vinfo
1783 continue
1784 ;;
1785 -version-number)
1786 prev=vinfo
1787 vinfo_number=yes
1788 continue
1789 ;;
1790
1791 -Wc,*)
1792 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1793 arg=
1794 save_ifs="$IFS"; IFS=','
1795 for flag in $args; do
1796 IFS="$save_ifs"
1797 case $flag in
1798 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1799 flag="\"$flag\""
1800 ;;
1801 esac
1802 arg="$arg $wl$flag"
1803 compiler_flags="$compiler_flags $flag"
1804 done
1805 IFS="$save_ifs"
1806 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1807 ;;
1808
1809 -Wl,*)
1810 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1811 arg=
1812 save_ifs="$IFS"; IFS=','
1813 for flag in $args; do
1814 IFS="$save_ifs"
1815 case $flag in
1816 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1817 flag="\"$flag\""
1818 ;;
1819 esac
1820 arg="$arg $wl$flag"
1821 compiler_flags="$compiler_flags $wl$flag"
1822 linker_flags="$linker_flags $flag"
1823 done
1824 IFS="$save_ifs"
1825 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1826 ;;
1827
1828 -Xcompiler)
1829 prev=xcompiler
1830 continue
1831 ;;
1832
1833 -Xlinker)
1834 prev=xlinker
1835 continue
1836 ;;
1837
1838 -XCClinker)
1839 prev=xcclinker
1840 continue
1841 ;;
1842
1843 # Some other compiler flag.
1844 -* | +*)
1845 # Unknown arguments in both finalize_command and compile_command need
1846 # to be aesthetically quoted because they are evaled later.
1847 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1848 case $arg in
1849 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1850 arg="\"$arg\""
1851 ;;
1852 esac
1853 ;;
1854
1855 *.$objext)
1856 # A standard object.
1857 objs="$objs $arg"
1858 ;;
1859
1860 *.lo)
1861 # A libtool-controlled object.
1862
1863 # Check to see that this really is a libtool object.
1864 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1865 pic_object=
1866 non_pic_object=
1867
1868 # Read the .lo file
1869 # If there is no directory component, then add one.
1870 case $arg in
1871 */* | *\\*) . $arg ;;
1872 *) . ./$arg ;;
1873 esac
1874
1875 if test -z "$pic_object" || \
1876 test -z "$non_pic_object" ||
1877 test "$pic_object" = none && \
1878 test "$non_pic_object" = none; then
1879 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1880 exit $EXIT_FAILURE
1881 fi
1882
1883 # Extract subdirectory from the argument.
1884 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1885 if test "X$xdir" = "X$arg"; then
1886 xdir=
1887 else
1888 xdir="$xdir/"
1889 fi
1890
1891 if test "$pic_object" != none; then
1892 # Prepend the subdirectory the object is found in.
1893 pic_object="$xdir$pic_object"
1894
1895 if test "$prev" = dlfiles; then
1896 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1897 dlfiles="$dlfiles $pic_object"
1898 prev=
1899 continue
1900 else
1901 # If libtool objects are unsupported, then we need to preload.
1902 prev=dlprefiles
1903 fi
1904 fi
1905
1906 # CHECK ME: I think I busted this. -Ossama
1907 if test "$prev" = dlprefiles; then
1908 # Preload the old-style object.
1909 dlprefiles="$dlprefiles $pic_object"
1910 prev=
1911 fi
1912
1913 # A PIC object.
1914 libobjs="$libobjs $pic_object"
1915 arg="$pic_object"
1916 fi
1917
1918 # Non-PIC object.
1919 if test "$non_pic_object" != none; then
1920 # Prepend the subdirectory the object is found in.
1921 non_pic_object="$xdir$non_pic_object"
1922
1923 # A standard non-PIC object
1924 non_pic_objects="$non_pic_objects $non_pic_object"
1925 if test -z "$pic_object" || test "$pic_object" = none ; then
1926 arg="$non_pic_object"
1927 fi
1928 else
1929 # If the PIC object exists, use it instead.
1930 # $xdir was prepended to $pic_object above.
1931 non_pic_object="$pic_object"
1932 non_pic_objects="$non_pic_objects $non_pic_object"
1933 fi
1934 else
1935 # Only an error if not doing a dry-run.
1936 if test -z "$run"; then
1937 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1938 exit $EXIT_FAILURE
1939 else
1940 # Dry-run case.
1941
1942 # Extract subdirectory from the argument.
1943 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1944 if test "X$xdir" = "X$arg"; then
1945 xdir=
1946 else
1947 xdir="$xdir/"
1948 fi
1949
1950 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1951 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1952 libobjs="$libobjs $pic_object"
1953 non_pic_objects="$non_pic_objects $non_pic_object"
1954 fi
1955 fi
1956 ;;
1957
1958 *.$libext)
1959 # An archive.
1960 deplibs="$deplibs $arg"
1961 old_deplibs="$old_deplibs $arg"
1962 continue
1963 ;;
1964
1965 *.la)
1966 # A libtool-controlled library.
1967
1968 if test "$prev" = dlfiles; then
1969 # This library was specified with -dlopen.
1970 dlfiles="$dlfiles $arg"
1971 prev=
1972 elif test "$prev" = dlprefiles; then
1973 # The library was specified with -dlpreopen.
1974 dlprefiles="$dlprefiles $arg"
1975 prev=
1976 else
1977 deplibs="$deplibs $arg"
1978 fi
1979 continue
1980 ;;
1981
1982 # Some other compiler argument.
1983 *)
1984 # Unknown arguments in both finalize_command and compile_command need
1985 # to be aesthetically quoted because they are evaled later.
1986 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1987 case $arg in
1988 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1989 arg="\"$arg\""
1990 ;;
1991 esac
1992 ;;
1993 esac # arg
1994
1995 # Now actually substitute the argument into the commands.
1996 if test -n "$arg"; then
1997 compile_command="$compile_command $arg"
1998 finalize_command="$finalize_command $arg"
1999 fi
2000 done # argument parsing loop
2001
2002 if test -n "$prev"; then
2003 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2004 $echo "$help" 1>&2
2005 exit $EXIT_FAILURE
2006 fi
2007
2008 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2009 eval arg=\"$export_dynamic_flag_spec\"
2010 compile_command="$compile_command $arg"
2011 finalize_command="$finalize_command $arg"
2012 fi
2013
2014 oldlibs=
2015 # calculate the name of the file, without its directory
2016 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2017 libobjs_save="$libobjs"
2018
2019 if test -n "$shlibpath_var"; then
2020 # get the directories listed in $shlibpath_var
2021 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2022 else
2023 shlib_search_path=
2024 fi
2025 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2026 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2027
2028 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2029 if test "X$output_objdir" = "X$output"; then
2030 output_objdir="$objdir"
2031 else
2032 output_objdir="$output_objdir/$objdir"
2033 fi
2034 # Create the object directory.
2035 if test ! -d "$output_objdir"; then
2036 $show "$mkdir $output_objdir"
2037 $run $mkdir $output_objdir
2038 exit_status=$?
2039 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2040 exit $exit_status
2041 fi
2042 fi
2043
2044 # Determine the type of output
2045 case $output in
2046 "")
2047 $echo "$modename: you must specify an output file" 1>&2
2048 $echo "$help" 1>&2
2049 exit $EXIT_FAILURE
2050 ;;
2051 *.$libext) linkmode=oldlib ;;
2052 *.lo | *.$objext) linkmode=obj ;;
2053 *.la) linkmode=lib ;;
2054 *) linkmode=prog ;; # Anything else should be a program.
2055 esac
2056
2057 case $host in
2058 *cygwin* | *mingw* | *pw32*)
2059 # don't eliminate duplications in $postdeps and $predeps
2060 duplicate_compiler_generated_deps=yes
2061 ;;
2062 *)
2063 duplicate_compiler_generated_deps=$duplicate_deps
2064 ;;
2065 esac
2066 specialdeplibs=
2067
2068 libs=
2069 # Find all interdependent deplibs by searching for libraries
2070 # that are linked more than once (e.g. -la -lb -la)
2071 for deplib in $deplibs; do
2072 if test "X$duplicate_deps" = "Xyes" ; then
2073 case "$libs " in
2074 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2075 esac
2076 fi
2077 libs="$libs $deplib"
2078 done
2079
2080 if test "$linkmode" = lib; then
2081 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2082
2083 # Compute libraries that are listed more than once in $predeps
2084 # $postdeps and mark them as special (i.e., whose duplicates are
2085 # not to be eliminated).
2086 pre_post_deps=
2087 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2088 for pre_post_dep in $predeps $postdeps; do
2089 case "$pre_post_deps " in
2090 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2091 esac
2092 pre_post_deps="$pre_post_deps $pre_post_dep"
2093 done
2094 fi
2095 pre_post_deps=
2096 fi
2097
2098 deplibs=
2099 newdependency_libs=
2100 newlib_search_path=
2101 need_relink=no # whether we're linking any uninstalled libtool libraries
2102 notinst_deplibs= # not-installed libtool libraries
2103 case $linkmode in
2104 lib)
2105 passes="conv link"
2106 for file in $dlfiles $dlprefiles; do
2107 case $file in
2108 *.la) ;;
2109 *)
2110 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2111 exit $EXIT_FAILURE
2112 ;;
2113 esac
2114 done
2115 ;;
2116 prog)
2117 compile_deplibs=
2118 finalize_deplibs=
2119 alldeplibs=no
2120 newdlfiles=
2121 newdlprefiles=
2122 passes="conv scan dlopen dlpreopen link"
2123 ;;
2124 *) passes="conv"
2125 ;;
2126 esac
2127 for pass in $passes; do
2128 if test "$linkmode,$pass" = "lib,link" ||
2129 test "$linkmode,$pass" = "prog,scan"; then
2130 libs="$deplibs"
2131 deplibs=
2132 fi
2133 if test "$linkmode" = prog; then
2134 case $pass in
2135 dlopen) libs="$dlfiles" ;;
2136 dlpreopen) libs="$dlprefiles" ;;
2137 link)
2138 libs="$deplibs %DEPLIBS%"
2139 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2140 ;;
2141 esac
2142 fi
2143 if test "$pass" = dlopen; then
2144 # Collect dlpreopened libraries
2145 save_deplibs="$deplibs"
2146 deplibs=
2147 fi
2148 for deplib in $libs; do
2149 lib=
2150 found=no
2151 case $deplib in
2152 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2153 if test "$linkmode,$pass" = "prog,link"; then
2154 compile_deplibs="$deplib $compile_deplibs"
2155 finalize_deplibs="$deplib $finalize_deplibs"
2156 else
2157 compiler_flags="$compiler_flags $deplib"
2158 fi
2159 continue
2160 ;;
2161 -l*)
2162 if test "$linkmode" != lib && test "$linkmode" != prog; then
2163 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2164 continue
2165 fi
2166 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2167 if test "$linkmode" = lib; then
2168 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2169 else
2170 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2171 fi
2172 for searchdir in $searchdirs; do
2173 for search_ext in .la $std_shrext .so .a; do
2174 # Search the libtool library
2175 lib="$searchdir/lib${name}${search_ext}"
2176 if test -f "$lib"; then
2177 if test "$search_ext" = ".la"; then
2178 found=yes
2179 else
2180 found=no
2181 fi
2182 break 2
2183 fi
2184 done
2185 done
2186 if test "$found" != yes; then
2187 # deplib doesn't seem to be a libtool library
2188 if test "$linkmode,$pass" = "prog,link"; then
2189 compile_deplibs="$deplib $compile_deplibs"
2190 finalize_deplibs="$deplib $finalize_deplibs"
2191 else
2192 deplibs="$deplib $deplibs"
2193 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2194 fi
2195 continue
2196 else # deplib is a libtool library
2197 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2198 # We need to do some special things here, and not later.
2199 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2200 case " $predeps $postdeps " in
2201 *" $deplib "*)
2202 if (${SED} -e '2q' $lib |
2203 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2204 library_names=
2205 old_library=
2206 case $lib in
2207 */* | *\\*) . $lib ;;
2208 *) . ./$lib ;;
2209 esac
2210 for l in $old_library $library_names; do
2211 ll="$l"
2212 done
2213 if test "X$ll" = "X$old_library" ; then # only static version available
2214 found=no
2215 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2216 test "X$ladir" = "X$lib" && ladir="."
2217 lib=$ladir/$old_library
2218 if test "$linkmode,$pass" = "prog,link"; then
2219 compile_deplibs="$deplib $compile_deplibs"
2220 finalize_deplibs="$deplib $finalize_deplibs"
2221 else
2222 deplibs="$deplib $deplibs"
2223 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2224 fi
2225 continue
2226 fi
2227 fi
2228 ;;
2229 *) ;;
2230 esac
2231 fi
2232 fi
2233 ;; # -l
2234 -L*)
2235 case $linkmode in
2236 lib)
2237 deplibs="$deplib $deplibs"
2238 test "$pass" = conv && continue
2239 newdependency_libs="$deplib $newdependency_libs"
2240 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2241 ;;
2242 prog)
2243 if test "$pass" = conv; then
2244 deplibs="$deplib $deplibs"
2245 continue
2246 fi
2247 if test "$pass" = scan; then
2248 deplibs="$deplib $deplibs"
2249 else
2250 compile_deplibs="$deplib $compile_deplibs"
2251 finalize_deplibs="$deplib $finalize_deplibs"
2252 fi
2253 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2254 ;;
2255 *)
2256 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2257 ;;
2258 esac # linkmode
2259 continue
2260 ;; # -L
2261 -R*)
2262 if test "$pass" = link; then
2263 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2264 # Make sure the xrpath contains only unique directories.
2265 case "$xrpath " in
2266 *" $dir "*) ;;
2267 *) xrpath="$xrpath $dir" ;;
2268 esac
2269 fi
2270 deplibs="$deplib $deplibs"
2271 continue
2272 ;;
2273 *.la) lib="$deplib" ;;
2274 *.$libext)
2275 if test "$pass" = conv; then
2276 deplibs="$deplib $deplibs"
2277 continue
2278 fi
2279 case $linkmode in
2280 lib)
2281 valid_a_lib=no
2282 case $deplibs_check_method in
2283 match_pattern*)
2284 set dummy $deplibs_check_method
2285 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2286 if eval $echo \"$deplib\" 2>/dev/null \
2287 | $SED 10q \
2288 | $EGREP "$match_pattern_regex" > /dev/null; then
2289 valid_a_lib=yes
2290 fi
2291 ;;
2292 pass_all)
2293 valid_a_lib=yes
2294 ;;
2295 esac
2296 if test "$valid_a_lib" != yes; then
2297 $echo
2298 $echo "*** Warning: Trying to link with static lib archive $deplib."
2299 $echo "*** I have the capability to make that library automatically link in when"
2300 $echo "*** you link to this library. But I can only do this if you have a"
2301 $echo "*** shared version of the library, which you do not appear to have"
2302 $echo "*** because the file extensions .$libext of this argument makes me believe"
2303 $echo "*** that it is just a static archive that I should not used here."
2304 else
2305 $echo
2306 $echo "*** Warning: Linking the shared library $output against the"
2307 $echo "*** static library $deplib is not portable!"
2308 deplibs="$deplib $deplibs"
2309 fi
2310 continue
2311 ;;
2312 prog)
2313 if test "$pass" != link; then
2314 deplibs="$deplib $deplibs"
2315 else
2316 compile_deplibs="$deplib $compile_deplibs"
2317 finalize_deplibs="$deplib $finalize_deplibs"
2318 fi
2319 continue
2320 ;;
2321 esac # linkmode
2322 ;; # *.$libext
2323 *.lo | *.$objext)
2324 if test "$pass" = conv; then
2325 deplibs="$deplib $deplibs"
2326 elif test "$linkmode" = prog; then
2327 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2328 # If there is no dlopen support or we're linking statically,
2329 # we need to preload.
2330 newdlprefiles="$newdlprefiles $deplib"
2331 compile_deplibs="$deplib $compile_deplibs"
2332 finalize_deplibs="$deplib $finalize_deplibs"
2333 else
2334 newdlfiles="$newdlfiles $deplib"
2335 fi
2336 fi
2337 continue
2338 ;;
2339 %DEPLIBS%)
2340 alldeplibs=yes
2341 continue
2342 ;;
2343 esac # case $deplib
2344 if test "$found" = yes || test -f "$lib"; then :
2345 else
2346 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2347 exit $EXIT_FAILURE
2348 fi
2349
2350 # Check to see that this really is a libtool archive.
2351 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2352 else
2353 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2354 exit $EXIT_FAILURE
2355 fi
2356
2357 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2358 test "X$ladir" = "X$lib" && ladir="."
2359
2360 dlname=
2361 dlopen=
2362 dlpreopen=
2363 libdir=
2364 library_names=
2365 old_library=
2366 # If the library was installed with an old release of libtool,
2367 # it will not redefine variables installed, or shouldnotlink
2368 installed=yes
2369 shouldnotlink=no
2370 avoidtemprpath=
2371
2372
2373 # Read the .la file
2374 case $lib in
2375 */* | *\\*) . $lib ;;
2376 *) . ./$lib ;;
2377 esac
2378
2379 if test "$linkmode,$pass" = "lib,link" ||
2380 test "$linkmode,$pass" = "prog,scan" ||
2381 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2382 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2383 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2384 fi
2385
2386 if test "$pass" = conv; then
2387 # Only check for convenience libraries
2388 deplibs="$lib $deplibs"
2389 if test -z "$libdir"; then
2390 if test -z "$old_library"; then
2391 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2392 exit $EXIT_FAILURE
2393 fi
2394 # It is a libtool convenience library, so add in its objects.
2395 convenience="$convenience $ladir/$objdir/$old_library"
2396 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2397 tmp_libs=
2398 for deplib in $dependency_libs; do
2399 deplibs="$deplib $deplibs"
2400 if test "X$duplicate_deps" = "Xyes" ; then
2401 case "$tmp_libs " in
2402 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2403 esac
2404 fi
2405 tmp_libs="$tmp_libs $deplib"
2406 done
2407 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2408 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2409 exit $EXIT_FAILURE
2410 fi
2411 continue
2412 fi # $pass = conv
2413
2414
2415 # Get the name of the library we link against.
2416 linklib=
2417 for l in $old_library $library_names; do
2418 linklib="$l"
2419 done
2420 if test -z "$linklib"; then
2421 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2422 exit $EXIT_FAILURE
2423 fi
2424
2425 # This library was specified with -dlopen.
2426 if test "$pass" = dlopen; then
2427 if test -z "$libdir"; then
2428 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2429 exit $EXIT_FAILURE
2430 fi
2431 if test -z "$dlname" ||
2432 test "$dlopen_support" != yes ||
2433 test "$build_libtool_libs" = no; then
2434 # If there is no dlname, no dlopen support or we're linking
2435 # statically, we need to preload. We also need to preload any
2436 # dependent libraries so libltdl's deplib preloader doesn't
2437 # bomb out in the load deplibs phase.
2438 dlprefiles="$dlprefiles $lib $dependency_libs"
2439 else
2440 newdlfiles="$newdlfiles $lib"
2441 fi
2442 continue
2443 fi # $pass = dlopen
2444
2445 # We need an absolute path.
2446 case $ladir in
2447 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2448 *)
2449 abs_ladir=`cd "$ladir" && pwd`
2450 if test -z "$abs_ladir"; then
2451 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2452 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2453 abs_ladir="$ladir"
2454 fi
2455 ;;
2456 esac
2457 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2458
2459 # Find the relevant object directory and library name.
2460 if test "X$installed" = Xyes; then
2461 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2462 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2463 dir="$ladir"
2464 absdir="$abs_ladir"
2465 libdir="$abs_ladir"
2466 else
2467 dir="$libdir"
2468 absdir="$libdir"
2469 fi
2470 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2471 else
2472 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2473 dir="$ladir"
2474 absdir="$abs_ladir"
2475 # Remove this search path later
2476 notinst_path="$notinst_path $abs_ladir"
2477 else
2478 dir="$ladir/$objdir"
2479 absdir="$abs_ladir/$objdir"
2480 # Remove this search path later
2481 notinst_path="$notinst_path $abs_ladir"
2482 fi
2483 fi # $installed = yes
2484 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2485
2486 # This library was specified with -dlpreopen.
2487 if test "$pass" = dlpreopen; then
2488 if test -z "$libdir"; then
2489 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2490 exit $EXIT_FAILURE
2491 fi
2492 # Prefer using a static library (so that no silly _DYNAMIC symbols
2493 # are required to link).
2494 if test -n "$old_library"; then
2495 newdlprefiles="$newdlprefiles $dir/$old_library"
2496 # Otherwise, use the dlname, so that lt_dlopen finds it.
2497 elif test -n "$dlname"; then
2498 newdlprefiles="$newdlprefiles $dir/$dlname"
2499 else
2500 newdlprefiles="$newdlprefiles $dir/$linklib"
2501 fi
2502 fi # $pass = dlpreopen
2503
2504 if test -z "$libdir"; then
2505 # Link the convenience library
2506 if test "$linkmode" = lib; then
2507 deplibs="$dir/$old_library $deplibs"
2508 elif test "$linkmode,$pass" = "prog,link"; then
2509 compile_deplibs="$dir/$old_library $compile_deplibs"
2510 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2511 else
2512 deplibs="$lib $deplibs" # used for prog,scan pass
2513 fi
2514 continue
2515 fi
2516
2517
2518 if test "$linkmode" = prog && test "$pass" != link; then
2519 newlib_search_path="$newlib_search_path $ladir"
2520 deplibs="$lib $deplibs"
2521
2522 linkalldeplibs=no
2523 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2524 test "$build_libtool_libs" = no; then
2525 linkalldeplibs=yes
2526 fi
2527
2528 tmp_libs=
2529 for deplib in $dependency_libs; do
2530 case $deplib in
2531 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2532 esac
2533 # Need to link against all dependency_libs?
2534 if test "$linkalldeplibs" = yes; then
2535 deplibs="$deplib $deplibs"
2536 else
2537 # Need to hardcode shared library paths
2538 # or/and link against static libraries
2539 newdependency_libs="$deplib $newdependency_libs"
2540 fi
2541 if test "X$duplicate_deps" = "Xyes" ; then
2542 case "$tmp_libs " in
2543 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2544 esac
2545 fi
2546 tmp_libs="$tmp_libs $deplib"
2547 done # for deplib
2548 continue
2549 fi # $linkmode = prog...
2550
2551 if test "$linkmode,$pass" = "prog,link"; then
2552 if test -n "$library_names" &&
2553 { { test "$prefer_static_libs" = no ||
2554 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2555 test -z "$old_library"; }; then
2556 # We need to hardcode the library path
2557 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2558 # Make sure the rpath contains only unique directories.
2559 case "$temp_rpath " in
2560 *" $dir "*) ;;
2561 *" $absdir "*) ;;
2562 *) temp_rpath="$temp_rpath $absdir" ;;
2563 esac
2564 fi
2565
2566 # Hardcode the library path.
2567 # Skip directories that are in the system default run-time
2568 # search path.
2569 case " $sys_lib_dlsearch_path " in
2570 *" $absdir "*) ;;
2571 *)
2572 case "$compile_rpath " in
2573 *" $absdir "*) ;;
2574 *) compile_rpath="$compile_rpath $absdir"
2575 esac
2576 ;;
2577 esac
2578 case " $sys_lib_dlsearch_path " in
2579 *" $libdir "*) ;;
2580 *)
2581 case "$finalize_rpath " in
2582 *" $libdir "*) ;;
2583 *) finalize_rpath="$finalize_rpath $libdir"
2584 esac
2585 ;;
2586 esac
2587 fi # $linkmode,$pass = prog,link...
2588
2589 if test "$alldeplibs" = yes &&
2590 { test "$deplibs_check_method" = pass_all ||
2591 { test "$build_libtool_libs" = yes &&
2592 test -n "$library_names"; }; }; then
2593 # We only need to search for static libraries
2594 continue
2595 fi
2596 fi
2597
2598 link_static=no # Whether the deplib will be linked statically
2599 use_static_libs=$prefer_static_libs
2600 if test "$use_static_libs" = built && test "$installed" = yes ; then
2601 use_static_libs=no
2602 fi
2603 if test -n "$library_names" &&
2604 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2605 if test "$installed" = no; then
2606 notinst_deplibs="$notinst_deplibs $lib"
2607 need_relink=yes
2608 fi
2609 # This is a shared library
2610
2611 # Warn about portability, can't link against -module's on
2612 # some systems (darwin)
2613 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2614 $echo
2615 if test "$linkmode" = prog; then
2616 $echo "*** Warning: Linking the executable $output against the loadable module"
2617 else
2618 $echo "*** Warning: Linking the shared library $output against the loadable module"
2619 fi
2620 $echo "*** $linklib is not portable!"
2621 fi
2622 if test "$linkmode" = lib &&
2623 test "$hardcode_into_libs" = yes; then
2624 # Hardcode the library path.
2625 # Skip directories that are in the system default run-time
2626 # search path.
2627 case " $sys_lib_dlsearch_path " in
2628 *" $absdir "*) ;;
2629 *)
2630 case "$compile_rpath " in
2631 *" $absdir "*) ;;
2632 *) compile_rpath="$compile_rpath $absdir"
2633 esac
2634 ;;
2635 esac
2636 case " $sys_lib_dlsearch_path " in
2637 *" $libdir "*) ;;
2638 *)
2639 case "$finalize_rpath " in
2640 *" $libdir "*) ;;
2641 *) finalize_rpath="$finalize_rpath $libdir"
2642 esac
2643 ;;
2644 esac
2645 fi
2646
2647 if test -n "$old_archive_from_expsyms_cmds"; then
2648 # figure out the soname
2649 set dummy $library_names
2650 realname="$2"
2651 shift; shift
2652 libname=`eval \\$echo \"$libname_spec\"`
2653 # use dlname if we got it. it's perfectly good, no?
2654 if test -n "$dlname"; then
2655 soname="$dlname"
2656 elif test -n "$soname_spec"; then
2657 # bleh windows
2658 case $host in
2659 *cygwin* | mingw*)
2660 major=`expr $current - $age`
2661 versuffix="-$major"
2662 ;;
2663 esac
2664 eval soname=\"$soname_spec\"
2665 else
2666 soname="$realname"
2667 fi
2668
2669 # Make a new name for the extract_expsyms_cmds to use
2670 soroot="$soname"
2671 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2672 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2673
2674 # If the library has no export list, then create one now
2675 if test -f "$output_objdir/$soname-def"; then :
2676 else
2677 $show "extracting exported symbol list from \`$soname'"
2678 save_ifs="$IFS"; IFS='~'
2679 cmds=$extract_expsyms_cmds
2680 for cmd in $cmds; do
2681 IFS="$save_ifs"
2682 eval cmd=\"$cmd\"
2683 $show "$cmd"
2684 $run eval "$cmd" || exit $?
2685 done
2686 IFS="$save_ifs"
2687 fi
2688
2689 # Create $newlib
2690 if test -f "$output_objdir/$newlib"; then :; else
2691 $show "generating import library for \`$soname'"
2692 save_ifs="$IFS"; IFS='~'
2693 cmds=$old_archive_from_expsyms_cmds
2694 for cmd in $cmds; do
2695 IFS="$save_ifs"
2696 eval cmd=\"$cmd\"
2697 $show "$cmd"
2698 $run eval "$cmd" || exit $?
2699 done
2700 IFS="$save_ifs"
2701 fi
2702 # make sure the library variables are pointing to the new library
2703 dir=$output_objdir
2704 linklib=$newlib
2705 fi # test -n "$old_archive_from_expsyms_cmds"
2706
2707 if test "$linkmode" = prog || test "$mode" != relink; then
2708 add_shlibpath=
2709 add_dir=
2710 add=
2711 lib_linked=yes
2712 case $hardcode_action in
2713 immediate | unsupported)
2714 if test "$hardcode_direct" = no; then
2715 add="$dir/$linklib"
2716 case $host in
2717 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2718 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2719 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2720 *-*-unixware7*) add_dir="-L$dir" ;;
2721 *-*-darwin* )
2722 # if the lib is a module then we can not link against
2723 # it, someone is ignoring the new warnings I added
2724 if /usr/bin/file -L $add 2> /dev/null |
2725 $EGREP ": [^:]* bundle" >/dev/null ; then
2726 $echo "** Warning, lib $linklib is a module, not a shared library"
2727 if test -z "$old_library" ; then
2728 $echo
2729 $echo "** And there doesn't seem to be a static archive available"
2730 $echo "** The link will probably fail, sorry"
2731 else
2732 add="$dir/$old_library"
2733 fi
2734 fi
2735 esac
2736 elif test "$hardcode_minus_L" = no; then
2737 case $host in
2738 *-*-sunos*) add_shlibpath="$dir" ;;
2739 esac
2740 add_dir="-L$dir"
2741 add="-l$name"
2742 elif test "$hardcode_shlibpath_var" = no; then
2743 add_shlibpath="$dir"
2744 add="-l$name"
2745 else
2746 lib_linked=no
2747 fi
2748 ;;
2749 relink)
2750 if test "$hardcode_direct" = yes; then
2751 add="$dir/$linklib"
2752 elif test "$hardcode_minus_L" = yes; then
2753 add_dir="-L$dir"
2754 # Try looking first in the location we're being installed to.
2755 if test -n "$inst_prefix_dir"; then
2756 case $libdir in
2757 [\\/]*)
2758 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2759 ;;
2760 esac
2761 fi
2762 add="-l$name"
2763 elif test "$hardcode_shlibpath_var" = yes; then
2764 add_shlibpath="$dir"
2765 add="-l$name"
2766 else
2767 lib_linked=no
2768 fi
2769 ;;
2770 *) lib_linked=no ;;
2771 esac
2772
2773 if test "$lib_linked" != yes; then
2774 $echo "$modename: configuration error: unsupported hardcode properties"
2775 exit $EXIT_FAILURE
2776 fi
2777
2778 if test -n "$add_shlibpath"; then
2779 case :$compile_shlibpath: in
2780 *":$add_shlibpath:"*) ;;
2781 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2782 esac
2783 fi
2784 if test "$linkmode" = prog; then
2785 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2786 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2787 else
2788 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2789 test -n "$add" && deplibs="$add $deplibs"
2790 if test "$hardcode_direct" != yes && \
2791 test "$hardcode_minus_L" != yes && \
2792 test "$hardcode_shlibpath_var" = yes; then
2793 case :$finalize_shlibpath: in
2794 *":$libdir:"*) ;;
2795 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2796 esac
2797 fi
2798 fi
2799 fi
2800
2801 if test "$linkmode" = prog || test "$mode" = relink; then
2802 add_shlibpath=
2803 add_dir=
2804 add=
2805 # Finalize command for both is simple: just hardcode it.
2806 if test "$hardcode_direct" = yes; then
2807 add="$libdir/$linklib"
2808 elif test "$hardcode_minus_L" = yes; then
2809 add_dir="-L$libdir"
2810 add="-l$name"
2811 elif test "$hardcode_shlibpath_var" = yes; then
2812 case :$finalize_shlibpath: in
2813 *":$libdir:"*) ;;
2814 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2815 esac
2816 add="-l$name"
2817 elif test "$hardcode_automatic" = yes; then
2818 if test -n "$inst_prefix_dir" &&
2819 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2820 add="$inst_prefix_dir$libdir/$linklib"
2821 else
2822 add="$libdir/$linklib"
2823 fi
2824 else
2825 # We cannot seem to hardcode it, guess we'll fake it.
2826 add_dir="-L$libdir"
2827 # Try looking first in the location we're being installed to.
2828 if test -n "$inst_prefix_dir"; then
2829 case $libdir in
2830 [\\/]*)
2831 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2832 ;;
2833 esac
2834 fi
2835 add="-l$name"
2836 fi
2837
2838 if test "$linkmode" = prog; then
2839 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2840 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2841 else
2842 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2843 test -n "$add" && deplibs="$add $deplibs"
2844 fi
2845 fi
2846 elif test "$linkmode" = prog; then
2847 # Here we assume that one of hardcode_direct or hardcode_minus_L
2848 # is not unsupported. This is valid on all known static and
2849 # shared platforms.
2850 if test "$hardcode_direct" != unsupported; then
2851 test -n "$old_library" && linklib="$old_library"
2852 compile_deplibs="$dir/$linklib $compile_deplibs"
2853 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2854 else
2855 compile_deplibs="-l$name -L$dir $compile_deplibs"
2856 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2857 fi
2858 elif test "$build_libtool_libs" = yes; then
2859 # Not a shared library
2860 if test "$deplibs_check_method" != pass_all; then
2861 # We're trying link a shared library against a static one
2862 # but the system doesn't support it.
2863
2864 # Just print a warning and add the library to dependency_libs so
2865 # that the program can be linked against the static library.
2866 $echo
2867 $echo "*** Warning: This system can not link to static lib archive $lib."
2868 $echo "*** I have the capability to make that library automatically link in when"
2869 $echo "*** you link to this library. But I can only do this if you have a"
2870 $echo "*** shared version of the library, which you do not appear to have."
2871 if test "$module" = yes; then
2872 $echo "*** But as you try to build a module library, libtool will still create "
2873 $echo "*** a static module, that should work as long as the dlopening application"
2874 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2875 if test -z "$global_symbol_pipe"; then
2876 $echo
2877 $echo "*** However, this would only work if libtool was able to extract symbol"
2878 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2879 $echo "*** not find such a program. So, this module is probably useless."
2880 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2881 fi
2882 if test "$build_old_libs" = no; then
2883 build_libtool_libs=module
2884 build_old_libs=yes
2885 else
2886 build_libtool_libs=no
2887 fi
2888 fi
2889 else
2890 deplibs="$dir/$old_library $deplibs"
2891 link_static=yes
2892 fi
2893 fi # link shared/static library?
2894
2895 if test "$linkmode" = lib; then
2896 if test -n "$dependency_libs" &&
2897 { test "$hardcode_into_libs" != yes ||
2898 test "$build_old_libs" = yes ||
2899 test "$link_static" = yes; }; then
2900 # Extract -R from dependency_libs
2901 temp_deplibs=
2902 for libdir in $dependency_libs; do
2903 case $libdir in
2904 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2905 case " $xrpath " in
2906 *" $temp_xrpath "*) ;;
2907 *) xrpath="$xrpath $temp_xrpath";;
2908 esac;;
2909 *) temp_deplibs="$temp_deplibs $libdir";;
2910 esac
2911 done
2912 dependency_libs="$temp_deplibs"
2913 fi
2914
2915 newlib_search_path="$newlib_search_path $absdir"
2916 # Link against this library
2917 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2918 # ... and its dependency_libs
2919 tmp_libs=
2920 for deplib in $dependency_libs; do
2921 newdependency_libs="$deplib $newdependency_libs"
2922 if test "X$duplicate_deps" = "Xyes" ; then
2923 case "$tmp_libs " in
2924 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2925 esac
2926 fi
2927 tmp_libs="$tmp_libs $deplib"
2928 done
2929
2930 if test "$link_all_deplibs" != no; then
2931 # Add the search paths of all dependency libraries
2932 for deplib in $dependency_libs; do
2933 case $deplib in
2934 -L*) path="$deplib" ;;
2935 *.la)
2936 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2937 test "X$dir" = "X$deplib" && dir="."
2938 # We need an absolute path.
2939 case $dir in
2940 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2941 *)
2942 absdir=`cd "$dir" && pwd`
2943 if test -z "$absdir"; then
2944 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2945 absdir="$dir"
2946 fi
2947 ;;
2948 esac
2949 if grep "^installed=no" $deplib > /dev/null; then
2950 path="$absdir/$objdir"
2951 else
2952 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2953 if test -z "$libdir"; then
2954 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2955 exit $EXIT_FAILURE
2956 fi
2957 if test "$absdir" != "$libdir"; then
2958 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2959 fi
2960 path="$absdir"
2961 fi
2962 depdepl=
2963 case $host in
2964 *-*-darwin*)
2965 # we do not want to link against static libs,
2966 # but need to link against shared
2967 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2968 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2969 if test -n "$deplibrary_names" ; then
2970 for tmp in $deplibrary_names ; do
2971 depdepl=$tmp
2972 done
2973 if test -f "$deplibdir/$depdepl" ; then
2974 depdepl="$deplibdir/$depdepl"
2975 elif test -f "$path/$depdepl" ; then
2976 depdepl="$path/$depdepl"
2977 else
2978 # Can't find it, oh well...
2979 depdepl=
2980 fi
2981 # do not add paths which are already there
2982 case " $newlib_search_path " in
2983 *" $path "*) ;;
2984 *) newlib_search_path="$newlib_search_path $path";;
2985 esac
2986 fi
2987 path=""
2988 ;;
2989 *)
2990 path="-L$path"
2991 ;;
2992 esac
2993 ;;
2994 -l*)
2995 case $host in
2996 *-*-darwin*)
2997 # Again, we only want to link against shared libraries
2998 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2999 for tmp in $newlib_search_path ; do
3000 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3001 eval depdepl="$tmp/lib$tmp_libs.dylib"
3002 break
3003 fi
3004 done
3005 path=""
3006 ;;
3007 *) continue ;;
3008 esac
3009 ;;
3010 *) continue ;;
3011 esac
3012 case " $deplibs " in
3013 *" $path "*) ;;
3014 *) deplibs="$path $deplibs" ;;
3015 esac
3016 case " $deplibs " in
3017 *" $depdepl "*) ;;
3018 *) deplibs="$depdepl $deplibs" ;;
3019 esac
3020 done
3021 fi # link_all_deplibs != no
3022 fi # linkmode = lib
3023 done # for deplib in $libs
3024 dependency_libs="$newdependency_libs"
3025 if test "$pass" = dlpreopen; then
3026 # Link the dlpreopened libraries before other libraries
3027 for deplib in $save_deplibs; do
3028 deplibs="$deplib $deplibs"
3029 done
3030 fi
3031 if test "$pass" != dlopen; then
3032 if test "$pass" != conv; then
3033 # Make sure lib_search_path contains only unique directories.
3034 lib_search_path=
3035 for dir in $newlib_search_path; do
3036 case "$lib_search_path " in
3037 *" $dir "*) ;;
3038 *) lib_search_path="$lib_search_path $dir" ;;
3039 esac
3040 done
3041 newlib_search_path=
3042 fi
3043
3044 if test "$linkmode,$pass" != "prog,link"; then
3045 vars="deplibs"
3046 else
3047 vars="compile_deplibs finalize_deplibs"
3048 fi
3049 for var in $vars dependency_libs; do
3050 # Add libraries to $var in reverse order
3051 eval tmp_libs=\"\$$var\"
3052 new_libs=
3053 for deplib in $tmp_libs; do
3054 # FIXME: Pedantically, this is the right thing to do, so
3055 # that some nasty dependency loop isn't accidentally
3056 # broken:
3057 #new_libs="$deplib $new_libs"
3058 # Pragmatically, this seems to cause very few problems in
3059 # practice:
3060 case $deplib in
3061 -L*) new_libs="$deplib $new_libs" ;;
3062 -R*) ;;
3063 *)
3064 # And here is the reason: when a library appears more
3065 # than once as an explicit dependence of a library, or
3066 # is implicitly linked in more than once by the
3067 # compiler, it is considered special, and multiple
3068 # occurrences thereof are not removed. Compare this
3069 # with having the same library being listed as a
3070 # dependency of multiple other libraries: in this case,
3071 # we know (pedantically, we assume) the library does not
3072 # need to be listed more than once, so we keep only the
3073 # last copy. This is not always right, but it is rare
3074 # enough that we require users that really mean to play
3075 # such unportable linking tricks to link the library
3076 # using -Wl,-lname, so that libtool does not consider it
3077 # for duplicate removal.
3078 case " $specialdeplibs " in
3079 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3080 *)
3081 case " $new_libs " in
3082 *" $deplib "*) ;;
3083 *) new_libs="$deplib $new_libs" ;;
3084 esac
3085 ;;
3086 esac
3087 ;;
3088 esac
3089 done
3090 tmp_libs=
3091 for deplib in $new_libs; do
3092 case $deplib in
3093 -L*)
3094 case " $tmp_libs " in
3095 *" $deplib "*) ;;
3096 *) tmp_libs="$tmp_libs $deplib" ;;
3097 esac
3098 ;;
3099 *) tmp_libs="$tmp_libs $deplib" ;;
3100 esac
3101 done
3102 eval $var=\"$tmp_libs\"
3103 done # for var
3104 fi
3105 # Last step: remove runtime libs from dependency_libs
3106 # (they stay in deplibs)
3107 tmp_libs=
3108 for i in $dependency_libs ; do
3109 case " $predeps $postdeps $compiler_lib_search_path " in
3110 *" $i "*)
3111 i=""
3112 ;;
3113 esac
3114 if test -n "$i" ; then
3115 tmp_libs="$tmp_libs $i"
3116 fi
3117 done
3118 dependency_libs=$tmp_libs
3119 done # for pass
3120 if test "$linkmode" = prog; then
3121 dlfiles="$newdlfiles"
3122 dlprefiles="$newdlprefiles"
3123 fi
3124
3125 case $linkmode in
3126 oldlib)
3127 case " $deplibs" in
3128 *\ -l* | *\ -L*)
3129 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3130 esac
3131
3132 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3133 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3134 fi
3135
3136 if test -n "$rpath"; then
3137 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3138 fi
3139
3140 if test -n "$xrpath"; then
3141 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3142 fi
3143
3144 if test -n "$vinfo"; then
3145 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3146 fi
3147
3148 if test -n "$release"; then
3149 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3150 fi
3151
3152 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3153 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3154 fi
3155
3156 # Now set the variables for building old libraries.
3157 build_libtool_libs=no
3158 oldlibs="$output"
3159 objs="$objs$old_deplibs"
3160 ;;
3161
3162 lib)
3163 # Make sure we only generate libraries of the form `libNAME.la'.
3164 case $outputname in
3165 lib*)
3166 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3167 eval shared_ext=\"$shrext_cmds\"
3168 eval libname=\"$libname_spec\"
3169 ;;
3170 *)
3171 if test "$module" = no; then
3172 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3173 $echo "$help" 1>&2
3174 exit $EXIT_FAILURE
3175 fi
3176 if test "$need_lib_prefix" != no; then
3177 # Add the "lib" prefix for modules if required
3178 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3179 eval shared_ext=\"$shrext_cmds\"
3180 eval libname=\"$libname_spec\"
3181 else
3182 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3183 fi
3184 ;;
3185 esac
3186
3187 if test -n "$objs"; then
3188 if test "$deplibs_check_method" != pass_all; then
3189 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3190 exit $EXIT_FAILURE
3191 else
3192 $echo
3193 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3194 $echo "*** objects $objs is not portable!"
3195 libobjs="$libobjs $objs"
3196 fi
3197 fi
3198
3199 if test "$dlself" != no; then
3200 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3201 fi
3202
3203 set dummy $rpath
3204 if test "$#" -gt 2; then
3205 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3206 fi
3207 install_libdir="$2"
3208
3209 oldlibs=
3210 if test -z "$rpath"; then
3211 if test "$build_libtool_libs" = yes; then
3212 # Building a libtool convenience library.
3213 # Some compilers have problems with a `.al' extension so
3214 # convenience libraries should have the same extension an
3215 # archive normally would.
3216 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3217 build_libtool_libs=convenience
3218 build_old_libs=yes
3219 fi
3220
3221 if test -n "$vinfo"; then
3222 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3223 fi
3224
3225 if test -n "$release"; then
3226 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3227 fi
3228 else
3229
3230 # Parse the version information argument.
3231 save_ifs="$IFS"; IFS=':'
3232 set dummy $vinfo 0 0 0
3233 IFS="$save_ifs"
3234
3235 if test -n "$8"; then
3236 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3237 $echo "$help" 1>&2
3238 exit $EXIT_FAILURE
3239 fi
3240
3241 # convert absolute version numbers to libtool ages
3242 # this retains compatibility with .la files and attempts
3243 # to make the code below a bit more comprehensible
3244
3245 case $vinfo_number in
3246 yes)
3247 number_major="$2"
3248 number_minor="$3"
3249 number_revision="$4"
3250 #
3251 # There are really only two kinds -- those that
3252 # use the current revision as the major version
3253 # and those that subtract age and use age as
3254 # a minor version. But, then there is irix
3255 # which has an extra 1 added just for fun
3256 #
3257 case $version_type in
3258 darwin|linux|osf|windows|none)
3259 current=`expr $number_major + $number_minor`
3260 age="$number_minor"
3261 revision="$number_revision"
3262 ;;
3263 freebsd-aout|freebsd-elf|sunos)
3264 current="$number_major"
3265 revision="$number_minor"
3266 age="0"
3267 ;;
3268 irix|nonstopux)
3269 current=`expr $number_major + $number_minor`
3270 age="$number_minor"
3271 revision="$number_minor"
3272 lt_irix_increment=no
3273 ;;
3274 *)
3275 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3276 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3277 exit $EXIT_FAILURE
3278 ;;
3279 esac
3280 ;;
3281 no)
3282 current="$2"
3283 revision="$3"
3284 age="$4"
3285 ;;
3286 esac
3287
3288 # Check that each of the things are valid numbers.
3289 case $current in
3290 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]) ;;
3291 *)
3292 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3293 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3294 exit $EXIT_FAILURE
3295 ;;
3296 esac
3297
3298 case $revision in
3299 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]) ;;
3300 *)
3301 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3302 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3303 exit $EXIT_FAILURE
3304 ;;
3305 esac
3306
3307 case $age in
3308 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]) ;;
3309 *)
3310 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3311 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3312 exit $EXIT_FAILURE
3313 ;;
3314 esac
3315
3316 if test "$age" -gt "$current"; then
3317 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3318 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3319 exit $EXIT_FAILURE
3320 fi
3321
3322 # Calculate the version variables.
3323 major=
3324 versuffix=
3325 verstring=
3326 case $version_type in
3327 none) ;;
3328
3329 darwin)
3330 # Like Linux, but with the current version available in
3331 # verstring for coding it into the library header
3332 major=.`expr $current - $age`
3333 versuffix="$major.$age.$revision"
3334 # Darwin ld doesn't like 0 for these options...
3335 minor_current=`expr $current + 1`
3336 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3337 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3338 ;;
3339
3340 freebsd-aout)
3341 major=".$current"
3342 versuffix=".$current.$revision";
3343 ;;
3344
3345 freebsd-elf)
3346 major=".$current"
3347 versuffix=".$current";
3348 ;;
3349
3350 irix | nonstopux)
3351 if test "X$lt_irix_increment" = "Xno"; then
3352 major=`expr $current - $age`
3353 else
3354 major=`expr $current - $age + 1`
3355 fi
3356 case $version_type in
3357 nonstopux) verstring_prefix=nonstopux ;;
3358 *) verstring_prefix=sgi ;;
3359 esac
3360 verstring="$verstring_prefix$major.$revision"
3361
3362 # Add in all the interfaces that we are compatible with.
3363 loop=$revision
3364 while test "$loop" -ne 0; do
3365 iface=`expr $revision - $loop`
3366 loop=`expr $loop - 1`
3367 verstring="$verstring_prefix$major.$iface:$verstring"
3368 done
3369
3370 # Before this point, $major must not contain `.'.
3371 major=.$major
3372 versuffix="$major.$revision"
3373 ;;
3374
3375 linux)
3376 major=.`expr $current - $age`
3377 versuffix="$major.$age.$revision"
3378 ;;
3379
3380 osf)
3381 major=.`expr $current - $age`
3382 versuffix=".$current.$age.$revision"
3383 verstring="$current.$age.$revision"
3384
3385 # Add in all the interfaces that we are compatible with.
3386 loop=$age
3387 while test "$loop" -ne 0; do
3388 iface=`expr $current - $loop`
3389 loop=`expr $loop - 1`
3390 verstring="$verstring:${iface}.0"
3391 done
3392
3393 # Make executables depend on our current version.
3394 verstring="$verstring:${current}.0"
3395 ;;
3396
3397 sunos)
3398 major=".$current"
3399 versuffix=".$current.$revision"
3400 ;;
3401
3402 windows)
3403 # Use '-' rather than '.', since we only want one
3404 # extension on DOS 8.3 filesystems.
3405 major=`expr $current - $age`
3406 versuffix="-$major"
3407 ;;
3408
3409 *)
3410 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3411 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3412 exit $EXIT_FAILURE
3413 ;;
3414 esac
3415
3416 # Clear the version info if we defaulted, and they specified a release.
3417 if test -z "$vinfo" && test -n "$release"; then
3418 major=
3419 case $version_type in
3420 darwin)
3421 # we can't check for "0.0" in archive_cmds due to quoting
3422 # problems, so we reset it completely
3423 verstring=
3424 ;;
3425 *)
3426 verstring="0.0"
3427 ;;
3428 esac
3429 if test "$need_version" = no; then
3430 versuffix=
3431 else
3432 versuffix=".0.0"
3433 fi
3434 fi
3435
3436 # Remove version info from name if versioning should be avoided
3437 if test "$avoid_version" = yes && test "$need_version" = no; then
3438 major=
3439 versuffix=
3440 verstring=""
3441 fi
3442
3443 # Check to see if the archive will have undefined symbols.
3444 if test "$allow_undefined" = yes; then
3445 if test "$allow_undefined_flag" = unsupported; then
3446 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3447 build_libtool_libs=no
3448 build_old_libs=yes
3449 fi
3450 else
3451 # Don't allow undefined symbols.
3452 allow_undefined_flag="$no_undefined_flag"
3453 fi
3454 fi
3455
3456 if test "$mode" != relink; then
3457 # Remove our outputs, but don't remove object files since they
3458 # may have been created when compiling PIC objects.
3459 removelist=
3460 tempremovelist=`$echo "$output_objdir/*"`
3461 for p in $tempremovelist; do
3462 case $p in
3463 *.$objext)
3464 ;;
3465 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3466 if test "X$precious_files_regex" != "X"; then
3467 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3468 then
3469 continue
3470 fi
3471 fi
3472 removelist="$removelist $p"
3473 ;;
3474 *) ;;
3475 esac
3476 done
3477 if test -n "$removelist"; then
3478 $show "${rm}r $removelist"
3479 $run ${rm}r $removelist
3480 fi
3481 fi
3482
3483 # Now set the variables for building old libraries.
3484 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3485 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3486
3487 # Transform .lo files to .o files.
3488 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3489 fi
3490
3491 # Eliminate all temporary directories.
3492 #for path in $notinst_path; do
3493 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3494 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3495 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3496 #done
3497
3498 if test -n "$xrpath"; then
3499 # If the user specified any rpath flags, then add them.
3500 temp_xrpath=
3501 for libdir in $xrpath; do
3502 temp_xrpath="$temp_xrpath -R$libdir"
3503 case "$finalize_rpath " in
3504 *" $libdir "*) ;;
3505 *) finalize_rpath="$finalize_rpath $libdir" ;;
3506 esac
3507 done
3508 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3509 dependency_libs="$temp_xrpath $dependency_libs"
3510 fi
3511 fi
3512
3513 # Make sure dlfiles contains only unique files that won't be dlpreopened
3514 old_dlfiles="$dlfiles"
3515 dlfiles=
3516 for lib in $old_dlfiles; do
3517 case " $dlprefiles $dlfiles " in
3518 *" $lib "*) ;;
3519 *) dlfiles="$dlfiles $lib" ;;
3520 esac
3521 done
3522
3523 # Make sure dlprefiles contains only unique files
3524 old_dlprefiles="$dlprefiles"
3525 dlprefiles=
3526 for lib in $old_dlprefiles; do
3527 case "$dlprefiles " in
3528 *" $lib "*) ;;
3529 *) dlprefiles="$dlprefiles $lib" ;;
3530 esac
3531 done
3532
3533 if test "$build_libtool_libs" = yes; then
3534 if test -n "$rpath"; then
3535 case $host in
3536 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3537 # these systems don't actually have a c library (as such)!
3538 ;;
3539 *-*-rhapsody* | *-*-darwin1.[012])
3540 # Rhapsody C library is in the System framework
3541 deplibs="$deplibs -framework System"
3542 ;;
3543 *-*-netbsd*)
3544 # Don't link with libc until the a.out ld.so is fixed.
3545 ;;
3546 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3547 # Do not include libc due to us having libc/libc_r.
3548 ;;
3549 *-*-sco3.2v5* | *-*-sco5v6*)
3550 # Causes problems with __ctype
3551 ;;
3552 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3553 # Compiler inserts libc in the correct place for threads to work
3554 ;;
3555 *)
3556 # Add libc to deplibs on all other systems if necessary.
3557 if test "$build_libtool_need_lc" = "yes"; then
3558 deplibs="$deplibs -lc"
3559 fi
3560 ;;
3561 esac
3562 fi
3563
3564 # Transform deplibs into only deplibs that can be linked in shared.
3565 name_save=$name
3566 libname_save=$libname
3567 release_save=$release
3568 versuffix_save=$versuffix
3569 major_save=$major
3570 # I'm not sure if I'm treating the release correctly. I think
3571 # release should show up in the -l (ie -lgmp5) so we don't want to
3572 # add it in twice. Is that correct?
3573 release=""
3574 versuffix=""
3575 major=""
3576 newdeplibs=
3577 droppeddeps=no
3578 case $deplibs_check_method in
3579 pass_all)
3580 # Don't check for shared/static. Everything works.
3581 # This might be a little naive. We might want to check
3582 # whether the library exists or not. But this is on
3583 # osf3 & osf4 and I'm not really sure... Just
3584 # implementing what was already the behavior.
3585 newdeplibs=$deplibs
3586 ;;
3587 test_compile)
3588 # This code stresses the "libraries are programs" paradigm to its
3589 # limits. Maybe even breaks it. We compile a program, linking it
3590 # against the deplibs as a proxy for the library. Then we can check
3591 # whether they linked in statically or dynamically with ldd.
3592 $rm conftest.c
3593 cat > conftest.c <<EOF
3594 int main() { return 0; }
3595 EOF
3596 $rm conftest
3597 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3598 ldd_output=`ldd conftest`
3599 for i in $deplibs; do
3600 name=`expr $i : '-l\(.*\)'`
3601 # If $name is empty we are operating on a -L argument.
3602 if test "$name" != "" && test "$name" != "0"; then
3603 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3604 case " $predeps $postdeps " in
3605 *" $i "*)
3606 newdeplibs="$newdeplibs $i"
3607 i=""
3608 ;;
3609 esac
3610 fi
3611 if test -n "$i" ; then
3612 libname=`eval \\$echo \"$libname_spec\"`
3613 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3614 set dummy $deplib_matches
3615 deplib_match=$2
3616 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3617 newdeplibs="$newdeplibs $i"
3618 else
3619 droppeddeps=yes
3620 $echo
3621 $echo "*** Warning: dynamic linker does not accept needed library $i."
3622 $echo "*** I have the capability to make that library automatically link in when"
3623 $echo "*** you link to this library. But I can only do this if you have a"
3624 $echo "*** shared version of the library, which I believe you do not have"
3625 $echo "*** because a test_compile did reveal that the linker did not use it for"
3626 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3627 fi
3628 fi
3629 else
3630 newdeplibs="$newdeplibs $i"
3631 fi
3632 done
3633 else
3634 # Error occurred in the first compile. Let's try to salvage
3635 # the situation: Compile a separate program for each library.
3636 for i in $deplibs; do
3637 name=`expr $i : '-l\(.*\)'`
3638 # If $name is empty we are operating on a -L argument.
3639 if test "$name" != "" && test "$name" != "0"; then
3640 $rm conftest
3641 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3642 ldd_output=`ldd conftest`
3643 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3644 case " $predeps $postdeps " in
3645 *" $i "*)
3646 newdeplibs="$newdeplibs $i"
3647 i=""
3648 ;;
3649 esac
3650 fi
3651 if test -n "$i" ; then
3652 libname=`eval \\$echo \"$libname_spec\"`
3653 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3654 set dummy $deplib_matches
3655 deplib_match=$2
3656 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3657 newdeplibs="$newdeplibs $i"
3658 else
3659 droppeddeps=yes
3660 $echo
3661 $echo "*** Warning: dynamic linker does not accept needed library $i."
3662 $echo "*** I have the capability to make that library automatically link in when"
3663 $echo "*** you link to this library. But I can only do this if you have a"
3664 $echo "*** shared version of the library, which you do not appear to have"
3665 $echo "*** because a test_compile did reveal that the linker did not use this one"
3666 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3667 fi
3668 fi
3669 else
3670 droppeddeps=yes
3671 $echo
3672 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3673 $echo "*** make it link in! You will probably need to install it or some"
3674 $echo "*** library that it depends on before this library will be fully"
3675 $echo "*** functional. Installing it before continuing would be even better."
3676 fi
3677 else
3678 newdeplibs="$newdeplibs $i"
3679 fi
3680 done
3681 fi
3682 ;;
3683 file_magic*)
3684 set dummy $deplibs_check_method
3685 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3686 for a_deplib in $deplibs; do
3687 name=`expr $a_deplib : '-l\(.*\)'`
3688 # If $name is empty we are operating on a -L argument.
3689 if test "$name" != "" && test "$name" != "0"; then
3690 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3691 case " $predeps $postdeps " in
3692 *" $a_deplib "*)
3693 newdeplibs="$newdeplibs $a_deplib"
3694 a_deplib=""
3695 ;;
3696 esac
3697 fi
3698 if test -n "$a_deplib" ; then
3699 libname=`eval \\$echo \"$libname_spec\"`
3700 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3701 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3702 for potent_lib in $potential_libs; do
3703 # Follow soft links.
3704 if ls -lLd "$potent_lib" 2>/dev/null \
3705 | grep " -> " >/dev/null; then
3706 continue
3707 fi
3708 # The statement above tries to avoid entering an
3709 # endless loop below, in case of cyclic links.
3710 # We might still enter an endless loop, since a link
3711 # loop can be closed while we follow links,
3712 # but so what?
3713 potlib="$potent_lib"
3714 while test -h "$potlib" 2>/dev/null; do
3715 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3716 case $potliblink in
3717 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3718 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3719 esac
3720 done
3721 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3722 | ${SED} 10q \
3723 | $EGREP "$file_magic_regex" > /dev/null; then
3724 newdeplibs="$newdeplibs $a_deplib"
3725 a_deplib=""
3726 break 2
3727 fi
3728 done
3729 done
3730 fi
3731 if test -n "$a_deplib" ; then
3732 droppeddeps=yes
3733 $echo
3734 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3735 $echo "*** I have the capability to make that library automatically link in when"
3736 $echo "*** you link to this library. But I can only do this if you have a"
3737 $echo "*** shared version of the library, which you do not appear to have"
3738 $echo "*** because I did check the linker path looking for a file starting"
3739 if test -z "$potlib" ; then
3740 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3741 else
3742 $echo "*** with $libname and none of the candidates passed a file format test"
3743 $echo "*** using a file magic. Last file checked: $potlib"
3744 fi
3745 fi
3746 else
3747 # Add a -L argument.
3748 newdeplibs="$newdeplibs $a_deplib"
3749 fi
3750 done # Gone through all deplibs.
3751 ;;
3752 match_pattern*)
3753 set dummy $deplibs_check_method
3754 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3755 for a_deplib in $deplibs; do
3756 name=`expr $a_deplib : '-l\(.*\)'`
3757 # If $name is empty we are operating on a -L argument.
3758 if test -n "$name" && test "$name" != "0"; then
3759 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3760 case " $predeps $postdeps " in
3761 *" $a_deplib "*)
3762 newdeplibs="$newdeplibs $a_deplib"
3763 a_deplib=""
3764 ;;
3765 esac
3766 fi
3767 if test -n "$a_deplib" ; then
3768 libname=`eval \\$echo \"$libname_spec\"`
3769 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3770 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3771 for potent_lib in $potential_libs; do
3772 potlib="$potent_lib" # see symlink-check above in file_magic test
3773 if eval $echo \"$potent_lib\" 2>/dev/null \
3774 | ${SED} 10q \
3775 | $EGREP "$match_pattern_regex" > /dev/null; then
3776 newdeplibs="$newdeplibs $a_deplib"
3777 a_deplib=""
3778 break 2
3779 fi
3780 done
3781 done
3782 fi
3783 if test -n "$a_deplib" ; then
3784 droppeddeps=yes
3785 $echo
3786 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3787 $echo "*** I have the capability to make that library automatically link in when"
3788 $echo "*** you link to this library. But I can only do this if you have a"
3789 $echo "*** shared version of the library, which you do not appear to have"
3790 $echo "*** because I did check the linker path looking for a file starting"
3791 if test -z "$potlib" ; then
3792 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3793 else
3794 $echo "*** with $libname and none of the candidates passed a file format test"
3795 $echo "*** using a regex pattern. Last file checked: $potlib"
3796 fi
3797 fi
3798 else
3799 # Add a -L argument.
3800 newdeplibs="$newdeplibs $a_deplib"
3801 fi
3802 done # Gone through all deplibs.
3803 ;;
3804 none | unknown | *)
3805 newdeplibs=""
3806 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3807 -e 's/ -[LR][^ ]*//g'`
3808 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3809 for i in $predeps $postdeps ; do
3810 # can't use Xsed below, because $i might contain '/'
3811 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3812 done
3813 fi
3814 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3815 | grep . >/dev/null; then
3816 $echo
3817 if test "X$deplibs_check_method" = "Xnone"; then
3818 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3819 else
3820 $echo "*** Warning: inter-library dependencies are not known to be supported."
3821 fi
3822 $echo "*** All declared inter-library dependencies are being dropped."
3823 droppeddeps=yes
3824 fi
3825 ;;
3826 esac
3827 versuffix=$versuffix_save
3828 major=$major_save
3829 release=$release_save
3830 libname=$libname_save
3831 name=$name_save
3832
3833 case $host in
3834 *-*-rhapsody* | *-*-darwin1.[012])
3835 # On Rhapsody replace the C library is the System framework
3836 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3837 ;;
3838 esac
3839
3840 if test "$droppeddeps" = yes; then
3841 if test "$module" = yes; then
3842 $echo
3843 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3844 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3845 $echo "*** a static module, that should work as long as the dlopening"
3846 $echo "*** application is linked with the -dlopen flag."
3847 if test -z "$global_symbol_pipe"; then
3848 $echo
3849 $echo "*** However, this would only work if libtool was able to extract symbol"
3850 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3851 $echo "*** not find such a program. So, this module is probably useless."
3852 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3853 fi
3854 if test "$build_old_libs" = no; then
3855 oldlibs="$output_objdir/$libname.$libext"
3856 build_libtool_libs=module
3857 build_old_libs=yes
3858 else
3859 build_libtool_libs=no
3860 fi
3861 else
3862 $echo "*** The inter-library dependencies that have been dropped here will be"
3863 $echo "*** automatically added whenever a program is linked with this library"
3864 $echo "*** or is declared to -dlopen it."
3865
3866 if test "$allow_undefined" = no; then
3867 $echo
3868 $echo "*** Since this library must not contain undefined symbols,"
3869 $echo "*** because either the platform does not support them or"
3870 $echo "*** it was explicitly requested with -no-undefined,"
3871 $echo "*** libtool will only create a static version of it."
3872 if test "$build_old_libs" = no; then
3873 oldlibs="$output_objdir/$libname.$libext"
3874 build_libtool_libs=module
3875 build_old_libs=yes
3876 else
3877 build_libtool_libs=no
3878 fi
3879 fi
3880 fi
3881 fi
3882 # Done checking deplibs!
3883 deplibs=$newdeplibs
3884 fi
3885
3886
3887 # move library search paths that coincide with paths to not yet
3888 # installed libraries to the beginning of the library search list
3889 new_libs=
3890 for path in $notinst_path; do
3891 case " $new_libs " in
3892 *" -L$path/$objdir "*) ;;
3893 *)
3894 case " $deplibs " in
3895 *" -L$path/$objdir "*)
3896 new_libs="$new_libs -L$path/$objdir" ;;
3897 esac
3898 ;;
3899 esac
3900 done
3901 for deplib in $deplibs; do
3902 case $deplib in
3903 -L*)
3904 case " $new_libs " in
3905 *" $deplib "*) ;;
3906 *) new_libs="$new_libs $deplib" ;;
3907 esac
3908 ;;
3909 *) new_libs="$new_libs $deplib" ;;
3910 esac
3911 done
3912 deplibs="$new_libs"
3913
3914
3915 # All the library-specific variables (install_libdir is set above).
3916 library_names=
3917 old_library=
3918 dlname=
3919
3920 # Test again, we may have decided not to build it any more
3921 if test "$build_libtool_libs" = yes; then
3922 if test "$hardcode_into_libs" = yes; then
3923 # Hardcode the library paths
3924 hardcode_libdirs=
3925 dep_rpath=
3926 rpath="$finalize_rpath"
3927 test "$mode" != relink && rpath="$compile_rpath$rpath"
3928 for libdir in $rpath; do
3929 if test -n "$hardcode_libdir_flag_spec"; then
3930 if test -n "$hardcode_libdir_separator"; then
3931 if test -z "$hardcode_libdirs"; then
3932 hardcode_libdirs="$libdir"
3933 else
3934 # Just accumulate the unique libdirs.
3935 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3936 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3937 ;;
3938 *)
3939 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3940 ;;
3941 esac
3942 fi
3943 else
3944 eval flag=\"$hardcode_libdir_flag_spec\"
3945 dep_rpath="$dep_rpath $flag"
3946 fi
3947 elif test -n "$runpath_var"; then
3948 case "$perm_rpath " in
3949 *" $libdir "*) ;;
3950 *) perm_rpath="$perm_rpath $libdir" ;;
3951 esac
3952 fi
3953 done
3954 # Substitute the hardcoded libdirs into the rpath.
3955 if test -n "$hardcode_libdir_separator" &&
3956 test -n "$hardcode_libdirs"; then
3957 libdir="$hardcode_libdirs"
3958 if test -n "$hardcode_libdir_flag_spec_ld"; then
3959 case $archive_cmds in
3960 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
3961 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
3962 esac
3963 else
3964 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3965 fi
3966 fi
3967 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3968 # We should set the runpath_var.
3969 rpath=
3970 for dir in $perm_rpath; do
3971 rpath="$rpath$dir:"
3972 done
3973 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3974 fi
3975 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3976 fi
3977
3978 shlibpath="$finalize_shlibpath"
3979 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3980 if test -n "$shlibpath"; then
3981 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3982 fi
3983
3984 # Get the real and link names of the library.
3985 eval shared_ext=\"$shrext_cmds\"
3986 eval library_names=\"$library_names_spec\"
3987 set dummy $library_names
3988 realname="$2"
3989 shift; shift
3990
3991 if test -n "$soname_spec"; then
3992 eval soname=\"$soname_spec\"
3993 else
3994 soname="$realname"
3995 fi
3996 if test -z "$dlname"; then
3997 dlname=$soname
3998 fi
3999
4000 lib="$output_objdir/$realname"
4001 linknames=
4002 for link
4003 do
4004 linknames="$linknames $link"
4005 done
4006
4007 # Use standard objects if they are pic
4008 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4009
4010 # Prepare the list of exported symbols
4011 if test -z "$export_symbols"; then
4012 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4013 $show "generating symbol list for \`$libname.la'"
4014 export_symbols="$output_objdir/$libname.exp"
4015 $run $rm $export_symbols
4016 cmds=$export_symbols_cmds
4017 save_ifs="$IFS"; IFS='~'
4018 for cmd in $cmds; do
4019 IFS="$save_ifs"
4020 eval cmd=\"$cmd\"
4021 if len=`expr "X$cmd" : ".*"` &&
4022 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4023 $show "$cmd"
4024 $run eval "$cmd" || exit $?
4025 skipped_export=false
4026 else
4027 # The command line is too long to execute in one step.
4028 $show "using reloadable object file for export list..."
4029 skipped_export=:
4030 # Break out early, otherwise skipped_export may be
4031 # set to false by a later but shorter cmd.
4032 break
4033 fi
4034 done
4035 IFS="$save_ifs"
4036 if test -n "$export_symbols_regex"; then
4037 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4038 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4039 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4040 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4041 fi
4042 fi
4043 fi
4044
4045 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4046 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4047 fi
4048
4049 tmp_deplibs=
4050 for test_deplib in $deplibs; do
4051 case " $convenience " in
4052 *" $test_deplib "*) ;;
4053 *)
4054 tmp_deplibs="$tmp_deplibs $test_deplib"
4055 ;;
4056 esac
4057 done
4058 deplibs="$tmp_deplibs"
4059
4060 if test -n "$convenience"; then
4061 if test -n "$whole_archive_flag_spec"; then
4062 save_libobjs=$libobjs
4063 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4064 else
4065 gentop="$output_objdir/${outputname}x"
4066 generated="$generated $gentop"
4067
4068 func_extract_archives $gentop $convenience
4069 libobjs="$libobjs $func_extract_archives_result"
4070 fi
4071 fi
4072
4073 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4074 eval flag=\"$thread_safe_flag_spec\"
4075 linker_flags="$linker_flags $flag"
4076 fi
4077
4078 # Make a backup of the uninstalled library when relinking
4079 if test "$mode" = relink; then
4080 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4081 fi
4082
4083 # Do each of the archive commands.
4084 if test "$module" = yes && test -n "$module_cmds" ; then
4085 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4086 eval test_cmds=\"$module_expsym_cmds\"
4087 cmds=$module_expsym_cmds
4088 else
4089 eval test_cmds=\"$module_cmds\"
4090 cmds=$module_cmds
4091 fi
4092 else
4093 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4094 eval test_cmds=\"$archive_expsym_cmds\"
4095 cmds=$archive_expsym_cmds
4096 else
4097 eval test_cmds=\"$archive_cmds\"
4098 cmds=$archive_cmds
4099 fi
4100 fi
4101
4102 if test "X$skipped_export" != "X:" &&
4103 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4104 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4105 :
4106 else
4107 # The command line is too long to link in one step, link piecewise.
4108 $echo "creating reloadable object files..."
4109
4110 # Save the value of $output and $libobjs because we want to
4111 # use them later. If we have whole_archive_flag_spec, we
4112 # want to use save_libobjs as it was before
4113 # whole_archive_flag_spec was expanded, because we can't
4114 # assume the linker understands whole_archive_flag_spec.
4115 # This may have to be revisited, in case too many
4116 # convenience libraries get linked in and end up exceeding
4117 # the spec.
4118 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4119 save_libobjs=$libobjs
4120 fi
4121 save_output=$output
4122 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4123
4124 # Clear the reloadable object creation command queue and
4125 # initialize k to one.
4126 test_cmds=
4127 concat_cmds=
4128 objlist=
4129 delfiles=
4130 last_robj=
4131 k=1
4132 output=$output_objdir/$output_la-${k}.$objext
4133 # Loop over the list of objects to be linked.
4134 for obj in $save_libobjs
4135 do
4136 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4137 if test "X$objlist" = X ||
4138 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4139 test "$len" -le "$max_cmd_len"; }; then
4140 objlist="$objlist $obj"
4141 else
4142 # The command $test_cmds is almost too long, add a
4143 # command to the queue.
4144 if test "$k" -eq 1 ; then
4145 # The first file doesn't have a previous command to add.
4146 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4147 else
4148 # All subsequent reloadable object files will link in
4149 # the last one created.
4150 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4151 fi
4152 last_robj=$output_objdir/$output_la-${k}.$objext
4153 k=`expr $k + 1`
4154 output=$output_objdir/$output_la-${k}.$objext
4155 objlist=$obj
4156 len=1
4157 fi
4158 done
4159 # Handle the remaining objects by creating one last
4160 # reloadable object file. All subsequent reloadable object
4161 # files will link in the last one created.
4162 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4163 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4164
4165 if ${skipped_export-false}; then
4166 $show "generating symbol list for \`$libname.la'"
4167 export_symbols="$output_objdir/$libname.exp"
4168 $run $rm $export_symbols
4169 libobjs=$output
4170 # Append the command to create the export file.
4171 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4172 fi
4173
4174 # Set up a command to remove the reloadable object files
4175 # after they are used.
4176 i=0
4177 while test "$i" -lt "$k"
4178 do
4179 i=`expr $i + 1`
4180 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4181 done
4182
4183 $echo "creating a temporary reloadable object file: $output"
4184
4185 # Loop through the commands generated above and execute them.
4186 save_ifs="$IFS"; IFS='~'
4187 for cmd in $concat_cmds; do
4188 IFS="$save_ifs"
4189 $show "$cmd"
4190 $run eval "$cmd" || exit $?
4191 done
4192 IFS="$save_ifs"
4193
4194 libobjs=$output
4195 # Restore the value of output.
4196 output=$save_output
4197
4198 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4199 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4200 fi
4201 # Expand the library linking commands again to reset the
4202 # value of $libobjs for piecewise linking.
4203
4204 # Do each of the archive commands.
4205 if test "$module" = yes && test -n "$module_cmds" ; then
4206 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4207 cmds=$module_expsym_cmds
4208 else
4209 cmds=$module_cmds
4210 fi
4211 else
4212 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4213 cmds=$archive_expsym_cmds
4214 else
4215 cmds=$archive_cmds
4216 fi
4217 fi
4218
4219 # Append the command to remove the reloadable object files
4220 # to the just-reset $cmds.
4221 eval cmds=\"\$cmds~\$rm $delfiles\"
4222 fi
4223 save_ifs="$IFS"; IFS='~'
4224 for cmd in $cmds; do
4225 IFS="$save_ifs"
4226 eval cmd=\"$cmd\"
4227 $show "$cmd"
4228 $run eval "$cmd" || {
4229 lt_exit=$?
4230
4231 # Restore the uninstalled library and exit
4232 if test "$mode" = relink; then
4233 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4234 fi
4235
4236 exit $lt_exit
4237 }
4238 done
4239 IFS="$save_ifs"
4240
4241 # Restore the uninstalled library and exit
4242 if test "$mode" = relink; then
4243 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4244
4245 if test -n "$convenience"; then
4246 if test -z "$whole_archive_flag_spec"; then
4247 $show "${rm}r $gentop"
4248 $run ${rm}r "$gentop"
4249 fi
4250 fi
4251
4252 exit $EXIT_SUCCESS
4253 fi
4254
4255 # Create links to the real library.
4256 for linkname in $linknames; do
4257 if test "$realname" != "$linkname"; then
4258 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4259 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4260 fi
4261 done
4262
4263 # If -module or -export-dynamic was specified, set the dlname.
4264 if test "$module" = yes || test "$export_dynamic" = yes; then
4265 # On all known operating systems, these are identical.
4266 dlname="$soname"
4267 fi
4268 fi
4269 ;;
4270
4271 obj)
4272 case " $deplibs" in
4273 *\ -l* | *\ -L*)
4274 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4275 esac
4276
4277 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4278 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4279 fi
4280
4281 if test -n "$rpath"; then
4282 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4283 fi
4284
4285 if test -n "$xrpath"; then
4286 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4287 fi
4288
4289 if test -n "$vinfo"; then
4290 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4291 fi
4292
4293 if test -n "$release"; then
4294 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4295 fi
4296
4297 case $output in
4298 *.lo)
4299 if test -n "$objs$old_deplibs"; then
4300 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4301 exit $EXIT_FAILURE
4302 fi
4303 libobj="$output"
4304 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4305 ;;
4306 *)
4307 libobj=
4308 obj="$output"
4309 ;;
4310 esac
4311
4312 # Delete the old objects.
4313 $run $rm $obj $libobj
4314
4315 # Objects from convenience libraries. This assumes
4316 # single-version convenience libraries. Whenever we create
4317 # different ones for PIC/non-PIC, this we'll have to duplicate
4318 # the extraction.
4319 reload_conv_objs=
4320 gentop=
4321 # reload_cmds runs $LD directly, so let us get rid of
4322 # -Wl from whole_archive_flag_spec and hope we can get by with
4323 # turning comma into space..
4324 wl=
4325
4326 if test -n "$convenience"; then
4327 if test -n "$whole_archive_flag_spec"; then
4328 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4329 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4330 else
4331 gentop="$output_objdir/${obj}x"
4332 generated="$generated $gentop"
4333
4334 func_extract_archives $gentop $convenience
4335 reload_conv_objs="$reload_objs $func_extract_archives_result"
4336 fi
4337 fi
4338
4339 # Create the old-style object.
4340 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
4341
4342 output="$obj"
4343 cmds=$reload_cmds
4344 save_ifs="$IFS"; IFS='~'
4345 for cmd in $cmds; do
4346 IFS="$save_ifs"
4347 eval cmd=\"$cmd\"
4348 $show "$cmd"
4349 $run eval "$cmd" || exit $?
4350 done
4351 IFS="$save_ifs"
4352
4353 # Exit if we aren't doing a library object file.
4354 if test -z "$libobj"; then
4355 if test -n "$gentop"; then
4356 $show "${rm}r $gentop"
4357 $run ${rm}r $gentop
4358 fi
4359
4360 exit $EXIT_SUCCESS
4361 fi
4362
4363 if test "$build_libtool_libs" != yes; then
4364 if test -n "$gentop"; then
4365 $show "${rm}r $gentop"
4366 $run ${rm}r $gentop
4367 fi
4368
4369 # Create an invalid libtool object if no PIC, so that we don't
4370 # accidentally link it into a program.
4371 # $show "echo timestamp > $libobj"
4372 # $run eval "echo timestamp > $libobj" || exit $?
4373 exit $EXIT_SUCCESS
4374 fi
4375
4376 if test -n "$pic_flag" || test "$pic_mode" != default; then
4377 # Only do commands if we really have different PIC objects.
4378 reload_objs="$libobjs $reload_conv_objs"
4379 output="$libobj"
4380 cmds=$reload_cmds
4381 save_ifs="$IFS"; IFS='~'
4382 for cmd in $cmds; do
4383 IFS="$save_ifs"
4384 eval cmd=\"$cmd\"
4385 $show "$cmd"
4386 $run eval "$cmd" || exit $?
4387 done
4388 IFS="$save_ifs"
4389 fi
4390
4391 if test -n "$gentop"; then
4392 $show "${rm}r $gentop"
4393 $run ${rm}r $gentop
4394 fi
4395
4396 exit $EXIT_SUCCESS
4397 ;;
4398
4399 prog)
4400 case $host in
4401 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4402 esac
4403 if test -n "$vinfo"; then
4404 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4405 fi
4406
4407 if test -n "$release"; then
4408 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4409 fi
4410
4411 if test "$preload" = yes; then
4412 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4413 test "$dlopen_self_static" = unknown; then
4414 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4415 fi
4416 fi
4417
4418 case $host in
4419 *-*-rhapsody* | *-*-darwin1.[012])
4420 # On Rhapsody replace the C library is the System framework
4421 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4422 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4423 ;;
4424 esac
4425
4426 case $host in
4427 *darwin*)
4428 # Don't allow lazy linking, it breaks C++ global constructors
4429 if test "$tagname" = CXX ; then
4430 compile_command="$compile_command ${wl}-bind_at_load"
4431 finalize_command="$finalize_command ${wl}-bind_at_load"
4432 fi
4433 ;;
4434 esac
4435
4436
4437 # move library search paths that coincide with paths to not yet
4438 # installed libraries to the beginning of the library search list
4439 new_libs=
4440 for path in $notinst_path; do
4441 case " $new_libs " in
4442 *" -L$path/$objdir "*) ;;
4443 *)
4444 case " $compile_deplibs " in
4445 *" -L$path/$objdir "*)
4446 new_libs="$new_libs -L$path/$objdir" ;;
4447 esac
4448 ;;
4449 esac
4450 done
4451 for deplib in $compile_deplibs; do
4452 case $deplib in
4453 -L*)
4454 case " $new_libs " in
4455 *" $deplib "*) ;;
4456 *) new_libs="$new_libs $deplib" ;;
4457 esac
4458 ;;
4459 *) new_libs="$new_libs $deplib" ;;
4460 esac
4461 done
4462 compile_deplibs="$new_libs"
4463
4464
4465 compile_command="$compile_command $compile_deplibs"
4466 finalize_command="$finalize_command $finalize_deplibs"
4467
4468 if test -n "$rpath$xrpath"; then
4469 # If the user specified any rpath flags, then add them.
4470 for libdir in $rpath $xrpath; do
4471 # This is the magic to use -rpath.
4472 case "$finalize_rpath " in
4473 *" $libdir "*) ;;
4474 *) finalize_rpath="$finalize_rpath $libdir" ;;
4475 esac
4476 done
4477 fi
4478
4479 # Now hardcode the library paths
4480 rpath=
4481 hardcode_libdirs=
4482 for libdir in $compile_rpath $finalize_rpath; do
4483 if test -n "$hardcode_libdir_flag_spec"; then
4484 if test -n "$hardcode_libdir_separator"; then
4485 if test -z "$hardcode_libdirs"; then
4486 hardcode_libdirs="$libdir"
4487 else
4488 # Just accumulate the unique libdirs.
4489 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4490 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4491 ;;
4492 *)
4493 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4494 ;;
4495 esac
4496 fi
4497 else
4498 eval flag=\"$hardcode_libdir_flag_spec\"
4499 rpath="$rpath $flag"
4500 fi
4501 elif test -n "$runpath_var"; then
4502 case "$perm_rpath " in
4503 *" $libdir "*) ;;
4504 *) perm_rpath="$perm_rpath $libdir" ;;
4505 esac
4506 fi
4507 case $host in
4508 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4509 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4510 case :$dllsearchpath: in
4511 *":$libdir:"*) ;;
4512 *) dllsearchpath="$dllsearchpath:$libdir";;
4513 esac
4514 case :$dllsearchpath: in
4515 *":$testbindir:"*) ;;
4516 *) dllsearchpath="$dllsearchpath:$testbindir";;
4517 esac
4518 ;;
4519 esac
4520 done
4521 # Substitute the hardcoded libdirs into the rpath.
4522 if test -n "$hardcode_libdir_separator" &&
4523 test -n "$hardcode_libdirs"; then
4524 libdir="$hardcode_libdirs"
4525 eval rpath=\" $hardcode_libdir_flag_spec\"
4526 fi
4527 compile_rpath="$rpath"
4528
4529 rpath=
4530 hardcode_libdirs=
4531 for libdir in $finalize_rpath; do
4532 if test -n "$hardcode_libdir_flag_spec"; then
4533 if test -n "$hardcode_libdir_separator"; then
4534 if test -z "$hardcode_libdirs"; then
4535 hardcode_libdirs="$libdir"
4536 else
4537 # Just accumulate the unique libdirs.
4538 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4539 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4540 ;;
4541 *)
4542 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4543 ;;
4544 esac
4545 fi
4546 else
4547 eval flag=\"$hardcode_libdir_flag_spec\"
4548 rpath="$rpath $flag"
4549 fi
4550 elif test -n "$runpath_var"; then
4551 case "$finalize_perm_rpath " in
4552 *" $libdir "*) ;;
4553 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4554 esac
4555 fi
4556 done
4557 # Substitute the hardcoded libdirs into the rpath.
4558 if test -n "$hardcode_libdir_separator" &&
4559 test -n "$hardcode_libdirs"; then
4560 libdir="$hardcode_libdirs"
4561 eval rpath=\" $hardcode_libdir_flag_spec\"
4562 fi
4563 finalize_rpath="$rpath"
4564
4565 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4566 # Transform all the library objects into standard objects.
4567 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4568 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4569 fi
4570
4571 dlsyms=
4572 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4573 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4574 dlsyms="${outputname}S.c"
4575 else
4576 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4577 fi
4578 fi
4579
4580 if test -n "$dlsyms"; then
4581 case $dlsyms in
4582 "") ;;
4583 *.c)
4584 # Discover the nlist of each of the dlfiles.
4585 nlist="$output_objdir/${outputname}.nm"
4586
4587 $show "$rm $nlist ${nlist}S ${nlist}T"
4588 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4589
4590 # Parse the name list into a source file.
4591 $show "creating $output_objdir/$dlsyms"
4592
4593 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4594 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4595 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4596
4597 #ifdef __cplusplus
4598 extern \"C\" {
4599 #endif
4600
4601 /* Prevent the only kind of declaration conflicts we can make. */
4602 #define lt_preloaded_symbols some_other_symbol
4603
4604 /* External symbol declarations for the compiler. */\
4605 "
4606
4607 if test "$dlself" = yes; then
4608 $show "generating symbol list for \`$output'"
4609
4610 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4611
4612 # Add our own program objects to the symbol list.
4613 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4614 for arg in $progfiles; do
4615 $show "extracting global C symbols from \`$arg'"
4616 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4617 done
4618
4619 if test -n "$exclude_expsyms"; then
4620 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4621 $run eval '$mv "$nlist"T "$nlist"'
4622 fi
4623
4624 if test -n "$export_symbols_regex"; then
4625 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4626 $run eval '$mv "$nlist"T "$nlist"'
4627 fi
4628
4629 # Prepare the list of exported symbols
4630 if test -z "$export_symbols"; then
4631 export_symbols="$output_objdir/$outputname.exp"
4632 $run $rm $export_symbols
4633 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4634 case $host in
4635 *cygwin* | *mingw* )
4636 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4637 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4638 ;;
4639 esac
4640 else
4641 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4642 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4643 $run eval 'mv "$nlist"T "$nlist"'
4644 case $host in
4645 *cygwin* | *mingw* )
4646 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4647 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4648 ;;
4649 esac
4650 fi
4651 fi
4652
4653 for arg in $dlprefiles; do
4654 $show "extracting global C symbols from \`$arg'"
4655 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4656 $run eval '$echo ": $name " >> "$nlist"'
4657 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4658 done
4659
4660 if test -z "$run"; then
4661 # Make sure we have at least an empty file.
4662 test -f "$nlist" || : > "$nlist"
4663
4664 if test -n "$exclude_expsyms"; then
4665 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4666 $mv "$nlist"T "$nlist"
4667 fi
4668
4669 # Try sorting and uniquifying the output.
4670 if grep -v "^: " < "$nlist" |
4671 if sort -k 3 </dev/null >/dev/null 2>&1; then
4672 sort -k 3
4673 else
4674 sort +2
4675 fi |
4676 uniq > "$nlist"S; then
4677 :
4678 else
4679 grep -v "^: " < "$nlist" > "$nlist"S
4680 fi
4681
4682 if test -f "$nlist"S; then
4683 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4684 else
4685 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4686 fi
4687
4688 $echo >> "$output_objdir/$dlsyms" "\
4689
4690 #undef lt_preloaded_symbols
4691
4692 #if defined (__STDC__) && __STDC__
4693 # define lt_ptr void *
4694 #else
4695 # define lt_ptr char *
4696 # define const
4697 #endif
4698
4699 /* The mapping between symbol names and symbols. */
4700 "
4701
4702 case $host in
4703 *cygwin* | *mingw* )
4704 $echo >> "$output_objdir/$dlsyms" "\
4705 /* DATA imports from DLLs on WIN32 can't be const, because
4706 runtime relocations are performed -- see ld's documentation
4707 on pseudo-relocs */
4708 struct {
4709 "
4710 ;;
4711 * )
4712 $echo >> "$output_objdir/$dlsyms" "\
4713 const struct {
4714 "
4715 ;;
4716 esac
4717
4718
4719 $echo >> "$output_objdir/$dlsyms" "\
4720 const char *name;
4721 lt_ptr address;
4722 }
4723 lt_preloaded_symbols[] =
4724 {\
4725 "
4726
4727 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4728
4729 $echo >> "$output_objdir/$dlsyms" "\
4730 {0, (lt_ptr) 0}
4731 };
4732
4733 /* This works around a problem in FreeBSD linker */
4734 #ifdef FREEBSD_WORKAROUND
4735 static const void *lt_preloaded_setup() {
4736 return lt_preloaded_symbols;
4737 }
4738 #endif
4739
4740 #ifdef __cplusplus
4741 }
4742 #endif\
4743 "
4744 fi
4745
4746 pic_flag_for_symtable=
4747 case $host in
4748 # compiling the symbol table file with pic_flag works around
4749 # a FreeBSD bug that causes programs to crash when -lm is
4750 # linked before any other PIC object. But we must not use
4751 # pic_flag when linking with -static. The problem exists in
4752 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4753 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4754 case "$compile_command " in
4755 *" -static "*) ;;
4756 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4757 esac;;
4758 *-*-hpux*)
4759 case "$compile_command " in
4760 *" -static "*) ;;
4761 *) pic_flag_for_symtable=" $pic_flag";;
4762 esac
4763 esac
4764
4765 # Now compile the dynamic symbol file.
4766 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4767 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4768
4769 # Clean up the generated files.
4770 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4771 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4772
4773 # Transform the symbol file into the correct name.
4774 case $host in
4775 *cygwin* | *mingw* )
4776 if test -f "$output_objdir/${outputname}.def" ; then
4777 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4778 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4779 else
4780 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4781 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4782 fi
4783 ;;
4784 * )
4785 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4786 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4787 ;;
4788 esac
4789 ;;
4790 *)
4791 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4792 exit $EXIT_FAILURE
4793 ;;
4794 esac
4795 else
4796 # We keep going just in case the user didn't refer to
4797 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4798 # really was required.
4799
4800 # Nullify the symbol file.
4801 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4802 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4803 fi
4804
4805 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4806 # Replace the output file specification.
4807 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4808 link_command="$compile_command$compile_rpath"
4809
4810 # We have no uninstalled library dependencies, so finalize right now.
4811 $show "$link_command"
4812 $run eval "$link_command"
4813 exit_status=$?
4814
4815 # Delete the generated files.
4816 if test -n "$dlsyms"; then
4817 $show "$rm $output_objdir/${outputname}S.${objext}"
4818 $run $rm "$output_objdir/${outputname}S.${objext}"
4819 fi
4820
4821 exit $exit_status
4822 fi
4823
4824 if test -n "$shlibpath_var"; then
4825 # We should set the shlibpath_var
4826 rpath=
4827 for dir in $temp_rpath; do
4828 case $dir in
4829 [\\/]* | [A-Za-z]:[\\/]*)
4830 # Absolute path.
4831 rpath="$rpath$dir:"
4832 ;;
4833 *)
4834 # Relative path: add a thisdir entry.
4835 rpath="$rpath\$thisdir/$dir:"
4836 ;;
4837 esac
4838 done
4839 temp_rpath="$rpath"
4840 fi
4841
4842 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4843 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4844 fi
4845 if test -n "$finalize_shlibpath"; then
4846 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4847 fi
4848
4849 compile_var=
4850 finalize_var=
4851 if test -n "$runpath_var"; then
4852 if test -n "$perm_rpath"; then
4853 # We should set the runpath_var.
4854 rpath=
4855 for dir in $perm_rpath; do
4856 rpath="$rpath$dir:"
4857 done
4858 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4859 fi
4860 if test -n "$finalize_perm_rpath"; then
4861 # We should set the runpath_var.
4862 rpath=
4863 for dir in $finalize_perm_rpath; do
4864 rpath="$rpath$dir:"
4865 done
4866 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4867 fi
4868 fi
4869
4870 if test "$no_install" = yes; then
4871 # We don't need to create a wrapper script.
4872 link_command="$compile_var$compile_command$compile_rpath"
4873 # Replace the output file specification.
4874 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4875 # Delete the old output file.
4876 $run $rm $output
4877 # Link the executable and exit
4878 $show "$link_command"
4879 $run eval "$link_command" || exit $?
4880 exit $EXIT_SUCCESS
4881 fi
4882
4883 if test "$hardcode_action" = relink; then
4884 # Fast installation is not supported
4885 link_command="$compile_var$compile_command$compile_rpath"
4886 relink_command="$finalize_var$finalize_command$finalize_rpath"
4887
4888 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4889 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4890 else
4891 if test "$fast_install" != no; then
4892 link_command="$finalize_var$compile_command$finalize_rpath"
4893 if test "$fast_install" = yes; then
4894 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4895 else
4896 # fast_install is set to needless
4897 relink_command=
4898 fi
4899 else
4900 link_command="$compile_var$compile_command$compile_rpath"
4901 relink_command="$finalize_var$finalize_command$finalize_rpath"
4902 fi
4903 fi
4904
4905 # Replace the output file specification.
4906 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4907
4908 # Delete the old output files.
4909 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4910
4911 $show "$link_command"
4912 $run eval "$link_command" || exit $?
4913
4914 # Now create the wrapper script.
4915 $show "creating $output"
4916
4917 # Quote the relink command for shipping.
4918 if test -n "$relink_command"; then
4919 # Preserve any variables that may affect compiler behavior
4920 for var in $variables_saved_for_relink; do
4921 if eval test -z \"\${$var+set}\"; then
4922 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4923 elif eval var_value=\$$var; test -z "$var_value"; then
4924 relink_command="$var=; export $var; $relink_command"
4925 else
4926 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4927 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4928 fi
4929 done
4930 relink_command="(cd `pwd`; $relink_command)"
4931 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4932 fi
4933
4934 # Quote $echo for shipping.
4935 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4936 case $progpath in
4937 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4938 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4939 esac
4940 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4941 else
4942 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4943 fi
4944
4945 # Only actually do things if our run command is non-null.
4946 if test -z "$run"; then
4947 # win32 will think the script is a binary if it has
4948 # a .exe suffix, so we strip it off here.
4949 case $output in
4950 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4951 esac
4952 # test for cygwin because mv fails w/o .exe extensions
4953 case $host in
4954 *cygwin*)
4955 exeext=.exe
4956 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4957 *) exeext= ;;
4958 esac
4959 case $host in
4960 *cygwin* | *mingw* )
4961 output_name=`basename $output`
4962 output_path=`dirname $output`
4963 cwrappersource="$output_path/$objdir/lt-$output_name.c"
4964 cwrapper="$output_path/$output_name.exe"
4965 $rm $cwrappersource $cwrapper
4966 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4967
4968 cat > $cwrappersource <<EOF
4969
4970 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4971 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4972
4973 The $output program cannot be directly executed until all the libtool
4974 libraries that it depends on are installed.
4975
4976 This wrapper executable should never be moved out of the build directory.
4977 If it is, it will not operate correctly.
4978
4979 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4980 but could eventually absorb all of the scripts functionality and
4981 exec $objdir/$outputname directly.
4982 */
4983 EOF
4984 cat >> $cwrappersource<<"EOF"
4985 #include <stdio.h>
4986 #include <stdlib.h>
4987 #include <unistd.h>
4988 #include <malloc.h>
4989 #include <stdarg.h>
4990 #include <assert.h>
4991 #include <string.h>
4992 #include <ctype.h>
4993 #include <sys/stat.h>
4994
4995 #if defined(PATH_MAX)
4996 # define LT_PATHMAX PATH_MAX
4997 #elif defined(MAXPATHLEN)
4998 # define LT_PATHMAX MAXPATHLEN
4999 #else
5000 # define LT_PATHMAX 1024
5001 #endif
5002
5003 #ifndef DIR_SEPARATOR
5004 # define DIR_SEPARATOR '/'
5005 # define PATH_SEPARATOR ':'
5006 #endif
5007
5008 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5009 defined (__OS2__)
5010 # define HAVE_DOS_BASED_FILE_SYSTEM
5011 # ifndef DIR_SEPARATOR_2
5012 # define DIR_SEPARATOR_2 '\\'
5013 # endif
5014 # ifndef PATH_SEPARATOR_2
5015 # define PATH_SEPARATOR_2 ';'
5016 # endif
5017 #endif
5018
5019 #ifndef DIR_SEPARATOR_2
5020 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5021 #else /* DIR_SEPARATOR_2 */
5022 # define IS_DIR_SEPARATOR(ch) \
5023 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5024 #endif /* DIR_SEPARATOR_2 */
5025
5026 #ifndef PATH_SEPARATOR_2
5027 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5028 #else /* PATH_SEPARATOR_2 */
5029 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5030 #endif /* PATH_SEPARATOR_2 */
5031
5032 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5033 #define XFREE(stale) do { \
5034 if (stale) { free ((void *) stale); stale = 0; } \
5035 } while (0)
5036
5037 /* -DDEBUG is fairly common in CFLAGS. */
5038 #undef DEBUG
5039 #if defined DEBUGWRAPPER
5040 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5041 #else
5042 # define DEBUG(format, ...)
5043 #endif
5044
5045 const char *program_name = NULL;
5046
5047 void * xmalloc (size_t num);
5048 char * xstrdup (const char *string);
5049 const char * base_name (const char *name);
5050 char * find_executable(const char *wrapper);
5051 int check_executable(const char *path);
5052 char * strendzap(char *str, const char *pat);
5053 void lt_fatal (const char *message, ...);
5054
5055 int
5056 main (int argc, char *argv[])
5057 {
5058 char **newargz;
5059 int i;
5060
5061 program_name = (char *) xstrdup (base_name (argv[0]));
5062 DEBUG("(main) argv[0] : %s\n",argv[0]);
5063 DEBUG("(main) program_name : %s\n",program_name);
5064 newargz = XMALLOC(char *, argc+2);
5065 EOF
5066
5067 cat >> $cwrappersource <<EOF
5068 newargz[0] = (char *) xstrdup("$SHELL");
5069 EOF
5070
5071 cat >> $cwrappersource <<"EOF"
5072 newargz[1] = find_executable(argv[0]);
5073 if (newargz[1] == NULL)
5074 lt_fatal("Couldn't find %s", argv[0]);
5075 DEBUG("(main) found exe at : %s\n",newargz[1]);
5076 /* we know the script has the same name, without the .exe */
5077 /* so make sure newargz[1] doesn't end in .exe */
5078 strendzap(newargz[1],".exe");
5079 for (i = 1; i < argc; i++)
5080 newargz[i+1] = xstrdup(argv[i]);
5081 newargz[argc+1] = NULL;
5082
5083 for (i=0; i<argc+1; i++)
5084 {
5085 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5086 ;
5087 }
5088
5089 EOF
5090
5091 case $host_os in
5092 mingw*)
5093 cat >> $cwrappersource <<EOF
5094 execv("$SHELL",(char const **)newargz);
5095 EOF
5096 ;;
5097 *)
5098 cat >> $cwrappersource <<EOF
5099 execv("$SHELL",newargz);
5100 EOF
5101 ;;
5102 esac
5103
5104 cat >> $cwrappersource <<"EOF"
5105 return 127;
5106 }
5107
5108 void *
5109 xmalloc (size_t num)
5110 {
5111 void * p = (void *) malloc (num);
5112 if (!p)
5113 lt_fatal ("Memory exhausted");
5114
5115 return p;
5116 }
5117
5118 char *
5119 xstrdup (const char *string)
5120 {
5121 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5122 ;
5123 }
5124
5125 const char *
5126 base_name (const char *name)
5127 {
5128 const char *base;
5129
5130 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5131 /* Skip over the disk name in MSDOS pathnames. */
5132 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5133 name += 2;
5134 #endif
5135
5136 for (base = name; *name; name++)
5137 if (IS_DIR_SEPARATOR (*name))
5138 base = name + 1;
5139 return base;
5140 }
5141
5142 int
5143 check_executable(const char * path)
5144 {
5145 struct stat st;
5146
5147 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5148 if ((!path) || (!*path))
5149 return 0;
5150
5151 if ((stat (path, &st) >= 0) &&
5152 (
5153 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5154 #if defined (S_IXOTH)
5155 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5156 #endif
5157 #if defined (S_IXGRP)
5158 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5159 #endif
5160 ((st.st_mode & S_IXUSR) == S_IXUSR))
5161 )
5162 return 1;
5163 else
5164 return 0;
5165 }
5166
5167 /* Searches for the full path of the wrapper. Returns
5168 newly allocated full path name if found, NULL otherwise */
5169 char *
5170 find_executable (const char* wrapper)
5171 {
5172 int has_slash = 0;
5173 const char* p;
5174 const char* p_next;
5175 /* static buffer for getcwd */
5176 char tmp[LT_PATHMAX + 1];
5177 int tmp_len;
5178 char* concat_name;
5179
5180 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5181
5182 if ((wrapper == NULL) || (*wrapper == '\0'))
5183 return NULL;
5184
5185 /* Absolute path? */
5186 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5187 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5188 {
5189 concat_name = xstrdup (wrapper);
5190 if (check_executable(concat_name))
5191 return concat_name;
5192 XFREE(concat_name);
5193 }
5194 else
5195 {
5196 #endif
5197 if (IS_DIR_SEPARATOR (wrapper[0]))
5198 {
5199 concat_name = xstrdup (wrapper);
5200 if (check_executable(concat_name))
5201 return concat_name;
5202 XFREE(concat_name);
5203 }
5204 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5205 }
5206 #endif
5207
5208 for (p = wrapper; *p; p++)
5209 if (*p == '/')
5210 {
5211 has_slash = 1;
5212 break;
5213 }
5214 if (!has_slash)
5215 {
5216 /* no slashes; search PATH */
5217 const char* path = getenv ("PATH");
5218 if (path != NULL)
5219 {
5220 for (p = path; *p; p = p_next)
5221 {
5222 const char* q;
5223 size_t p_len;
5224 for (q = p; *q; q++)
5225 if (IS_PATH_SEPARATOR(*q))
5226 break;
5227 p_len = q - p;
5228 p_next = (*q == '\0' ? q : q + 1);
5229 if (p_len == 0)
5230 {
5231 /* empty path: current directory */
5232 if (getcwd (tmp, LT_PATHMAX) == NULL)
5233 lt_fatal ("getcwd failed");
5234 tmp_len = strlen(tmp);
5235 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5236 memcpy (concat_name, tmp, tmp_len);
5237 concat_name[tmp_len] = '/';
5238 strcpy (concat_name + tmp_len + 1, wrapper);
5239 }
5240 else
5241 {
5242 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5243 memcpy (concat_name, p, p_len);
5244 concat_name[p_len] = '/';
5245 strcpy (concat_name + p_len + 1, wrapper);
5246 }
5247 if (check_executable(concat_name))
5248 return concat_name;
5249 XFREE(concat_name);
5250 }
5251 }
5252 /* not found in PATH; assume curdir */
5253 }
5254 /* Relative path | not found in path: prepend cwd */
5255 if (getcwd (tmp, LT_PATHMAX) == NULL)
5256 lt_fatal ("getcwd failed");
5257 tmp_len = strlen(tmp);
5258 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5259 memcpy (concat_name, tmp, tmp_len);
5260 concat_name[tmp_len] = '/';
5261 strcpy (concat_name + tmp_len + 1, wrapper);
5262
5263 if (check_executable(concat_name))
5264 return concat_name;
5265 XFREE(concat_name);
5266 return NULL;
5267 }
5268
5269 char *
5270 strendzap(char *str, const char *pat)
5271 {
5272 size_t len, patlen;
5273
5274 assert(str != NULL);
5275 assert(pat != NULL);
5276
5277 len = strlen(str);
5278 patlen = strlen(pat);
5279
5280 if (patlen <= len)
5281 {
5282 str += len - patlen;
5283 if (strcmp(str, pat) == 0)
5284 *str = '\0';
5285 }
5286 return str;
5287 }
5288
5289 static void
5290 lt_error_core (int exit_status, const char * mode,
5291 const char * message, va_list ap)
5292 {
5293 fprintf (stderr, "%s: %s: ", program_name, mode);
5294 vfprintf (stderr, message, ap);
5295 fprintf (stderr, ".\n");
5296
5297 if (exit_status >= 0)
5298 exit (exit_status);
5299 }
5300
5301 void
5302 lt_fatal (const char *message, ...)
5303 {
5304 va_list ap;
5305 va_start (ap, message);
5306 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5307 va_end (ap);
5308 }
5309 EOF
5310 # we should really use a build-platform specific compiler
5311 # here, but OTOH, the wrappers (shell script and this C one)
5312 # are only useful if you want to execute the "real" binary.
5313 # Since the "real" binary is built for $host, then this
5314 # wrapper might as well be built for $host, too.
5315 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5316 ;;
5317 esac
5318 $rm $output
5319 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5320
5321 $echo > $output "\
5322 #! $SHELL
5323
5324 # $output - temporary wrapper script for $objdir/$outputname
5325 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5326 #
5327 # The $output program cannot be directly executed until all the libtool
5328 # libraries that it depends on are installed.
5329 #
5330 # This wrapper script should never be moved out of the build directory.
5331 # If it is, it will not operate correctly.
5332
5333 # Sed substitution that helps us do robust quoting. It backslashifies
5334 # metacharacters that are still active within double-quoted strings.
5335 Xsed='${SED} -e 1s/^X//'
5336 sed_quote_subst='$sed_quote_subst'
5337
5338 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5339 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5340 emulate sh
5341 NULLCMD=:
5342 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5343 # is contrary to our usage. Disable this feature.
5344 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5345 setopt NO_GLOB_SUBST
5346 else
5347 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5348 fi
5349 BIN_SH=xpg4; export BIN_SH # for Tru64
5350 DUALCASE=1; export DUALCASE # for MKS sh
5351
5352 # The HP-UX ksh and POSIX shell print the target directory to stdout
5353 # if CDPATH is set.
5354 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5355
5356 relink_command=\"$relink_command\"
5357
5358 # This environment variable determines our operation mode.
5359 if test \"\$libtool_install_magic\" = \"$magic\"; then
5360 # install mode needs the following variable:
5361 notinst_deplibs='$notinst_deplibs'
5362 else
5363 # When we are sourced in execute mode, \$file and \$echo are already set.
5364 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5365 echo=\"$qecho\"
5366 file=\"\$0\"
5367 # Make sure echo works.
5368 if test \"X\$1\" = X--no-reexec; then
5369 # Discard the --no-reexec flag, and continue.
5370 shift
5371 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5372 # Yippee, \$echo works!
5373 :
5374 else
5375 # Restart under the correct shell, and then maybe \$echo will work.
5376 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5377 fi
5378 fi\
5379 "
5380 $echo >> $output "\
5381
5382 # Find the directory that this script lives in.
5383 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5384 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5385
5386 # Follow symbolic links until we get to the real thisdir.
5387 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5388 while test -n \"\$file\"; do
5389 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5390
5391 # If there was a directory component, then change thisdir.
5392 if test \"x\$destdir\" != \"x\$file\"; then
5393 case \"\$destdir\" in
5394 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5395 *) thisdir=\"\$thisdir/\$destdir\" ;;
5396 esac
5397 fi
5398
5399 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5400 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5401 done
5402
5403 # Try to get the absolute directory name.
5404 absdir=\`cd \"\$thisdir\" && pwd\`
5405 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5406 "
5407
5408 if test "$fast_install" = yes; then
5409 $echo >> $output "\
5410 program=lt-'$outputname'$exeext
5411 progdir=\"\$thisdir/$objdir\"
5412
5413 if test ! -f \"\$progdir/\$program\" || \\
5414 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5415 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5416
5417 file=\"\$\$-\$program\"
5418
5419 if test ! -d \"\$progdir\"; then
5420 $mkdir \"\$progdir\"
5421 else
5422 $rm \"\$progdir/\$file\"
5423 fi"
5424
5425 $echo >> $output "\
5426
5427 # relink executable if necessary
5428 if test -n \"\$relink_command\"; then
5429 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5430 else
5431 $echo \"\$relink_command_output\" >&2
5432 $rm \"\$progdir/\$file\"
5433 exit $EXIT_FAILURE
5434 fi
5435 fi
5436
5437 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5438 { $rm \"\$progdir/\$program\";
5439 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5440 $rm \"\$progdir/\$file\"
5441 fi"
5442 else
5443 $echo >> $output "\
5444 program='$outputname'
5445 progdir=\"\$thisdir/$objdir\"
5446 "
5447 fi
5448
5449 $echo >> $output "\
5450
5451 if test -f \"\$progdir/\$program\"; then"
5452
5453 # Export our shlibpath_var if we have one.
5454 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5455 $echo >> $output "\
5456 # Add our own library path to $shlibpath_var
5457 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5458
5459 # Some systems cannot cope with colon-terminated $shlibpath_var
5460 # The second colon is a workaround for a bug in BeOS R4 sed
5461 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5462
5463 export $shlibpath_var
5464 "
5465 fi
5466
5467 # fixup the dll searchpath if we need to.
5468 if test -n "$dllsearchpath"; then
5469 $echo >> $output "\
5470 # Add the dll search path components to the executable PATH
5471 PATH=$dllsearchpath:\$PATH
5472 "
5473 fi
5474
5475 $echo >> $output "\
5476 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5477 # Run the actual program with our arguments.
5478 "
5479 case $host in
5480 # Backslashes separate directories on plain windows
5481 *-*-mingw | *-*-os2*)
5482 $echo >> $output "\
5483 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5484 "
5485 ;;
5486
5487 *)
5488 $echo >> $output "\
5489 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5490 "
5491 ;;
5492 esac
5493 $echo >> $output "\
5494 \$echo \"\$0: cannot exec \$program \$*\"
5495 exit $EXIT_FAILURE
5496 fi
5497 else
5498 # The program doesn't exist.
5499 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5500 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5501 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5502 exit $EXIT_FAILURE
5503 fi
5504 fi\
5505 "
5506 chmod +x $output
5507 fi
5508 exit $EXIT_SUCCESS
5509 ;;
5510 esac
5511
5512 # See if we need to build an old-fashioned archive.
5513 for oldlib in $oldlibs; do
5514
5515 if test "$build_libtool_libs" = convenience; then
5516 oldobjs="$libobjs_save"
5517 addlibs="$convenience"
5518 build_libtool_libs=no
5519 else
5520 if test "$build_libtool_libs" = module; then
5521 oldobjs="$libobjs_save"
5522 build_libtool_libs=no
5523 else
5524 oldobjs="$old_deplibs $non_pic_objects"
5525 fi
5526 addlibs="$old_convenience"
5527 fi
5528
5529 if test -n "$addlibs"; then
5530 gentop="$output_objdir/${outputname}x"
5531 generated="$generated $gentop"
5532
5533 func_extract_archives $gentop $addlibs
5534 oldobjs="$oldobjs $func_extract_archives_result"
5535 fi
5536
5537 # Do each command in the archive commands.
5538 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5539 cmds=$old_archive_from_new_cmds
5540 else
5541 # POSIX demands no paths to be encoded in archives. We have
5542 # to avoid creating archives with duplicate basenames if we
5543 # might have to extract them afterwards, e.g., when creating a
5544 # static archive out of a convenience library, or when linking
5545 # the entirety of a libtool archive into another (currently
5546 # not supported by libtool).
5547 if (for obj in $oldobjs
5548 do
5549 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5550 done | sort | sort -uc >/dev/null 2>&1); then
5551 :
5552 else
5553 $echo "copying selected object files to avoid basename conflicts..."
5554
5555 if test -z "$gentop"; then
5556 gentop="$output_objdir/${outputname}x"
5557 generated="$generated $gentop"
5558
5559 $show "${rm}r $gentop"
5560 $run ${rm}r "$gentop"
5561 $show "$mkdir $gentop"
5562 $run $mkdir "$gentop"
5563 exit_status=$?
5564 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5565 exit $exit_status
5566 fi
5567 fi
5568
5569 save_oldobjs=$oldobjs
5570 oldobjs=
5571 counter=1
5572 for obj in $save_oldobjs
5573 do
5574 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5575 case " $oldobjs " in
5576 " ") oldobjs=$obj ;;
5577 *[\ /]"$objbase "*)
5578 while :; do
5579 # Make sure we don't pick an alternate name that also
5580 # overlaps.
5581 newobj=lt$counter-$objbase
5582 counter=`expr $counter + 1`
5583 case " $oldobjs " in
5584 *[\ /]"$newobj "*) ;;
5585 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5586 esac
5587 done
5588 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5589 $run ln "$obj" "$gentop/$newobj" ||
5590 $run cp "$obj" "$gentop/$newobj"
5591 oldobjs="$oldobjs $gentop/$newobj"
5592 ;;
5593 *) oldobjs="$oldobjs $obj" ;;
5594 esac
5595 done
5596 fi
5597
5598 eval cmds=\"$old_archive_cmds\"
5599
5600 if len=`expr "X$cmds" : ".*"` &&
5601 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5602 cmds=$old_archive_cmds
5603 else
5604 # the command line is too long to link in one step, link in parts
5605 $echo "using piecewise archive linking..."
5606 save_RANLIB=$RANLIB
5607 RANLIB=:
5608 objlist=
5609 concat_cmds=
5610 save_oldobjs=$oldobjs
5611
5612 # Is there a better way of finding the last object in the list?
5613 for obj in $save_oldobjs
5614 do
5615 last_oldobj=$obj
5616 done
5617 for obj in $save_oldobjs
5618 do
5619 oldobjs="$objlist $obj"
5620 objlist="$objlist $obj"
5621 eval test_cmds=\"$old_archive_cmds\"
5622 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5623 test "$len" -le "$max_cmd_len"; then
5624 :
5625 else
5626 # the above command should be used before it gets too long
5627 oldobjs=$objlist
5628 if test "$obj" = "$last_oldobj" ; then
5629 RANLIB=$save_RANLIB
5630 fi
5631 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5632 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5633 objlist=
5634 fi
5635 done
5636 RANLIB=$save_RANLIB
5637 oldobjs=$objlist
5638 if test "X$oldobjs" = "X" ; then
5639 eval cmds=\"\$concat_cmds\"
5640 else
5641 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5642 fi
5643 fi
5644 fi
5645 save_ifs="$IFS"; IFS='~'
5646 for cmd in $cmds; do
5647 eval cmd=\"$cmd\"
5648 IFS="$save_ifs"
5649 $show "$cmd"
5650 $run eval "$cmd" || exit $?
5651 done
5652 IFS="$save_ifs"
5653 done
5654
5655 if test -n "$generated"; then
5656 $show "${rm}r$generated"
5657 $run ${rm}r$generated
5658 fi
5659
5660 # Now create the libtool archive.
5661 case $output in
5662 *.la)
5663 old_library=
5664 test "$build_old_libs" = yes && old_library="$libname.$libext"
5665 $show "creating $output"
5666
5667 # Preserve any variables that may affect compiler behavior
5668 for var in $variables_saved_for_relink; do
5669 if eval test -z \"\${$var+set}\"; then
5670 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5671 elif eval var_value=\$$var; test -z "$var_value"; then
5672 relink_command="$var=; export $var; $relink_command"
5673 else
5674 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5675 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5676 fi
5677 done
5678 # Quote the link command for shipping.
5679 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5680 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5681 if test "$hardcode_automatic" = yes ; then
5682 relink_command=
5683 fi
5684
5685
5686 # Only create the output if not a dry run.
5687 if test -z "$run"; then
5688 for installed in no yes; do
5689 if test "$installed" = yes; then
5690 if test -z "$install_libdir"; then
5691 break
5692 fi
5693 output="$output_objdir/$outputname"i
5694 # Replace all uninstalled libtool libraries with the installed ones
5695 newdependency_libs=
5696 for deplib in $dependency_libs; do
5697 case $deplib in
5698 *.la)
5699 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5700 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5701 if test -z "$libdir"; then
5702 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5703 exit $EXIT_FAILURE
5704 fi
5705 newdependency_libs="$newdependency_libs $libdir/$name"
5706 ;;
5707 *) newdependency_libs="$newdependency_libs $deplib" ;;
5708 esac
5709 done
5710 dependency_libs="$newdependency_libs"
5711 newdlfiles=
5712 for lib in $dlfiles; do
5713 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5714 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5715 if test -z "$libdir"; then
5716 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5717 exit $EXIT_FAILURE
5718 fi
5719 newdlfiles="$newdlfiles $libdir/$name"
5720 done
5721 dlfiles="$newdlfiles"
5722 newdlprefiles=
5723 for lib in $dlprefiles; do
5724 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5725 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5726 if test -z "$libdir"; then
5727 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5728 exit $EXIT_FAILURE
5729 fi
5730 newdlprefiles="$newdlprefiles $libdir/$name"
5731 done
5732 dlprefiles="$newdlprefiles"
5733 else
5734 newdlfiles=
5735 for lib in $dlfiles; do
5736 case $lib in
5737 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5738 *) abs=`pwd`"/$lib" ;;
5739 esac
5740 newdlfiles="$newdlfiles $abs"
5741 done
5742 dlfiles="$newdlfiles"
5743 newdlprefiles=
5744 for lib in $dlprefiles; do
5745 case $lib in
5746 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5747 *) abs=`pwd`"/$lib" ;;
5748 esac
5749 newdlprefiles="$newdlprefiles $abs"
5750 done
5751 dlprefiles="$newdlprefiles"
5752 fi
5753 $rm $output
5754 # place dlname in correct position for cygwin
5755 tdlname=$dlname
5756 case $host,$output,$installed,$module,$dlname in
5757 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5758 esac
5759 $echo > $output "\
5760 # $outputname - a libtool library file
5761 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5762 #
5763 # Please DO NOT delete this file!
5764 # It is necessary for linking the library.
5765
5766 # The name that we can dlopen(3).
5767 dlname='$tdlname'
5768
5769 # Names of this library.
5770 library_names='$library_names'
5771
5772 # The name of the static archive.
5773 old_library='$old_library'
5774
5775 # Libraries that this one depends upon.
5776 dependency_libs='$dependency_libs'
5777
5778 # Version information for $libname.
5779 current=$current
5780 age=$age
5781 revision=$revision
5782
5783 # Is this an already installed library?
5784 installed=$installed
5785
5786 # Should we warn about portability when linking against -modules?
5787 shouldnotlink=$module
5788
5789 # Files to dlopen/dlpreopen
5790 dlopen='$dlfiles'
5791 dlpreopen='$dlprefiles'
5792
5793 # Directory that this library needs to be installed in:
5794 libdir='$install_libdir'"
5795 if test "$installed" = no && test "$need_relink" = yes; then
5796 $echo >> $output "\
5797 relink_command=\"$relink_command\""
5798 fi
5799 done
5800 fi
5801
5802 # Do a symbolic link so that the libtool archive can be found in
5803 # LD_LIBRARY_PATH before the program is installed.
5804 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5805 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5806 ;;
5807 esac
5808 exit $EXIT_SUCCESS
5809 ;;
5810
5811 # libtool install mode
5812 install)
5813 modename="$modename: install"
5814
5815 # There may be an optional sh(1) argument at the beginning of
5816 # install_prog (especially on Windows NT).
5817 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5818 # Allow the use of GNU shtool's install command.
5819 $echo "X$nonopt" | grep shtool > /dev/null; then
5820 # Aesthetically quote it.
5821 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5822 case $arg in
5823 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5824 arg="\"$arg\""
5825 ;;
5826 esac
5827 install_prog="$arg "
5828 arg="$1"
5829 shift
5830 else
5831 install_prog=
5832 arg=$nonopt
5833 fi
5834
5835 # The real first argument should be the name of the installation program.
5836 # Aesthetically quote it.
5837 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5838 case $arg in
5839 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5840 arg="\"$arg\""
5841 ;;
5842 esac
5843 install_prog="$install_prog$arg"
5844
5845 # We need to accept at least all the BSD install flags.
5846 dest=
5847 files=
5848 opts=
5849 prev=
5850 install_type=
5851 isdir=no
5852 stripme=
5853 for arg
5854 do
5855 if test -n "$dest"; then
5856 files="$files $dest"
5857 dest=$arg
5858 continue
5859 fi
5860
5861 case $arg in
5862 -d) isdir=yes ;;
5863 -f)
5864 case " $install_prog " in
5865 *[\\\ /]cp\ *) ;;
5866 *) prev=$arg ;;
5867 esac
5868 ;;
5869 -g | -m | -o) prev=$arg ;;
5870 -s)
5871 stripme=" -s"
5872 continue
5873 ;;
5874 -*)
5875 ;;
5876 *)
5877 # If the previous option needed an argument, then skip it.
5878 if test -n "$prev"; then
5879 prev=
5880 else
5881 dest=$arg
5882 continue
5883 fi
5884 ;;
5885 esac
5886
5887 # Aesthetically quote the argument.
5888 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5889 case $arg in
5890 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5891 arg="\"$arg\""
5892 ;;
5893 esac
5894 install_prog="$install_prog $arg"
5895 done
5896
5897 if test -z "$install_prog"; then
5898 $echo "$modename: you must specify an install program" 1>&2
5899 $echo "$help" 1>&2
5900 exit $EXIT_FAILURE
5901 fi
5902
5903 if test -n "$prev"; then
5904 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5905 $echo "$help" 1>&2
5906 exit $EXIT_FAILURE
5907 fi
5908
5909 if test -z "$files"; then
5910 if test -z "$dest"; then
5911 $echo "$modename: no file or destination specified" 1>&2
5912 else
5913 $echo "$modename: you must specify a destination" 1>&2
5914 fi
5915 $echo "$help" 1>&2
5916 exit $EXIT_FAILURE
5917 fi
5918
5919 # Strip any trailing slash from the destination.
5920 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5921
5922 # Check to see that the destination is a directory.
5923 test -d "$dest" && isdir=yes
5924 if test "$isdir" = yes; then
5925 destdir="$dest"
5926 destname=
5927 else
5928 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5929 test "X$destdir" = "X$dest" && destdir=.
5930 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5931
5932 # Not a directory, so check to see that there is only one file specified.
5933 set dummy $files
5934 if test "$#" -gt 2; then
5935 $echo "$modename: \`$dest' is not a directory" 1>&2
5936 $echo "$help" 1>&2
5937 exit $EXIT_FAILURE
5938 fi
5939 fi
5940 case $destdir in
5941 [\\/]* | [A-Za-z]:[\\/]*) ;;
5942 *)
5943 for file in $files; do
5944 case $file in
5945 *.lo) ;;
5946 *)
5947 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5948 $echo "$help" 1>&2
5949 exit $EXIT_FAILURE
5950 ;;
5951 esac
5952 done
5953 ;;
5954 esac
5955
5956 # This variable tells wrapper scripts just to set variables rather
5957 # than running their programs.
5958 libtool_install_magic="$magic"
5959
5960 staticlibs=
5961 future_libdirs=
5962 current_libdirs=
5963 for file in $files; do
5964
5965 # Do each installation.
5966 case $file in
5967 *.$libext)
5968 # Do the static libraries later.
5969 staticlibs="$staticlibs $file"
5970 ;;
5971
5972 *.la)
5973 # Check to see that this really is a libtool archive.
5974 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5975 else
5976 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5977 $echo "$help" 1>&2
5978 exit $EXIT_FAILURE
5979 fi
5980
5981 library_names=
5982 old_library=
5983 relink_command=
5984 # If there is no directory component, then add one.
5985 case $file in
5986 */* | *\\*) . $file ;;
5987 *) . ./$file ;;
5988 esac
5989
5990 # Add the libdir to current_libdirs if it is the destination.
5991 if test "X$destdir" = "X$libdir"; then
5992 case "$current_libdirs " in
5993 *" $libdir "*) ;;
5994 *) current_libdirs="$current_libdirs $libdir" ;;
5995 esac
5996 else
5997 # Note the libdir as a future libdir.
5998 case "$future_libdirs " in
5999 *" $libdir "*) ;;
6000 *) future_libdirs="$future_libdirs $libdir" ;;
6001 esac
6002 fi
6003
6004 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6005 test "X$dir" = "X$file/" && dir=
6006 dir="$dir$objdir"
6007
6008 if test -n "$relink_command"; then
6009 # Determine the prefix the user has applied to our future dir.
6010 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6011
6012 # Don't allow the user to place us outside of our expected
6013 # location b/c this prevents finding dependent libraries that
6014 # are installed to the same prefix.
6015 # At present, this check doesn't affect windows .dll's that
6016 # are installed into $libdir/../bin (currently, that works fine)
6017 # but it's something to keep an eye on.
6018 if test "$inst_prefix_dir" = "$destdir"; then
6019 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6020 exit $EXIT_FAILURE
6021 fi
6022
6023 if test -n "$inst_prefix_dir"; then
6024 # Stick the inst_prefix_dir data into the link command.
6025 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6026 else
6027 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6028 fi
6029
6030 $echo "$modename: warning: relinking \`$file'" 1>&2
6031 $show "$relink_command"
6032 if $run eval "$relink_command"; then :
6033 else
6034 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6035 exit $EXIT_FAILURE
6036 fi
6037 fi
6038
6039 # See the names of the shared library.
6040 set dummy $library_names
6041 if test -n "$2"; then
6042 realname="$2"
6043 shift
6044 shift
6045
6046 srcname="$realname"
6047 test -n "$relink_command" && srcname="$realname"T
6048
6049 # Install the shared library and build the symlinks.
6050 $show "$install_prog $dir/$srcname $destdir/$realname"
6051 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6052 if test -n "$stripme" && test -n "$striplib"; then
6053 $show "$striplib $destdir/$realname"
6054 $run eval "$striplib $destdir/$realname" || exit $?
6055 fi
6056
6057 if test "$#" -gt 0; then
6058 # Delete the old symlinks, and create new ones.
6059 # Try `ln -sf' first, because the `ln' binary might depend on
6060 # the symlink we replace! Solaris /bin/ln does not understand -f,
6061 # so we also need to try rm && ln -s.
6062 for linkname
6063 do
6064 if test "$linkname" != "$realname"; then
6065 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6066 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6067 fi
6068 done
6069 fi
6070
6071 # Do each command in the postinstall commands.
6072 lib="$destdir/$realname"
6073 cmds=$postinstall_cmds
6074 save_ifs="$IFS"; IFS='~'
6075 for cmd in $cmds; do
6076 IFS="$save_ifs"
6077 eval cmd=\"$cmd\"
6078 $show "$cmd"
6079 $run eval "$cmd" || {
6080 lt_exit=$?
6081
6082 # Restore the uninstalled library and exit
6083 if test "$mode" = relink; then
6084 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6085 fi
6086
6087 exit $lt_exit
6088 }
6089 done
6090 IFS="$save_ifs"
6091 fi
6092
6093 # Install the pseudo-library for information purposes.
6094 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6095 instname="$dir/$name"i
6096 $show "$install_prog $instname $destdir/$name"
6097 $run eval "$install_prog $instname $destdir/$name" || exit $?
6098
6099 # Maybe install the static library, too.
6100 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6101 ;;
6102
6103 *.lo)
6104 # Install (i.e. copy) a libtool object.
6105
6106 # Figure out destination file name, if it wasn't already specified.
6107 if test -n "$destname"; then
6108 destfile="$destdir/$destname"
6109 else
6110 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6111 destfile="$destdir/$destfile"
6112 fi
6113
6114 # Deduce the name of the destination old-style object file.
6115 case $destfile in
6116 *.lo)
6117 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6118 ;;
6119 *.$objext)
6120 staticdest="$destfile"
6121 destfile=
6122 ;;
6123 *)
6124 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6125 $echo "$help" 1>&2
6126 exit $EXIT_FAILURE
6127 ;;
6128 esac
6129
6130 # Install the libtool object if requested.
6131 if test -n "$destfile"; then
6132 $show "$install_prog $file $destfile"
6133 $run eval "$install_prog $file $destfile" || exit $?
6134 fi
6135
6136 # Install the old object if enabled.
6137 if test "$build_old_libs" = yes; then
6138 # Deduce the name of the old-style object file.
6139 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6140
6141 $show "$install_prog $staticobj $staticdest"
6142 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6143 fi
6144 exit $EXIT_SUCCESS
6145 ;;
6146
6147 *)
6148 # Figure out destination file name, if it wasn't already specified.
6149 if test -n "$destname"; then
6150 destfile="$destdir/$destname"
6151 else
6152 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6153 destfile="$destdir/$destfile"
6154 fi
6155
6156 # If the file is missing, and there is a .exe on the end, strip it
6157 # because it is most likely a libtool script we actually want to
6158 # install
6159 stripped_ext=""
6160 case $file in
6161 *.exe)
6162 if test ! -f "$file"; then
6163 file=`$echo $file|${SED} 's,.exe$,,'`
6164 stripped_ext=".exe"
6165 fi
6166 ;;
6167 esac
6168
6169 # Do a test to see if this is really a libtool program.
6170 case $host in
6171 *cygwin*|*mingw*)
6172 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6173 ;;
6174 *)
6175 wrapper=$file
6176 ;;
6177 esac
6178 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6179 notinst_deplibs=
6180 relink_command=
6181
6182 # Note that it is not necessary on cygwin/mingw to append a dot to
6183 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6184 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6185 # `FILE.' does not work on cygwin managed mounts.
6186 #
6187 # If there is no directory component, then add one.
6188 case $wrapper in
6189 */* | *\\*) . ${wrapper} ;;
6190 *) . ./${wrapper} ;;
6191 esac
6192
6193 # Check the variables that should have been set.
6194 if test -z "$notinst_deplibs"; then
6195 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6196 exit $EXIT_FAILURE
6197 fi
6198
6199 finalize=yes
6200 for lib in $notinst_deplibs; do
6201 # Check to see that each library is installed.
6202 libdir=
6203 if test -f "$lib"; then
6204 # If there is no directory component, then add one.
6205 case $lib in
6206 */* | *\\*) . $lib ;;
6207 *) . ./$lib ;;
6208 esac
6209 fi
6210 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6211 if test -n "$libdir" && test ! -f "$libfile"; then
6212 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6213 finalize=no
6214 fi
6215 done
6216
6217 relink_command=
6218 # Note that it is not necessary on cygwin/mingw to append a dot to
6219 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6220 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6221 # `FILE.' does not work on cygwin managed mounts.
6222 #
6223 # If there is no directory component, then add one.
6224 case $wrapper in
6225 */* | *\\*) . ${wrapper} ;;
6226 *) . ./${wrapper} ;;
6227 esac
6228
6229 outputname=
6230 if test "$fast_install" = no && test -n "$relink_command"; then
6231 if test "$finalize" = yes && test -z "$run"; then
6232 tmpdir=`func_mktempdir`
6233 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6234 outputname="$tmpdir/$file"
6235 # Replace the output file specification.
6236 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6237
6238 $show "$relink_command"
6239 if $run eval "$relink_command"; then :
6240 else
6241 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6242 ${rm}r "$tmpdir"
6243 continue
6244 fi
6245 file="$outputname"
6246 else
6247 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6248 fi
6249 else
6250 # Install the binary that we compiled earlier.
6251 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6252 fi
6253 fi
6254
6255 # remove .exe since cygwin /usr/bin/install will append another
6256 # one anyway
6257 case $install_prog,$host in
6258 */usr/bin/install*,*cygwin*)
6259 case $file:$destfile in
6260 *.exe:*.exe)
6261 # this is ok
6262 ;;
6263 *.exe:*)
6264 destfile=$destfile.exe
6265 ;;
6266 *:*.exe)
6267 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6268 ;;
6269 esac
6270 ;;
6271 esac
6272 $show "$install_prog$stripme $file $destfile"
6273 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6274 test -n "$outputname" && ${rm}r "$tmpdir"
6275 ;;
6276 esac
6277 done
6278
6279 for file in $staticlibs; do
6280 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6281
6282 # Set up the ranlib parameters.
6283 oldlib="$destdir/$name"
6284
6285 $show "$install_prog $file $oldlib"
6286 $run eval "$install_prog \$file \$oldlib" || exit $?
6287
6288 if test -n "$stripme" && test -n "$old_striplib"; then
6289 $show "$old_striplib $oldlib"
6290 $run eval "$old_striplib $oldlib" || exit $?
6291 fi
6292
6293 # Do each command in the postinstall commands.
6294 cmds=$old_postinstall_cmds
6295 save_ifs="$IFS"; IFS='~'
6296 for cmd in $cmds; do
6297 IFS="$save_ifs"
6298 eval cmd=\"$cmd\"
6299 $show "$cmd"
6300 $run eval "$cmd" || exit $?
6301 done
6302 IFS="$save_ifs"
6303 done
6304
6305 if test -n "$future_libdirs"; then
6306 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6307 fi
6308
6309 if test -n "$current_libdirs"; then
6310 # Maybe just do a dry run.
6311 test -n "$run" && current_libdirs=" -n$current_libdirs"
6312 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6313 else
6314 exit $EXIT_SUCCESS
6315 fi
6316 ;;
6317
6318 # libtool finish mode
6319 finish)
6320 modename="$modename: finish"
6321 libdirs="$nonopt"
6322 admincmds=
6323
6324 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6325 for dir
6326 do
6327 libdirs="$libdirs $dir"
6328 done
6329
6330 for libdir in $libdirs; do
6331 if test -n "$finish_cmds"; then
6332 # Do each command in the finish commands.
6333 cmds=$finish_cmds
6334 save_ifs="$IFS"; IFS='~'
6335 for cmd in $cmds; do
6336 IFS="$save_ifs"
6337 eval cmd=\"$cmd\"
6338 $show "$cmd"
6339 $run eval "$cmd" || admincmds="$admincmds
6340 $cmd"
6341 done
6342 IFS="$save_ifs"
6343 fi
6344 if test -n "$finish_eval"; then
6345 # Do the single finish_eval.
6346 eval cmds=\"$finish_eval\"
6347 $run eval "$cmds" || admincmds="$admincmds
6348 $cmds"
6349 fi
6350 done
6351 fi
6352
6353 # Exit here if they wanted silent mode.
6354 test "$show" = : && exit $EXIT_SUCCESS
6355
6356 $echo "X----------------------------------------------------------------------" | $Xsed
6357 $echo "Libraries have been installed in:"
6358 for libdir in $libdirs; do
6359 $echo " $libdir"
6360 done
6361 $echo
6362 $echo "If you ever happen to want to link against installed libraries"
6363 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6364 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6365 $echo "flag during linking and do at least one of the following:"
6366 if test -n "$shlibpath_var"; then
6367 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6368 $echo " during execution"
6369 fi
6370 if test -n "$runpath_var"; then
6371 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6372 $echo " during linking"
6373 fi
6374 if test -n "$hardcode_libdir_flag_spec"; then
6375 libdir=LIBDIR
6376 eval flag=\"$hardcode_libdir_flag_spec\"
6377
6378 $echo " - use the \`$flag' linker flag"
6379 fi
6380 if test -n "$admincmds"; then
6381 $echo " - have your system administrator run these commands:$admincmds"
6382 fi
6383 if test -f /etc/ld.so.conf; then
6384 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6385 fi
6386 $echo
6387 $echo "See any operating system documentation about shared libraries for"
6388 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6389 $echo "X----------------------------------------------------------------------" | $Xsed
6390 exit $EXIT_SUCCESS
6391 ;;
6392
6393 # libtool execute mode
6394 execute)
6395 modename="$modename: execute"
6396
6397 # The first argument is the command name.
6398 cmd="$nonopt"
6399 if test -z "$cmd"; then
6400 $echo "$modename: you must specify a COMMAND" 1>&2
6401 $echo "$help"
6402 exit $EXIT_FAILURE
6403 fi
6404
6405 # Handle -dlopen flags immediately.
6406 for file in $execute_dlfiles; do
6407 if test ! -f "$file"; then
6408 $echo "$modename: \`$file' is not a file" 1>&2
6409 $echo "$help" 1>&2
6410 exit $EXIT_FAILURE
6411 fi
6412
6413 dir=
6414 case $file in
6415 *.la)
6416 # Check to see that this really is a libtool archive.
6417 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6418 else
6419 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6420 $echo "$help" 1>&2
6421 exit $EXIT_FAILURE
6422 fi
6423
6424 # Read the libtool library.
6425 dlname=
6426 library_names=
6427
6428 # If there is no directory component, then add one.
6429 case $file in
6430 */* | *\\*) . $file ;;
6431 *) . ./$file ;;
6432 esac
6433
6434 # Skip this library if it cannot be dlopened.
6435 if test -z "$dlname"; then
6436 # Warn if it was a shared library.
6437 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6438 continue
6439 fi
6440
6441 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6442 test "X$dir" = "X$file" && dir=.
6443
6444 if test -f "$dir/$objdir/$dlname"; then
6445 dir="$dir/$objdir"
6446 else
6447 if test ! -f "$dir/$dlname"; then
6448 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6449 exit $EXIT_FAILURE
6450 fi
6451 fi
6452 ;;
6453
6454 *.lo)
6455 # Just add the directory containing the .lo file.
6456 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6457 test "X$dir" = "X$file" && dir=.
6458 ;;
6459
6460 *)
6461 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6462 continue
6463 ;;
6464 esac
6465
6466 # Get the absolute pathname.
6467 absdir=`cd "$dir" && pwd`
6468 test -n "$absdir" && dir="$absdir"
6469
6470 # Now add the directory to shlibpath_var.
6471 if eval "test -z \"\$$shlibpath_var\""; then
6472 eval "$shlibpath_var=\"\$dir\""
6473 else
6474 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6475 fi
6476 done
6477
6478 # This variable tells wrapper scripts just to set shlibpath_var
6479 # rather than running their programs.
6480 libtool_execute_magic="$magic"
6481
6482 # Check if any of the arguments is a wrapper script.
6483 args=
6484 for file
6485 do
6486 case $file in
6487 -*) ;;
6488 *)
6489 # Do a test to see if this is really a libtool program.
6490 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6491 # If there is no directory component, then add one.
6492 case $file in
6493 */* | *\\*) . $file ;;
6494 *) . ./$file ;;
6495 esac
6496
6497 # Transform arg to wrapped name.
6498 file="$progdir/$program"
6499 fi
6500 ;;
6501 esac
6502 # Quote arguments (to preserve shell metacharacters).
6503 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6504 args="$args \"$file\""
6505 done
6506
6507 if test -z "$run"; then
6508 if test -n "$shlibpath_var"; then
6509 # Export the shlibpath_var.
6510 eval "export $shlibpath_var"
6511 fi
6512
6513 # Restore saved environment variables
6514 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6515 do
6516 eval "if test \"\${save_$lt_var+set}\" = set; then
6517 $lt_var=\$save_$lt_var; export $lt_var
6518 fi"
6519 done
6520
6521 # Now prepare to actually exec the command.
6522 exec_cmd="\$cmd$args"
6523 else
6524 # Display what would be done.
6525 if test -n "$shlibpath_var"; then
6526 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6527 $echo "export $shlibpath_var"
6528 fi
6529 $echo "$cmd$args"
6530 exit $EXIT_SUCCESS
6531 fi
6532 ;;
6533
6534 # libtool clean and uninstall mode
6535 clean | uninstall)
6536 modename="$modename: $mode"
6537 rm="$nonopt"
6538 files=
6539 rmforce=
6540 exit_status=0
6541
6542 # This variable tells wrapper scripts just to set variables rather
6543 # than running their programs.
6544 libtool_install_magic="$magic"
6545
6546 for arg
6547 do
6548 case $arg in
6549 -f) rm="$rm $arg"; rmforce=yes ;;
6550 -*) rm="$rm $arg" ;;
6551 *) files="$files $arg" ;;
6552 esac
6553 done
6554
6555 if test -z "$rm"; then
6556 $echo "$modename: you must specify an RM program" 1>&2
6557 $echo "$help" 1>&2
6558 exit $EXIT_FAILURE
6559 fi
6560
6561 rmdirs=
6562
6563 origobjdir="$objdir"
6564 for file in $files; do
6565 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6566 if test "X$dir" = "X$file"; then
6567 dir=.
6568 objdir="$origobjdir"
6569 else
6570 objdir="$dir/$origobjdir"
6571 fi
6572 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6573 test "$mode" = uninstall && objdir="$dir"
6574
6575 # Remember objdir for removal later, being careful to avoid duplicates
6576 if test "$mode" = clean; then
6577 case " $rmdirs " in
6578 *" $objdir "*) ;;
6579 *) rmdirs="$rmdirs $objdir" ;;
6580 esac
6581 fi
6582
6583 # Don't error if the file doesn't exist and rm -f was used.
6584 if (test -L "$file") >/dev/null 2>&1 \
6585 || (test -h "$file") >/dev/null 2>&1 \
6586 || test -f "$file"; then
6587 :
6588 elif test -d "$file"; then
6589 exit_status=1
6590 continue
6591 elif test "$rmforce" = yes; then
6592 continue
6593 fi
6594
6595 rmfiles="$file"
6596
6597 case $name in
6598 *.la)
6599 # Possibly a libtool archive, so verify it.
6600 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6601 . $dir/$name
6602
6603 # Delete the libtool libraries and symlinks.
6604 for n in $library_names; do
6605 rmfiles="$rmfiles $objdir/$n"
6606 done
6607 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6608
6609 case "$mode" in
6610 clean)
6611 case " $library_names " in
6612 # " " in the beginning catches empty $dlname
6613 *" $dlname "*) ;;
6614 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6615 esac
6616 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6617 ;;
6618 uninstall)
6619 if test -n "$library_names"; then
6620 # Do each command in the postuninstall commands.
6621 cmds=$postuninstall_cmds
6622 save_ifs="$IFS"; IFS='~'
6623 for cmd in $cmds; do
6624 IFS="$save_ifs"
6625 eval cmd=\"$cmd\"
6626 $show "$cmd"
6627 $run eval "$cmd"
6628 if test "$?" -ne 0 && test "$rmforce" != yes; then
6629 exit_status=1
6630 fi
6631 done
6632 IFS="$save_ifs"
6633 fi
6634
6635 if test -n "$old_library"; then
6636 # Do each command in the old_postuninstall commands.
6637 cmds=$old_postuninstall_cmds
6638 save_ifs="$IFS"; IFS='~'
6639 for cmd in $cmds; do
6640 IFS="$save_ifs"
6641 eval cmd=\"$cmd\"
6642 $show "$cmd"
6643 $run eval "$cmd"
6644 if test "$?" -ne 0 && test "$rmforce" != yes; then
6645 exit_status=1
6646 fi
6647 done
6648 IFS="$save_ifs"
6649 fi
6650 # FIXME: should reinstall the best remaining shared library.
6651 ;;
6652 esac
6653 fi
6654 ;;
6655
6656 *.lo)
6657 # Possibly a libtool object, so verify it.
6658 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6659
6660 # Read the .lo file
6661 . $dir/$name
6662
6663 # Add PIC object to the list of files to remove.
6664 if test -n "$pic_object" \
6665 && test "$pic_object" != none; then
6666 rmfiles="$rmfiles $dir/$pic_object"
6667 fi
6668
6669 # Add non-PIC object to the list of files to remove.
6670 if test -n "$non_pic_object" \
6671 && test "$non_pic_object" != none; then
6672 rmfiles="$rmfiles $dir/$non_pic_object"
6673 fi
6674 fi
6675 ;;
6676
6677 *)
6678 if test "$mode" = clean ; then
6679 noexename=$name
6680 case $file in
6681 *.exe)
6682 file=`$echo $file|${SED} 's,.exe$,,'`
6683 noexename=`$echo $name|${SED} 's,.exe$,,'`
6684 # $file with .exe has already been added to rmfiles,
6685 # add $file without .exe
6686 rmfiles="$rmfiles $file"
6687 ;;
6688 esac
6689 # Do a test to see if this is a libtool program.
6690 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6691 relink_command=
6692 . $dir/$noexename
6693
6694 # note $name still contains .exe if it was in $file originally
6695 # as does the version of $file that was added into $rmfiles
6696 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6697 if test "$fast_install" = yes && test -n "$relink_command"; then
6698 rmfiles="$rmfiles $objdir/lt-$name"
6699 fi
6700 if test "X$noexename" != "X$name" ; then
6701 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6702 fi
6703 fi
6704 fi
6705 ;;
6706 esac
6707 $show "$rm $rmfiles"
6708 $run $rm $rmfiles || exit_status=1
6709 done
6710 objdir="$origobjdir"
6711
6712 # Try to remove the ${objdir}s in the directories where we deleted files
6713 for dir in $rmdirs; do
6714 if test -d "$dir"; then
6715 $show "rmdir $dir"
6716 $run rmdir $dir >/dev/null 2>&1
6717 fi
6718 done
6719
6720 exit $exit_status
6721 ;;
6722
6723 "")
6724 $echo "$modename: you must specify a MODE" 1>&2
6725 $echo "$generic_help" 1>&2
6726 exit $EXIT_FAILURE
6727 ;;
6728 esac
6729
6730 if test -z "$exec_cmd"; then
6731 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6732 $echo "$generic_help" 1>&2
6733 exit $EXIT_FAILURE
6734 fi
6735 fi # test -z "$show_help"
6736
6737 if test -n "$exec_cmd"; then
6738 eval exec $exec_cmd
6739 exit $EXIT_FAILURE
6740 fi
6741
6742 # We need to display help for each of the modes.
6743 case $mode in
6744 "") $echo \
6745 "Usage: $modename [OPTION]... [MODE-ARG]...
6746
6747 Provide generalized library-building support services.
6748
6749 --config show all configuration variables
6750 --debug enable verbose shell tracing
6751 -n, --dry-run display commands without modifying any files
6752 --features display basic configuration information and exit
6753 --finish same as \`--mode=finish'
6754 --help display this help message and exit
6755 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6756 --quiet same as \`--silent'
6757 --silent don't print informational messages
6758 --tag=TAG use configuration variables from tag TAG
6759 --version print version information
6760
6761 MODE must be one of the following:
6762
6763 clean remove files from the build directory
6764 compile compile a source file into a libtool object
6765 execute automatically set library path, then run a program
6766 finish complete the installation of libtool libraries
6767 install install libraries or executables
6768 link create a library or an executable
6769 uninstall remove libraries from an installed directory
6770
6771 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6772 a more detailed description of MODE.
6773
6774 Report bugs to <bug-libtool@gnu.org>."
6775 exit $EXIT_SUCCESS
6776 ;;
6777
6778 clean)
6779 $echo \
6780 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6781
6782 Remove files from the build directory.
6783
6784 RM is the name of the program to use to delete files associated with each FILE
6785 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6786 to RM.
6787
6788 If FILE is a libtool library, object or program, all the files associated
6789 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6790 ;;
6791
6792 compile)
6793 $echo \
6794 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6795
6796 Compile a source file into a libtool library object.
6797
6798 This mode accepts the following additional options:
6799
6800 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6801 -prefer-pic try to building PIC objects only
6802 -prefer-non-pic try to building non-PIC objects only
6803 -static always build a \`.o' file suitable for static linking
6804
6805 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6806 from the given SOURCEFILE.
6807
6808 The output file name is determined by removing the directory component from
6809 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6810 library object suffix, \`.lo'."
6811 ;;
6812
6813 execute)
6814 $echo \
6815 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6816
6817 Automatically set library path, then run a program.
6818
6819 This mode accepts the following additional options:
6820
6821 -dlopen FILE add the directory containing FILE to the library path
6822
6823 This mode sets the library path environment variable according to \`-dlopen'
6824 flags.
6825
6826 If any of the ARGS are libtool executable wrappers, then they are translated
6827 into their corresponding uninstalled binary, and any of their required library
6828 directories are added to the library path.
6829
6830 Then, COMMAND is executed, with ARGS as arguments."
6831 ;;
6832
6833 finish)
6834 $echo \
6835 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6836
6837 Complete the installation of libtool libraries.
6838
6839 Each LIBDIR is a directory that contains libtool libraries.
6840
6841 The commands that this mode executes may require superuser privileges. Use
6842 the \`--dry-run' option if you just want to see what would be executed."
6843 ;;
6844
6845 install)
6846 $echo \
6847 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6848
6849 Install executables or libraries.
6850
6851 INSTALL-COMMAND is the installation command. The first component should be
6852 either the \`install' or \`cp' program.
6853
6854 The rest of the components are interpreted as arguments to that command (only
6855 BSD-compatible install options are recognized)."
6856 ;;
6857
6858 link)
6859 $echo \
6860 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6861
6862 Link object files or libraries together to form another library, or to
6863 create an executable program.
6864
6865 LINK-COMMAND is a command using the C compiler that you would use to create
6866 a program from several object files.
6867
6868 The following components of LINK-COMMAND are treated specially:
6869
6870 -all-static do not do any dynamic linking at all
6871 -avoid-version do not add a version suffix if possible
6872 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6873 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6874 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6875 -export-symbols SYMFILE
6876 try to export only the symbols listed in SYMFILE
6877 -export-symbols-regex REGEX
6878 try to export only the symbols matching REGEX
6879 -LLIBDIR search LIBDIR for required installed libraries
6880 -lNAME OUTPUT-FILE requires the installed library libNAME
6881 -module build a library that can dlopened
6882 -no-fast-install disable the fast-install mode
6883 -no-install link a not-installable executable
6884 -no-undefined declare that a library does not refer to external symbols
6885 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6886 -objectlist FILE Use a list of object files found in FILE to specify objects
6887 -precious-files-regex REGEX
6888 don't remove output files matching REGEX
6889 -release RELEASE specify package release information
6890 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6891 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6892 -static do not do any dynamic linking of uninstalled libtool libraries
6893 -static-libtool-libs
6894 do not do any dynamic linking of libtool libraries
6895 -version-info CURRENT[:REVISION[:AGE]]
6896 specify library version info [each variable defaults to 0]
6897
6898 All other options (arguments beginning with \`-') are ignored.
6899
6900 Every other argument is treated as a filename. Files ending in \`.la' are
6901 treated as uninstalled libtool libraries, other files are standard or library
6902 object files.
6903
6904 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6905 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6906 required, except when creating a convenience library.
6907
6908 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6909 using \`ar' and \`ranlib', or on Windows using \`lib'.
6910
6911 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6912 is created, otherwise an executable program is created."
6913 ;;
6914
6915 uninstall)
6916 $echo \
6917 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6918
6919 Remove libraries from an installation directory.
6920
6921 RM is the name of the program to use to delete files associated with each FILE
6922 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6923 to RM.
6924
6925 If FILE is a libtool library, all the files associated with it are deleted.
6926 Otherwise, only FILE itself is deleted using RM."
6927 ;;
6928
6929 *)
6930 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6931 $echo "$help" 1>&2
6932 exit $EXIT_FAILURE
6933 ;;
6934 esac
6935
6936 $echo
6937 $echo "Try \`$modename --help' for more information about other modes."
6938
6939 exit $?
6940
6941 # The TAGs below are defined such that we never get into a situation
6942 # in which we disable both kinds of libraries. Given conflicting
6943 # choices, we go for a static library, that is the most portable,
6944 # since we can't tell whether shared libraries were disabled because
6945 # the user asked for that or because the platform doesn't support
6946 # them. This is particularly important on AIX, because we don't
6947 # support having both static and shared libraries enabled at the same
6948 # time on that platform, so we default to a shared-only configuration.
6949 # If a disable-shared tag is given, we'll fallback to a static-only
6950 # configuration. But we'll never go from static-only to shared-only.
6951
6952 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6953 disable_libs=shared
6954 # ### END LIBTOOL TAG CONFIG: disable-shared
6955
6956 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6957 disable_libs=static
6958 # ### END LIBTOOL TAG CONFIG: disable-static
6959
6960 # Local Variables:
6961 # mode:shell-script
6962 # sh-indentation:2
6963 # End:
+0
-367
config/missing less more
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2006-05-10.23
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
6 # Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
28
29 if test $# -eq 0; then
30 echo 1>&2 "Try \`$0 --help' for more information"
31 exit 1
32 fi
33
34 run=:
35 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
36 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
37
38 # In the cases where this matters, `missing' is being run in the
39 # srcdir already.
40 if test -f configure.ac; then
41 configure_ac=configure.ac
42 else
43 configure_ac=configure.in
44 fi
45
46 msg="missing on your system"
47
48 case $1 in
49 --run)
50 # Try to run requested program, and just exit if it succeeds.
51 run=
52 shift
53 "$@" && exit 0
54 # Exit code 63 means version mismatch. This often happens
55 # when the user try to use an ancient version of a tool on
56 # a file that requires a minimum version. In this case we
57 # we should proceed has if the program had been absent, or
58 # if --run hadn't been passed.
59 if test $? = 63; then
60 run=:
61 msg="probably too old"
62 fi
63 ;;
64
65 -h|--h|--he|--hel|--help)
66 echo "\
67 $0 [OPTION]... PROGRAM [ARGUMENT]...
68
69 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
70 error status if there is no known handling for PROGRAM.
71
72 Options:
73 -h, --help display this help and exit
74 -v, --version output version information and exit
75 --run try to run the given command, and emulate it if it fails
76
77 Supported PROGRAM values:
78 aclocal touch file \`aclocal.m4'
79 autoconf touch file \`configure'
80 autoheader touch file \`config.h.in'
81 autom4te touch the output file, or create a stub one
82 automake touch all \`Makefile.in' files
83 bison create \`y.tab.[ch]', if possible, from existing .[ch]
84 flex create \`lex.yy.c', if possible, from existing .c
85 help2man touch the output file
86 lex create \`lex.yy.c', if possible, from existing .c
87 makeinfo touch the output file
88 tar try tar, gnutar, gtar, then tar without non-portable flags
89 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
90
91 Send bug reports to <bug-automake@gnu.org>."
92 exit $?
93 ;;
94
95 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
96 echo "missing $scriptversion (GNU Automake)"
97 exit $?
98 ;;
99
100 -*)
101 echo 1>&2 "$0: Unknown \`$1' option"
102 echo 1>&2 "Try \`$0 --help' for more information"
103 exit 1
104 ;;
105
106 esac
107
108 # Now exit if we have it, but it failed. Also exit now if we
109 # don't have it and --version was passed (most likely to detect
110 # the program).
111 case $1 in
112 lex|yacc)
113 # Not GNU programs, they don't have --version.
114 ;;
115
116 tar)
117 if test -n "$run"; then
118 echo 1>&2 "ERROR: \`tar' requires --run"
119 exit 1
120 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
121 exit 1
122 fi
123 ;;
124
125 *)
126 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
127 # We have it, but it failed.
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 # Could not run --version or --help. This is probably someone
131 # running `$TOOL --version' or `$TOOL --help' to check whether
132 # $TOOL exists and not knowing $TOOL uses missing.
133 exit 1
134 fi
135 ;;
136 esac
137
138 # If it does not exist, or fails to run (possibly an outdated version),
139 # try to emulate it.
140 case $1 in
141 aclocal*)
142 echo 1>&2 "\
143 WARNING: \`$1' is $msg. You should only need it if
144 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
145 to install the \`Automake' and \`Perl' packages. Grab them from
146 any GNU archive site."
147 touch aclocal.m4
148 ;;
149
150 autoconf)
151 echo 1>&2 "\
152 WARNING: \`$1' is $msg. You should only need it if
153 you modified \`${configure_ac}'. You might want to install the
154 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
155 archive site."
156 touch configure
157 ;;
158
159 autoheader)
160 echo 1>&2 "\
161 WARNING: \`$1' is $msg. You should only need it if
162 you modified \`acconfig.h' or \`${configure_ac}'. You might want
163 to install the \`Autoconf' and \`GNU m4' packages. Grab them
164 from any GNU archive site."
165 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
166 test -z "$files" && files="config.h"
167 touch_files=
168 for f in $files; do
169 case $f in
170 *:*) touch_files="$touch_files "`echo "$f" |
171 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
172 *) touch_files="$touch_files $f.in";;
173 esac
174 done
175 touch $touch_files
176 ;;
177
178 automake*)
179 echo 1>&2 "\
180 WARNING: \`$1' is $msg. You should only need it if
181 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
182 You might want to install the \`Automake' and \`Perl' packages.
183 Grab them from any GNU archive site."
184 find . -type f -name Makefile.am -print |
185 sed 's/\.am$/.in/' |
186 while read f; do touch "$f"; done
187 ;;
188
189 autom4te)
190 echo 1>&2 "\
191 WARNING: \`$1' is needed, but is $msg.
192 You might have modified some files without having the
193 proper tools for further handling them.
194 You can get \`$1' as part of \`Autoconf' from any GNU
195 archive site."
196
197 file=`echo "$*" | sed -n "$sed_output"`
198 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
199 if test -f "$file"; then
200 touch $file
201 else
202 test -z "$file" || exec >$file
203 echo "#! /bin/sh"
204 echo "# Created by GNU Automake missing as a replacement of"
205 echo "# $ $@"
206 echo "exit 0"
207 chmod +x $file
208 exit 1
209 fi
210 ;;
211
212 bison|yacc)
213 echo 1>&2 "\
214 WARNING: \`$1' $msg. You should only need it if
215 you modified a \`.y' file. You may need the \`Bison' package
216 in order for those modifications to take effect. You can get
217 \`Bison' from any GNU archive site."
218 rm -f y.tab.c y.tab.h
219 if test $# -ne 1; then
220 eval LASTARG="\${$#}"
221 case $LASTARG in
222 *.y)
223 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
224 if test -f "$SRCFILE"; then
225 cp "$SRCFILE" y.tab.c
226 fi
227 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
228 if test -f "$SRCFILE"; then
229 cp "$SRCFILE" y.tab.h
230 fi
231 ;;
232 esac
233 fi
234 if test ! -f y.tab.h; then
235 echo >y.tab.h
236 fi
237 if test ! -f y.tab.c; then
238 echo 'main() { return 0; }' >y.tab.c
239 fi
240 ;;
241
242 lex|flex)
243 echo 1>&2 "\
244 WARNING: \`$1' is $msg. You should only need it if
245 you modified a \`.l' file. You may need the \`Flex' package
246 in order for those modifications to take effect. You can get
247 \`Flex' from any GNU archive site."
248 rm -f lex.yy.c
249 if test $# -ne 1; then
250 eval LASTARG="\${$#}"
251 case $LASTARG in
252 *.l)
253 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
254 if test -f "$SRCFILE"; then
255 cp "$SRCFILE" lex.yy.c
256 fi
257 ;;
258 esac
259 fi
260 if test ! -f lex.yy.c; then
261 echo 'main() { return 0; }' >lex.yy.c
262 fi
263 ;;
264
265 help2man)
266 echo 1>&2 "\
267 WARNING: \`$1' is $msg. You should only need it if
268 you modified a dependency of a manual page. You may need the
269 \`Help2man' package in order for those modifications to take
270 effect. You can get \`Help2man' from any GNU archive site."
271
272 file=`echo "$*" | sed -n "$sed_output"`
273 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
274 if test -f "$file"; then
275 touch $file
276 else
277 test -z "$file" || exec >$file
278 echo ".ab help2man is required to generate this page"
279 exit 1
280 fi
281 ;;
282
283 makeinfo)
284 echo 1>&2 "\
285 WARNING: \`$1' is $msg. You should only need it if
286 you modified a \`.texi' or \`.texinfo' file, or any other file
287 indirectly affecting the aspect of the manual. The spurious
288 call might also be the consequence of using a buggy \`make' (AIX,
289 DU, IRIX). You might want to install the \`Texinfo' package or
290 the \`GNU make' package. Grab either from any GNU archive site."
291 # The file to touch is that specified with -o ...
292 file=`echo "$*" | sed -n "$sed_output"`
293 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
294 if test -z "$file"; then
295 # ... or it is the one specified with @setfilename ...
296 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
297 file=`sed -n '
298 /^@setfilename/{
299 s/.* \([^ ]*\) *$/\1/
300 p
301 q
302 }' $infile`
303 # ... or it is derived from the source name (dir/f.texi becomes f.info)
304 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
305 fi
306 # If the file does not exist, the user really needs makeinfo;
307 # let's fail without touching anything.
308 test -f $file || exit 1
309 touch $file
310 ;;
311
312 tar)
313 shift
314
315 # We have already tried tar in the generic part.
316 # Look for gnutar/gtar before invocation to avoid ugly error
317 # messages.
318 if (gnutar --version > /dev/null 2>&1); then
319 gnutar "$@" && exit 0
320 fi
321 if (gtar --version > /dev/null 2>&1); then
322 gtar "$@" && exit 0
323 fi
324 firstarg="$1"
325 if shift; then
326 case $firstarg in
327 *o*)
328 firstarg=`echo "$firstarg" | sed s/o//`
329 tar "$firstarg" "$@" && exit 0
330 ;;
331 esac
332 case $firstarg in
333 *h*)
334 firstarg=`echo "$firstarg" | sed s/h//`
335 tar "$firstarg" "$@" && exit 0
336 ;;
337 esac
338 fi
339
340 echo 1>&2 "\
341 WARNING: I can't seem to be able to run \`tar' with the given arguments.
342 You may want to install GNU tar or Free paxutils, or check the
343 command line arguments."
344 exit 1
345 ;;
346
347 *)
348 echo 1>&2 "\
349 WARNING: \`$1' is needed, and is $msg.
350 You might have modified some files without having the
351 proper tools for further handling them. Check the \`README' file,
352 it often tells you about the needed prerequisites for installing
353 this package. You may also peek at any GNU archive site, in case
354 some other package would contain this missing \`$1' program."
355 exit 1
356 ;;
357 esac
358
359 exit 0
360
361 # Local variables:
362 # eval: (add-hook 'write-file-hooks 'time-stamp)
363 # time-stamp-start: "scriptversion="
364 # time-stamp-format: "%:y-%02m-%02d.%02H"
365 # time-stamp-end: "$"
366 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-01-23'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner <per@bothner.com>.
30 # Please send patches to <config-patches@gnu.org>. Submit a context
31 # diff and a properly formatted ChangeLog entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # The plan is that this can be called by configure scripts if you
38 # don't specify an explicit build system type.
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
59 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60
61 This is free software; see the source for copying conditions. There is NO
62 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64 help="
65 Try \`$me --help' for more information."
66
67 # Parse command line
68 while test $# -gt 0 ; do
69 case $1 in
70 --time-stamp | --time* | -t )
71 echo "$timestamp" ; exit ;;
72 --version | -v )
73 echo "$version" ; exit ;;
74 --help | --h* | -h )
75 echo "$usage"; exit ;;
76 -- ) # Stop option processing
77 shift; break ;;
78 - ) # Use stdin as input.
79 break ;;
80 -* )
81 echo "$me: invalid option $1$help" >&2
82 exit 1 ;;
83 * )
84 break ;;
85 esac
86 done
87
88 if test $# != 0; then
89 echo "$me: too many arguments$help" >&2
90 exit 1
91 fi
92
93 trap 'exit 1' 1 2 15
94
95 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96 # compiler to aid in system detection is discouraged as it requires
97 # temporary files to be created and, as you can see below, it is a
98 # headache to deal with in a portable fashion.
99
100 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101 # use `HOST_CC' if defined, but it is deprecated.
102
103 # Portable tmp directory creation inspired by the Autoconf team.
104
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
129
130 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133 PATH=$PATH:/.attbin ; export PATH
134 fi
135
136 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141 # Note: order is significant - the case branches are not exclusive.
142
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old
149 # object file format. This provides both forward
150 # compatibility and a consistent mechanism for selecting the
151 # object file format.
152 #
153 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
159 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165 esac
166 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep __ELF__ >/dev/null
173 then
174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175 # Return netbsd for either. FIX?
176 os=netbsd
177 else
178 os=netbsdelf
179 fi
180 ;;
181 *)
182 os=netbsd
183 ;;
184 esac
185 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
191 Debian*)
192 release='-gnu'
193 ;;
194 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212 exit ;;
213 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215 exit ;;
216 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218 exit ;;
219 alpha:OSF1:*:*)
220 case $UNAME_RELEASE in
221 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223 ;;
224 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226 ;;
227 esac
228 # According to Compaq, /usr/sbin/psrinfo has been available on
229 # OSF/1 and Tru64 systems produced since 1995. I hope that
230 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in
234 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
236 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
240 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
242 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
244 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
246 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
248 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
250 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
252 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
254 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
260 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
262 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
264 esac
265 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
281 Amiga*:UNIX_System_V:4.0:*)
282 echo m68k-unknown-sysv4
283 exit ;;
284 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
286 exit ;;
287 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
289 exit ;;
290 *:OS/390:*:*)
291 echo i370-ibm-openedition
292 exit ;;
293 *:z/VM:*:*)
294 echo s390-ibm-zvmoe
295 exit ;;
296 *:OS400:*:*)
297 echo powerpc-ibm-os400
298 exit ;;
299 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
303 echo arm-unknown-riscos
304 exit ;;
305 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
306 echo hppa1.1-hitachi-hiuxmpp
307 exit ;;
308 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
309 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
310 if test "`(/bin/universe) 2>/dev/null`" = att ; then
311 echo pyramid-pyramid-sysv3
312 else
313 echo pyramid-pyramid-bsd
314 fi
315 exit ;;
316 NILE*:*:*:dcosx)
317 echo pyramid-pyramid-svr4
318 exit ;;
319 DRS?6000:unix:4.0:6*)
320 echo sparc-icl-nx6
321 exit ;;
322 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
323 case `/usr/bin/uname -p` in
324 sparc) echo sparc-icl-nx7; exit ;;
325 esac ;;
326 sun4H:SunOS:5.*:*)
327 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
328 exit ;;
329 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
330 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331 exit ;;
332 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
333 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334 exit ;;
335 sun4*:SunOS:6*:*)
336 # According to config.sub, this is the proper way to canonicalize
337 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
338 # it's likely to be more like Solaris than SunOS4.
339 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
340 exit ;;
341 sun4*:SunOS:*:*)
342 case "`/usr/bin/arch -k`" in
343 Series*|S4*)
344 UNAME_RELEASE=`uname -v`
345 ;;
346 esac
347 # Japanese Language versions have a version number like `4.1.3-JL'.
348 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
349 exit ;;
350 sun3*:SunOS:*:*)
351 echo m68k-sun-sunos${UNAME_RELEASE}
352 exit ;;
353 sun*:*:4.2BSD:*)
354 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
355 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
356 case "`/bin/arch`" in
357 sun3)
358 echo m68k-sun-sunos${UNAME_RELEASE}
359 ;;
360 sun4)
361 echo sparc-sun-sunos${UNAME_RELEASE}
362 ;;
363 esac
364 exit ;;
365 aushp:SunOS:*:*)
366 echo sparc-auspex-sunos${UNAME_RELEASE}
367 exit ;;
368 # The situation for MiNT is a little confusing. The machine name
369 # can be virtually everything (everything which is not
370 # "atarist" or "atariste" at least should have a processor
371 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
372 # to the lowercase version "mint" (or "freemint"). Finally
373 # the system name "TOS" denotes a system which is actually not
374 # MiNT. But MiNT is downward compatible to TOS, so this should
375 # be no problem.
376 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
377 echo m68k-atari-mint${UNAME_RELEASE}
378 exit ;;
379 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
380 echo m68k-atari-mint${UNAME_RELEASE}
381 exit ;;
382 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
383 echo m68k-atari-mint${UNAME_RELEASE}
384 exit ;;
385 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
386 echo m68k-milan-mint${UNAME_RELEASE}
387 exit ;;
388 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
389 echo m68k-hades-mint${UNAME_RELEASE}
390 exit ;;
391 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
392 echo m68k-unknown-mint${UNAME_RELEASE}
393 exit ;;
394 m68k:machten:*:*)
395 echo m68k-apple-machten${UNAME_RELEASE}
396 exit ;;
397 powerpc:machten:*:*)
398 echo powerpc-apple-machten${UNAME_RELEASE}
399 exit ;;
400 RISC*:Mach:*:*)
401 echo mips-dec-mach_bsd4.3
402 exit ;;
403 RISC*:ULTRIX:*:*)
404 echo mips-dec-ultrix${UNAME_RELEASE}
405 exit ;;
406 VAX*:ULTRIX*:*:*)
407 echo vax-dec-ultrix${UNAME_RELEASE}
408 exit ;;
409 2020:CLIX:*:* | 2430:CLIX:*:*)
410 echo clipper-intergraph-clix${UNAME_RELEASE}
411 exit ;;
412 mips:*:*:UMIPS | mips:*:*:RISCos)
413 eval $set_cc_for_build
414 sed 's/^ //' << EOF >$dummy.c
415 #ifdef __cplusplus
416 #include <stdio.h> /* for printf() prototype */
417 int main (int argc, char *argv[]) {
418 #else
419 int main (argc, argv) int argc; char *argv[]; {
420 #endif
421 #if defined (host_mips) && defined (MIPSEB)
422 #if defined (SYSTYPE_SYSV)
423 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
424 #endif
425 #if defined (SYSTYPE_SVR4)
426 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
427 #endif
428 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
429 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
430 #endif
431 #endif
432 exit (-1);
433 }
434 EOF
435 $CC_FOR_BUILD -o $dummy $dummy.c &&
436 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
437 SYSTEM_NAME=`$dummy $dummyarg` &&
438 { echo "$SYSTEM_NAME"; exit; }
439 echo mips-mips-riscos${UNAME_RELEASE}
440 exit ;;
441 Motorola:PowerMAX_OS:*:*)
442 echo powerpc-motorola-powermax
443 exit ;;
444 Motorola:*:4.3:PL8-*)
445 echo powerpc-harris-powermax
446 exit ;;
447 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
448 echo powerpc-harris-powermax
449 exit ;;
450 Night_Hawk:Power_UNIX:*:*)
451 echo powerpc-harris-powerunix
452 exit ;;
453 m88k:CX/UX:7*:*)
454 echo m88k-harris-cxux7
455 exit ;;
456 m88k:*:4*:R4*)
457 echo m88k-motorola-sysv4
458 exit ;;
459 m88k:*:3*:R3*)
460 echo m88k-motorola-sysv3
461 exit ;;
462 AViiON:dgux:*:*)
463 # DG/UX returns AViiON for all architectures
464 UNAME_PROCESSOR=`/usr/bin/uname -p`
465 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
466 then
467 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
468 [ ${TARGET_BINARY_INTERFACE}x = x ]
469 then
470 echo m88k-dg-dgux${UNAME_RELEASE}
471 else
472 echo m88k-dg-dguxbcs${UNAME_RELEASE}
473 fi
474 else
475 echo i586-dg-dgux${UNAME_RELEASE}
476 fi
477 exit ;;
478 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
479 echo m88k-dolphin-sysv3
480 exit ;;
481 M88*:*:R3*:*)
482 # Delta 88k system running SVR3
483 echo m88k-motorola-sysv3
484 exit ;;
485 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
486 echo m88k-tektronix-sysv3
487 exit ;;
488 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
489 echo m68k-tektronix-bsd
490 exit ;;
491 *:IRIX*:*:*)
492 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
493 exit ;;
494 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
495 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
496 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
497 i*86:AIX:*:*)
498 echo i386-ibm-aix
499 exit ;;
500 ia64:AIX:*:*)
501 if [ -x /usr/bin/oslevel ] ; then
502 IBM_REV=`/usr/bin/oslevel`
503 else
504 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
505 fi
506 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
507 exit ;;
508 *:AIX:2:3)
509 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
510 eval $set_cc_for_build
511 sed 's/^ //' << EOF >$dummy.c
512 #include <sys/systemcfg.h>
513
514 main()
515 {
516 if (!__power_pc())
517 exit(1);
518 puts("powerpc-ibm-aix3.2.5");
519 exit(0);
520 }
521 EOF
522 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
523 then
524 echo "$SYSTEM_NAME"
525 else
526 echo rs6000-ibm-aix3.2.5
527 fi
528 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
529 echo rs6000-ibm-aix3.2.4
530 else
531 echo rs6000-ibm-aix3.2
532 fi
533 exit ;;
534 *:AIX:*:[456])
535 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
536 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
537 IBM_ARCH=rs6000
538 else
539 IBM_ARCH=powerpc
540 fi
541 if [ -x /usr/bin/oslevel ] ; then
542 IBM_REV=`/usr/bin/oslevel`
543 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
547 exit ;;
548 *:AIX:*:*)
549 echo rs6000-ibm-aix
550 exit ;;
551 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
552 echo romp-ibm-bsd4.4
553 exit ;;
554 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
555 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
556 exit ;; # report: romp-ibm BSD 4.3
557 *:BOSX:*:*)
558 echo rs6000-bull-bosx
559 exit ;;
560 DPX/2?00:B.O.S.:*:*)
561 echo m68k-bull-sysv3
562 exit ;;
563 9000/[34]??:4.3bsd:1.*:*)
564 echo m68k-hp-bsd
565 exit ;;
566 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
567 echo m68k-hp-bsd4.4
568 exit ;;
569 9000/[34678]??:HP-UX:*:*)
570 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
571 case "${UNAME_MACHINE}" in
572 9000/31? ) HP_ARCH=m68000 ;;
573 9000/[34]?? ) HP_ARCH=m68k ;;
574 9000/[678][0-9][0-9])
575 if [ -x /usr/bin/getconf ]; then
576 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
577 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
578 case "${sc_cpu_version}" in
579 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
580 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
581 532) # CPU_PA_RISC2_0
582 case "${sc_kernel_bits}" in
583 32) HP_ARCH="hppa2.0n" ;;
584 64) HP_ARCH="hppa2.0w" ;;
585 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
586 esac ;;
587 esac
588 fi
589 if [ "${HP_ARCH}" = "" ]; then
590 eval $set_cc_for_build
591 sed 's/^ //' << EOF >$dummy.c
592
593 #define _HPUX_SOURCE
594 #include <stdlib.h>
595 #include <unistd.h>
596
597 int main ()
598 {
599 #if defined(_SC_KERNEL_BITS)
600 long bits = sysconf(_SC_KERNEL_BITS);
601 #endif
602 long cpu = sysconf (_SC_CPU_VERSION);
603
604 switch (cpu)
605 {
606 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
607 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
608 case CPU_PA_RISC2_0:
609 #if defined(_SC_KERNEL_BITS)
610 switch (bits)
611 {
612 case 64: puts ("hppa2.0w"); break;
613 case 32: puts ("hppa2.0n"); break;
614 default: puts ("hppa2.0"); break;
615 } break;
616 #else /* !defined(_SC_KERNEL_BITS) */
617 puts ("hppa2.0"); break;
618 #endif
619 default: puts ("hppa1.0"); break;
620 }
621 exit (0);
622 }
623 EOF
624 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
625 test -z "$HP_ARCH" && HP_ARCH=hppa
626 fi ;;
627 esac
628 if [ ${HP_ARCH} = "hppa2.0w" ]
629 then
630 eval $set_cc_for_build
631
632 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
633 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
634 # generating 64-bit code. GNU and HP use different nomenclature:
635 #
636 # $ CC_FOR_BUILD=cc ./config.guess
637 # => hppa2.0w-hp-hpux11.23
638 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
639 # => hppa64-hp-hpux11.23
640
641 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
642 grep __LP64__ >/dev/null
643 then
644 HP_ARCH="hppa2.0w"
645 else
646 HP_ARCH="hppa64"
647 fi
648 fi
649 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
650 exit ;;
651 ia64:HP-UX:*:*)
652 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
653 echo ia64-hp-hpux${HPUX_REV}
654 exit ;;
655 3050*:HI-UX:*:*)
656 eval $set_cc_for_build
657 sed 's/^ //' << EOF >$dummy.c
658 #include <unistd.h>
659 int
660 main ()
661 {
662 long cpu = sysconf (_SC_CPU_VERSION);
663 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
664 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
665 results, however. */
666 if (CPU_IS_PA_RISC (cpu))
667 {
668 switch (cpu)
669 {
670 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
671 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
672 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
673 default: puts ("hppa-hitachi-hiuxwe2"); break;
674 }
675 }
676 else if (CPU_IS_HP_MC68K (cpu))
677 puts ("m68k-hitachi-hiuxwe2");
678 else puts ("unknown-hitachi-hiuxwe2");
679 exit (0);
680 }
681 EOF
682 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
683 { echo "$SYSTEM_NAME"; exit; }
684 echo unknown-hitachi-hiuxwe2
685 exit ;;
686 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
687 echo hppa1.1-hp-bsd
688 exit ;;
689 9000/8??:4.3bsd:*:*)
690 echo hppa1.0-hp-bsd
691 exit ;;
692 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
693 echo hppa1.0-hp-mpeix
694 exit ;;
695 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
696 echo hppa1.1-hp-osf
697 exit ;;
698 hp8??:OSF1:*:*)
699 echo hppa1.0-hp-osf
700 exit ;;
701 i*86:OSF1:*:*)
702 if [ -x /usr/sbin/sysversion ] ; then
703 echo ${UNAME_MACHINE}-unknown-osf1mk
704 else
705 echo ${UNAME_MACHINE}-unknown-osf1
706 fi
707 exit ;;
708 parisc*:Lites*:*:*)
709 echo hppa1.1-hp-lites
710 exit ;;
711 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
712 echo c1-convex-bsd
713 exit ;;
714 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
715 if getsysinfo -f scalar_acc
716 then echo c32-convex-bsd
717 else echo c2-convex-bsd
718 fi
719 exit ;;
720 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
721 echo c34-convex-bsd
722 exit ;;
723 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
724 echo c38-convex-bsd
725 exit ;;
726 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
727 echo c4-convex-bsd
728 exit ;;
729 CRAY*Y-MP:*:*:*)
730 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
731 exit ;;
732 CRAY*[A-Z]90:*:*:*)
733 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
734 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
735 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
736 -e 's/\.[^.]*$/.X/'
737 exit ;;
738 CRAY*TS:*:*:*)
739 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
740 exit ;;
741 CRAY*T3E:*:*:*)
742 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
743 exit ;;
744 CRAY*SV1:*:*:*)
745 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
746 exit ;;
747 *:UNICOS/mp:*:*)
748 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
749 exit ;;
750 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
751 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
752 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
753 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
754 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
755 exit ;;
756 5000:UNIX_System_V:4.*:*)
757 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
758 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
759 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
760 exit ;;
761 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
762 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
763 exit ;;
764 sparc*:BSD/OS:*:*)
765 echo sparc-unknown-bsdi${UNAME_RELEASE}
766 exit ;;
767 *:BSD/OS:*:*)
768 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
769 exit ;;
770 *:FreeBSD:*:*)
771 case ${UNAME_MACHINE} in
772 pc98)
773 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
774 amd64)
775 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
776 *)
777 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
778 esac
779 exit ;;
780 i*:CYGWIN*:*)
781 echo ${UNAME_MACHINE}-pc-cygwin
782 exit ;;
783 *:MINGW*:*)
784 echo ${UNAME_MACHINE}-pc-mingw32
785 exit ;;
786 i*:windows32*:*)
787 # uname -m includes "-pc" on this system.
788 echo ${UNAME_MACHINE}-mingw32
789 exit ;;
790 i*:PW*:*)
791 echo ${UNAME_MACHINE}-pc-pw32
792 exit ;;
793 *:Interix*:[3456]*)
794 case ${UNAME_MACHINE} in
795 x86)
796 echo i586-pc-interix${UNAME_RELEASE}
797 exit ;;
798 EM64T | authenticamd)
799 echo x86_64-unknown-interix${UNAME_RELEASE}
800 exit ;;
801 IA64)
802 echo ia64-unknown-interix${UNAME_RELEASE}
803 exit ;;
804 esac ;;
805 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
806 echo i${UNAME_MACHINE}-pc-mks
807 exit ;;
808 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
809 # How do we know it's Interix rather than the generic POSIX subsystem?
810 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
811 # UNAME_MACHINE based on the output of uname instead of i386?
812 echo i586-pc-interix
813 exit ;;
814 i*:UWIN*:*)
815 echo ${UNAME_MACHINE}-pc-uwin
816 exit ;;
817 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
818 echo x86_64-unknown-cygwin
819 exit ;;
820 p*:CYGWIN*:*)
821 echo powerpcle-unknown-cygwin
822 exit ;;
823 prep*:SunOS:5.*:*)
824 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
825 exit ;;
826 *:GNU:*:*)
827 # the GNU system
828 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
829 exit ;;
830 *:GNU/*:*:*)
831 # other systems with GNU libc and userland
832 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
833 exit ;;
834 i*86:Minix:*:*)
835 echo ${UNAME_MACHINE}-pc-minix
836 exit ;;
837 arm*:Linux:*:*)
838 eval $set_cc_for_build
839 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
840 | grep -q __ARM_EABI__
841 then
842 echo ${UNAME_MACHINE}-unknown-linux-gnu
843 else
844 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
845 fi
846 exit ;;
847 avr32*:Linux:*:*)
848 echo ${UNAME_MACHINE}-unknown-linux-gnu
849 exit ;;
850 cris:Linux:*:*)
851 echo cris-axis-linux-gnu
852 exit ;;
853 crisv32:Linux:*:*)
854 echo crisv32-axis-linux-gnu
855 exit ;;
856 frv:Linux:*:*)
857 echo frv-unknown-linux-gnu
858 exit ;;
859 ia64:Linux:*:*)
860 echo ${UNAME_MACHINE}-unknown-linux-gnu
861 exit ;;
862 m32r*:Linux:*:*)
863 echo ${UNAME_MACHINE}-unknown-linux-gnu
864 exit ;;
865 m68*:Linux:*:*)
866 echo ${UNAME_MACHINE}-unknown-linux-gnu
867 exit ;;
868 mips:Linux:*:*)
869 eval $set_cc_for_build
870 sed 's/^ //' << EOF >$dummy.c
871 #undef CPU
872 #undef mips
873 #undef mipsel
874 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
875 CPU=mipsel
876 #else
877 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
878 CPU=mips
879 #else
880 CPU=
881 #endif
882 #endif
883 EOF
884 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
885 /^CPU/{
886 s: ::g
887 p
888 }'`"
889 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
890 ;;
891 mips64:Linux:*:*)
892 eval $set_cc_for_build
893 sed 's/^ //' << EOF >$dummy.c
894 #undef CPU
895 #undef mips64
896 #undef mips64el
897 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
898 CPU=mips64el
899 #else
900 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
901 CPU=mips64
902 #else
903 CPU=
904 #endif
905 #endif
906 EOF
907 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
908 /^CPU/{
909 s: ::g
910 p
911 }'`"
912 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
913 ;;
914 or32:Linux:*:*)
915 echo or32-unknown-linux-gnu
916 exit ;;
917 ppc:Linux:*:*)
918 echo powerpc-unknown-linux-gnu
919 exit ;;
920 ppc64:Linux:*:*)
921 echo powerpc64-unknown-linux-gnu
922 exit ;;
923 alpha:Linux:*:*)
924 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
925 EV5) UNAME_MACHINE=alphaev5 ;;
926 EV56) UNAME_MACHINE=alphaev56 ;;
927 PCA56) UNAME_MACHINE=alphapca56 ;;
928 PCA57) UNAME_MACHINE=alphapca56 ;;
929 EV6) UNAME_MACHINE=alphaev6 ;;
930 EV67) UNAME_MACHINE=alphaev67 ;;
931 EV68*) UNAME_MACHINE=alphaev68 ;;
932 esac
933 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
934 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
935 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
936 exit ;;
937 parisc:Linux:*:* | hppa:Linux:*:*)
938 # Look for CPU level
939 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
940 PA7*) echo hppa1.1-unknown-linux-gnu ;;
941 PA8*) echo hppa2.0-unknown-linux-gnu ;;
942 *) echo hppa-unknown-linux-gnu ;;
943 esac
944 exit ;;
945 parisc64:Linux:*:* | hppa64:Linux:*:*)
946 echo hppa64-unknown-linux-gnu
947 exit ;;
948 s390:Linux:*:* | s390x:Linux:*:*)
949 echo ${UNAME_MACHINE}-ibm-linux
950 exit ;;
951 sh64*:Linux:*:*)
952 echo ${UNAME_MACHINE}-unknown-linux-gnu
953 exit ;;
954 sh*:Linux:*:*)
955 echo ${UNAME_MACHINE}-unknown-linux-gnu
956 exit ;;
957 sparc:Linux:*:* | sparc64:Linux:*:*)
958 echo ${UNAME_MACHINE}-unknown-linux-gnu
959 exit ;;
960 vax:Linux:*:*)
961 echo ${UNAME_MACHINE}-dec-linux-gnu
962 exit ;;
963 x86_64:Linux:*:*)
964 echo x86_64-unknown-linux-gnu
965 exit ;;
966 xtensa*:Linux:*:*)
967 echo ${UNAME_MACHINE}-unknown-linux-gnu
968 exit ;;
969 i*86:Linux:*:*)
970 # The BFD linker knows what the default object file format is, so
971 # first see if it will tell us. cd to the root directory to prevent
972 # problems with other programs or directories called `ld' in the path.
973 # Set LC_ALL=C to ensure ld outputs messages in English.
974 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
975 | sed -ne '/supported targets:/!d
976 s/[ ][ ]*/ /g
977 s/.*supported targets: *//
978 s/ .*//
979 p'`
980 case "$ld_supported_targets" in
981 elf32-i386)
982 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
983 ;;
984 a.out-i386-linux)
985 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
986 exit ;;
987 coff-i386)
988 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
989 exit ;;
990 "")
991 # Either a pre-BFD a.out linker (linux-gnuoldld) or
992 # one that does not give us useful --help.
993 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
994 exit ;;
995 esac
996 # Determine whether the default compiler is a.out or elf
997 eval $set_cc_for_build
998 sed 's/^ //' << EOF >$dummy.c
999 #include <features.h>
1000 #ifdef __ELF__
1001 # ifdef __GLIBC__
1002 # if __GLIBC__ >= 2
1003 LIBC=gnu
1004 # else
1005 LIBC=gnulibc1
1006 # endif
1007 # else
1008 LIBC=gnulibc1
1009 # endif
1010 #else
1011 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1012 LIBC=gnu
1013 #else
1014 LIBC=gnuaout
1015 #endif
1016 #endif
1017 #ifdef __dietlibc__
1018 LIBC=dietlibc
1019 #endif
1020 EOF
1021 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1022 /^LIBC/{
1023 s: ::g
1024 p
1025 }'`"
1026 test x"${LIBC}" != x && {
1027 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1028 exit
1029 }
1030 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1031 ;;
1032 i*86:DYNIX/ptx:4*:*)
1033 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1034 # earlier versions are messed up and put the nodename in both
1035 # sysname and nodename.
1036 echo i386-sequent-sysv4
1037 exit ;;
1038 i*86:UNIX_SV:4.2MP:2.*)
1039 # Unixware is an offshoot of SVR4, but it has its own version
1040 # number series starting with 2...
1041 # I am not positive that other SVR4 systems won't match this,
1042 # I just have to hope. -- rms.
1043 # Use sysv4.2uw... so that sysv4* matches it.
1044 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1045 exit ;;
1046 i*86:OS/2:*:*)
1047 # If we were able to find `uname', then EMX Unix compatibility
1048 # is probably installed.
1049 echo ${UNAME_MACHINE}-pc-os2-emx
1050 exit ;;
1051 i*86:XTS-300:*:STOP)
1052 echo ${UNAME_MACHINE}-unknown-stop
1053 exit ;;
1054 i*86:atheos:*:*)
1055 echo ${UNAME_MACHINE}-unknown-atheos
1056 exit ;;
1057 i*86:syllable:*:*)
1058 echo ${UNAME_MACHINE}-pc-syllable
1059 exit ;;
1060 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1061 echo i386-unknown-lynxos${UNAME_RELEASE}
1062 exit ;;
1063 i*86:*DOS:*:*)
1064 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1065 exit ;;
1066 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1067 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1068 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1069 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1070 else
1071 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1072 fi
1073 exit ;;
1074 i*86:*:5:[678]*)
1075 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1076 case `/bin/uname -X | grep "^Machine"` in
1077 *486*) UNAME_MACHINE=i486 ;;
1078 *Pentium) UNAME_MACHINE=i586 ;;
1079 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1080 esac
1081 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1082 exit ;;
1083 i*86:*:3.2:*)
1084 if test -f /usr/options/cb.name; then
1085 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1086 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1087 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1088 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1089 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1090 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1091 && UNAME_MACHINE=i586
1092 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1093 && UNAME_MACHINE=i686
1094 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1095 && UNAME_MACHINE=i686
1096 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1097 else
1098 echo ${UNAME_MACHINE}-pc-sysv32
1099 fi
1100 exit ;;
1101 pc:*:*:*)
1102 # Left here for compatibility:
1103 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1104 # the processor, so we play safe by assuming i386.
1105 echo i386-pc-msdosdjgpp
1106 exit ;;
1107 Intel:Mach:3*:*)
1108 echo i386-pc-mach3
1109 exit ;;
1110 paragon:*:*:*)
1111 echo i860-intel-osf1
1112 exit ;;
1113 i860:*:4.*:*) # i860-SVR4
1114 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1115 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1116 else # Add other i860-SVR4 vendors below as they are discovered.
1117 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1118 fi
1119 exit ;;
1120 mini*:CTIX:SYS*5:*)
1121 # "miniframe"
1122 echo m68010-convergent-sysv
1123 exit ;;
1124 mc68k:UNIX:SYSTEM5:3.51m)
1125 echo m68k-convergent-sysv
1126 exit ;;
1127 M680?0:D-NIX:5.3:*)
1128 echo m68k-diab-dnix
1129 exit ;;
1130 M68*:*:R3V[5678]*:*)
1131 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1132 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)
1133 OS_REL=''
1134 test -r /etc/.relid \
1135 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1136 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1137 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1138 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1139 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1140 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1141 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1142 && { echo i486-ncr-sysv4; exit; } ;;
1143 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1144 echo m68k-unknown-lynxos${UNAME_RELEASE}
1145 exit ;;
1146 mc68030:UNIX_System_V:4.*:*)
1147 echo m68k-atari-sysv4
1148 exit ;;
1149 TSUNAMI:LynxOS:2.*:*)
1150 echo sparc-unknown-lynxos${UNAME_RELEASE}
1151 exit ;;
1152 rs6000:LynxOS:2.*:*)
1153 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1154 exit ;;
1155 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1156 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1157 exit ;;
1158 SM[BE]S:UNIX_SV:*:*)
1159 echo mips-dde-sysv${UNAME_RELEASE}
1160 exit ;;
1161 RM*:ReliantUNIX-*:*:*)
1162 echo mips-sni-sysv4
1163 exit ;;
1164 RM*:SINIX-*:*:*)
1165 echo mips-sni-sysv4
1166 exit ;;
1167 *:SINIX-*:*:*)
1168 if uname -p 2>/dev/null >/dev/null ; then
1169 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1170 echo ${UNAME_MACHINE}-sni-sysv4
1171 else
1172 echo ns32k-sni-sysv
1173 fi
1174 exit ;;
1175 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1176 # says <Richard.M.Bartel@ccMail.Census.GOV>
1177 echo i586-unisys-sysv4
1178 exit ;;
1179 *:UNIX_System_V:4*:FTX*)
1180 # From Gerald Hewes <hewes@openmarket.com>.
1181 # How about differentiating between stratus architectures? -djm
1182 echo hppa1.1-stratus-sysv4
1183 exit ;;
1184 *:*:*:FTX*)
1185 # From seanf@swdc.stratus.com.
1186 echo i860-stratus-sysv4
1187 exit ;;
1188 i*86:VOS:*:*)
1189 # From Paul.Green@stratus.com.
1190 echo ${UNAME_MACHINE}-stratus-vos
1191 exit ;;
1192 *:VOS:*:*)
1193 # From Paul.Green@stratus.com.
1194 echo hppa1.1-stratus-vos
1195 exit ;;
1196 mc68*:A/UX:*:*)
1197 echo m68k-apple-aux${UNAME_RELEASE}
1198 exit ;;
1199 news*:NEWS-OS:6*:*)
1200 echo mips-sony-newsos6
1201 exit ;;
1202 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1203 if [ -d /usr/nec ]; then
1204 echo mips-nec-sysv${UNAME_RELEASE}
1205 else
1206 echo mips-unknown-sysv${UNAME_RELEASE}
1207 fi
1208 exit ;;
1209 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1210 echo powerpc-be-beos
1211 exit ;;
1212 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1213 echo powerpc-apple-beos
1214 exit ;;
1215 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1216 echo i586-pc-beos
1217 exit ;;
1218 SX-4:SUPER-UX:*:*)
1219 echo sx4-nec-superux${UNAME_RELEASE}
1220 exit ;;
1221 SX-5:SUPER-UX:*:*)
1222 echo sx5-nec-superux${UNAME_RELEASE}
1223 exit ;;
1224 SX-6:SUPER-UX:*:*)
1225 echo sx6-nec-superux${UNAME_RELEASE}
1226 exit ;;
1227 SX-7:SUPER-UX:*:*)
1228 echo sx7-nec-superux${UNAME_RELEASE}
1229 exit ;;
1230 SX-8:SUPER-UX:*:*)
1231 echo sx8-nec-superux${UNAME_RELEASE}
1232 exit ;;
1233 SX-8R:SUPER-UX:*:*)
1234 echo sx8r-nec-superux${UNAME_RELEASE}
1235 exit ;;
1236 Power*:Rhapsody:*:*)
1237 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1238 exit ;;
1239 *:Rhapsody:*:*)
1240 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1241 exit ;;
1242 *:Darwin:*:*)
1243 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1244 case $UNAME_PROCESSOR in
1245 unknown) UNAME_PROCESSOR=powerpc ;;
1246 esac
1247 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1248 exit ;;
1249 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1250 UNAME_PROCESSOR=`uname -p`
1251 if test "$UNAME_PROCESSOR" = "x86"; then
1252 UNAME_PROCESSOR=i386
1253 UNAME_MACHINE=pc
1254 fi
1255 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1256 exit ;;
1257 *:QNX:*:4*)
1258 echo i386-pc-qnx
1259 exit ;;
1260 NSE-?:NONSTOP_KERNEL:*:*)
1261 echo nse-tandem-nsk${UNAME_RELEASE}
1262 exit ;;
1263 NSR-?:NONSTOP_KERNEL:*:*)
1264 echo nsr-tandem-nsk${UNAME_RELEASE}
1265 exit ;;
1266 *:NonStop-UX:*:*)
1267 echo mips-compaq-nonstopux
1268 exit ;;
1269 BS2000:POSIX*:*:*)
1270 echo bs2000-siemens-sysv
1271 exit ;;
1272 DS/*:UNIX_System_V:*:*)
1273 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1274 exit ;;
1275 *:Plan9:*:*)
1276 # "uname -m" is not consistent, so use $cputype instead. 386
1277 # is converted to i386 for consistency with other x86
1278 # operating systems.
1279 if test "$cputype" = "386"; then
1280 UNAME_MACHINE=i386
1281 else
1282 UNAME_MACHINE="$cputype"
1283 fi
1284 echo ${UNAME_MACHINE}-unknown-plan9
1285 exit ;;
1286 *:TOPS-10:*:*)
1287 echo pdp10-unknown-tops10
1288 exit ;;
1289 *:TENEX:*:*)
1290 echo pdp10-unknown-tenex
1291 exit ;;
1292 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1293 echo pdp10-dec-tops20
1294 exit ;;
1295 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1296 echo pdp10-xkl-tops20
1297 exit ;;
1298 *:TOPS-20:*:*)
1299 echo pdp10-unknown-tops20
1300 exit ;;
1301 *:ITS:*:*)
1302 echo pdp10-unknown-its
1303 exit ;;
1304 SEI:*:*:SEIUX)
1305 echo mips-sei-seiux${UNAME_RELEASE}
1306 exit ;;
1307 *:DragonFly:*:*)
1308 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1309 exit ;;
1310 *:*VMS:*:*)
1311 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1312 case "${UNAME_MACHINE}" in
1313 A*) echo alpha-dec-vms ; exit ;;
1314 I*) echo ia64-dec-vms ; exit ;;
1315 V*) echo vax-dec-vms ; exit ;;
1316 esac ;;
1317 *:XENIX:*:SysV)
1318 echo i386-pc-xenix
1319 exit ;;
1320 i*86:skyos:*:*)
1321 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1322 exit ;;
1323 i*86:rdos:*:*)
1324 echo ${UNAME_MACHINE}-pc-rdos
1325 exit ;;
1326 esac
1327
1328 #echo '(No uname command or uname output not recognized.)' 1>&2
1329 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1330
1331 eval $set_cc_for_build
1332 cat >$dummy.c <<EOF
1333 #ifdef _SEQUENT_
1334 # include <sys/types.h>
1335 # include <sys/utsname.h>
1336 #endif
1337 main ()
1338 {
1339 #if defined (sony)
1340 #if defined (MIPSEB)
1341 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1342 I don't know.... */
1343 printf ("mips-sony-bsd\n"); exit (0);
1344 #else
1345 #include <sys/param.h>
1346 printf ("m68k-sony-newsos%s\n",
1347 #ifdef NEWSOS4
1348 "4"
1349 #else
1350 ""
1351 #endif
1352 ); exit (0);
1353 #endif
1354 #endif
1355
1356 #if defined (__arm) && defined (__acorn) && defined (__unix)
1357 printf ("arm-acorn-riscix\n"); exit (0);
1358 #endif
1359
1360 #if defined (hp300) && !defined (hpux)
1361 printf ("m68k-hp-bsd\n"); exit (0);
1362 #endif
1363
1364 #if defined (NeXT)
1365 #if !defined (__ARCHITECTURE__)
1366 #define __ARCHITECTURE__ "m68k"
1367 #endif
1368 int version;
1369 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1370 if (version < 4)
1371 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1372 else
1373 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1374 exit (0);
1375 #endif
1376
1377 #if defined (MULTIMAX) || defined (n16)
1378 #if defined (UMAXV)
1379 printf ("ns32k-encore-sysv\n"); exit (0);
1380 #else
1381 #if defined (CMU)
1382 printf ("ns32k-encore-mach\n"); exit (0);
1383 #else
1384 printf ("ns32k-encore-bsd\n"); exit (0);
1385 #endif
1386 #endif
1387 #endif
1388
1389 #if defined (__386BSD__)
1390 printf ("i386-pc-bsd\n"); exit (0);
1391 #endif
1392
1393 #if defined (sequent)
1394 #if defined (i386)
1395 printf ("i386-sequent-dynix\n"); exit (0);
1396 #endif
1397 #if defined (ns32000)
1398 printf ("ns32k-sequent-dynix\n"); exit (0);
1399 #endif
1400 #endif
1401
1402 #if defined (_SEQUENT_)
1403 struct utsname un;
1404
1405 uname(&un);
1406
1407 if (strncmp(un.version, "V2", 2) == 0) {
1408 printf ("i386-sequent-ptx2\n"); exit (0);
1409 }
1410 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1411 printf ("i386-sequent-ptx1\n"); exit (0);
1412 }
1413 printf ("i386-sequent-ptx\n"); exit (0);
1414
1415 #endif
1416
1417 #if defined (vax)
1418 # if !defined (ultrix)
1419 # include <sys/param.h>
1420 # if defined (BSD)
1421 # if BSD == 43
1422 printf ("vax-dec-bsd4.3\n"); exit (0);
1423 # else
1424 # if BSD == 199006
1425 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1426 # else
1427 printf ("vax-dec-bsd\n"); exit (0);
1428 # endif
1429 # endif
1430 # else
1431 printf ("vax-dec-bsd\n"); exit (0);
1432 # endif
1433 # else
1434 printf ("vax-dec-ultrix\n"); exit (0);
1435 # endif
1436 #endif
1437
1438 #if defined (alliant) && defined (i860)
1439 printf ("i860-alliant-bsd\n"); exit (0);
1440 #endif
1441
1442 exit (1);
1443 }
1444 EOF
1445
1446 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1447 { echo "$SYSTEM_NAME"; exit; }
1448
1449 # Apollos put the system type in the environment.
1450
1451 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1452
1453 # Convex versions that predate uname can use getsysinfo(1)
1454
1455 if [ -x /usr/convex/getsysinfo ]
1456 then
1457 case `getsysinfo -f cpu_type` in
1458 c1*)
1459 echo c1-convex-bsd
1460 exit ;;
1461 c2*)
1462 if getsysinfo -f scalar_acc
1463 then echo c32-convex-bsd
1464 else echo c2-convex-bsd
1465 fi
1466 exit ;;
1467 c34*)
1468 echo c34-convex-bsd
1469 exit ;;
1470 c38*)
1471 echo c38-convex-bsd
1472 exit ;;
1473 c4*)
1474 echo c4-convex-bsd
1475 exit ;;
1476 esac
1477 fi
1478
1479 cat >&2 <<EOF
1480 $0: unable to guess system type
1481
1482 This script, last modified $timestamp, has failed to recognize
1483 the operating system you are using. It is advised that you
1484 download the most up to date version of the config scripts from
1485
1486 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1487 and
1488 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1489
1490 If the version you run ($0) is already up to date, please
1491 send the following data and any information you think might be
1492 pertinent to <config-patches@gnu.org> in order to provide the needed
1493 information to handle your system.
1494
1495 config.guess timestamp = $timestamp
1496
1497 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1498 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1499 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1500 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1501
1502 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1503 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1504
1505 hostinfo = `(hostinfo) 2>/dev/null`
1506 /bin/universe = `(/bin/universe) 2>/dev/null`
1507 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1508 /bin/arch = `(/bin/arch) 2>/dev/null`
1509 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1510 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1511
1512 UNAME_MACHINE = ${UNAME_MACHINE}
1513 UNAME_RELEASE = ${UNAME_RELEASE}
1514 UNAME_SYSTEM = ${UNAME_SYSTEM}
1515 UNAME_VERSION = ${UNAME_VERSION}
1516 EOF
1517
1518 exit 1
1519
1520 # Local variables:
1521 # eval: (add-hook 'write-file-hooks 'time-stamp)
1522 # time-stamp-start: "timestamp='"
1523 # time-stamp-format: "%:y-%02m-%02d"
1524 # time-stamp-end: "'"
1525 # End:
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 # Free Software Foundation, Inc.
5
6 timestamp='2008-01-16'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # This file is supposed to be the same for all GNU packages
42 # and recognize all the CPU types, system types and aliases
43 # that are meaningful with *any* GNU software.
44 # Each package is responsible for reporting which valid configurations
45 # it does not support. The user should be able to distinguish
46 # a failure to support a valid configuration from a meaningless
47 # configuration.
48
49 # The goal of this file is to map all the various variations of a given
50 # machine specification into a single specification in the form:
51 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
52 # or in some cases, the newer four-part form:
53 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
54 # It is wrong to echo any other type of specification.
55
56 me=`echo "$0" | sed -e 's,.*/,,'`
57
58 usage="\
59 Usage: $0 [OPTION] CPU-MFR-OPSYS
60 $0 [OPTION] ALIAS
61
62 Canonicalize a configuration name.
63
64 Operation modes:
65 -h, --help print this help, then exit
66 -t, --time-stamp print date of last modification, then exit
67 -v, --version print version number, then exit
68
69 Report bugs and patches to <config-patches@gnu.org>."
70
71 version="\
72 GNU config.sub ($timestamp)
73
74 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
75 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
76
77 This is free software; see the source for copying conditions. There is NO
78 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
79
80 help="
81 Try \`$me --help' for more information."
82
83 # Parse command line
84 while test $# -gt 0 ; do
85 case $1 in
86 --time-stamp | --time* | -t )
87 echo "$timestamp" ; exit ;;
88 --version | -v )
89 echo "$version" ; exit ;;
90 --help | --h* | -h )
91 echo "$usage"; exit ;;
92 -- ) # Stop option processing
93 shift; break ;;
94 - ) # Use stdin as input.
95 break ;;
96 -* )
97 echo "$me: invalid option $1$help"
98 exit 1 ;;
99
100 *local*)
101 # First pass through any local machine types.
102 echo $1
103 exit ;;
104
105 * )
106 break ;;
107 esac
108 done
109
110 case $# in
111 0) echo "$me: missing argument$help" >&2
112 exit 1;;
113 1) ;;
114 *) echo "$me: too many arguments$help" >&2
115 exit 1;;
116 esac
117
118 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
119 # Here we must recognize all the valid KERNEL-OS combinations.
120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121 case $maybe_os in
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 storm-chaos* | os2-emx* | rtmk-nova*)
125 os=-$maybe_os
126 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
127 ;;
128 *)
129 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
130 if [ $basic_machine != $1 ]
131 then os=`echo $1 | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
134 esac
135
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray)
151 os=
152 basic_machine=$1
153 ;;
154 -sim | -cisco | -oki | -wec | -winbond)
155 os=
156 basic_machine=$1
157 ;;
158 -scout)
159 ;;
160 -wrs)
161 os=-vxworks
162 basic_machine=$1
163 ;;
164 -chorusos*)
165 os=-chorusos
166 basic_machine=$1
167 ;;
168 -chorusrdb)
169 os=-chorusrdb
170 basic_machine=$1
171 ;;
172 -hiux*)
173 os=-hiuxwe2
174 ;;
175 -sco6)
176 os=-sco5v6
177 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
178 ;;
179 -sco5)
180 os=-sco3.2v5
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco4)
184 os=-sco3.2v4
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco3.2.[4-9]*)
188 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2v[4-9]*)
192 # Don't forget version if it is 3.2v4 or newer.
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco5v6*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco*)
200 os=-sco3.2v2
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -udk*)
204 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -isc)
207 os=-isc2.2
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -clix*)
211 basic_machine=clipper-intergraph
212 ;;
213 -isc*)
214 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215 ;;
216 -lynx*)
217 os=-lynxos
218 ;;
219 -ptx*)
220 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
221 ;;
222 -windowsnt*)
223 os=`echo $os | sed -e 's/windowsnt/winnt/'`
224 ;;
225 -psos*)
226 os=-psos
227 ;;
228 -mint | -mint[0-9]*)
229 basic_machine=m68k-atari
230 os=-mint
231 ;;
232 esac
233
234 # Decode aliases for certain CPU-COMPANY combinations.
235 case $basic_machine in
236 # Recognize the basic CPU types without company name.
237 # Some are omitted here because they have special meanings below.
238 1750a | 580 \
239 | a29k \
240 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
241 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
242 | am33_2.0 \
243 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
244 | bfin \
245 | c4x | clipper \
246 | d10v | d30v | dlx | dsp16xx \
247 | fido | fr30 | frv \
248 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
249 | i370 | i860 | i960 | ia64 \
250 | ip2k | iq2000 \
251 | m32c | m32r | m32rle | m68000 | m68k | m88k \
252 | maxq | mb | microblaze | mcore | mep \
253 | mips | mipsbe | mipseb | mipsel | mipsle \
254 | mips16 \
255 | mips64 | mips64el \
256 | mips64vr | mips64vrel \
257 | mips64orion | mips64orionel \
258 | mips64vr4100 | mips64vr4100el \
259 | mips64vr4300 | mips64vr4300el \
260 | mips64vr5000 | mips64vr5000el \
261 | mips64vr5900 | mips64vr5900el \
262 | mipsisa32 | mipsisa32el \
263 | mipsisa32r2 | mipsisa32r2el \
264 | mipsisa64 | mipsisa64el \
265 | mipsisa64r2 | mipsisa64r2el \
266 | mipsisa64sb1 | mipsisa64sb1el \
267 | mipsisa64sr71k | mipsisa64sr71kel \
268 | mipstx39 | mipstx39el \
269 | mn10200 | mn10300 \
270 | mt \
271 | msp430 \
272 | nios | nios2 \
273 | ns16k | ns32k \
274 | or32 \
275 | pdp10 | pdp11 | pj | pjl \
276 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
277 | pyramid \
278 | score \
279 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
280 | sh64 | sh64le \
281 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
282 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
283 | spu | strongarm \
284 | tahoe | thumb | tic4x | tic80 | tron \
285 | v850 | v850e \
286 | we32k \
287 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
288 | z8k)
289 basic_machine=$basic_machine-unknown
290 ;;
291 m6811 | m68hc11 | m6812 | m68hc12)
292 # Motorola 68HC11/12.
293 basic_machine=$basic_machine-unknown
294 os=-none
295 ;;
296 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
297 ;;
298 ms1)
299 basic_machine=mt-unknown
300 ;;
301
302 # We use `pc' rather than `unknown'
303 # because (1) that's what they normally are, and
304 # (2) the word "unknown" tends to confuse beginning users.
305 i*86 | x86_64)
306 basic_machine=$basic_machine-pc
307 ;;
308 # Object if more than one company name word.
309 *-*-*)
310 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
311 exit 1
312 ;;
313 # Recognize the basic CPU types with company name.
314 580-* \
315 | a29k-* \
316 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
317 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
318 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
319 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
320 | avr-* | avr32-* \
321 | bfin-* | bs2000-* \
322 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
323 | clipper-* | craynv-* | cydra-* \
324 | d10v-* | d30v-* | dlx-* \
325 | elxsi-* \
326 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
327 | h8300-* | h8500-* \
328 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
329 | i*86-* | i860-* | i960-* | ia64-* \
330 | ip2k-* | iq2000-* \
331 | m32c-* | m32r-* | m32rle-* \
332 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
333 | m88110-* | m88k-* | maxq-* | mcore-* \
334 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
335 | mips16-* \
336 | mips64-* | mips64el-* \
337 | mips64vr-* | mips64vrel-* \
338 | mips64orion-* | mips64orionel-* \
339 | mips64vr4100-* | mips64vr4100el-* \
340 | mips64vr4300-* | mips64vr4300el-* \
341 | mips64vr5000-* | mips64vr5000el-* \
342 | mips64vr5900-* | mips64vr5900el-* \
343 | mipsisa32-* | mipsisa32el-* \
344 | mipsisa32r2-* | mipsisa32r2el-* \
345 | mipsisa64-* | mipsisa64el-* \
346 | mipsisa64r2-* | mipsisa64r2el-* \
347 | mipsisa64sb1-* | mipsisa64sb1el-* \
348 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
349 | mipstx39-* | mipstx39el-* \
350 | mmix-* \
351 | mt-* \
352 | msp430-* \
353 | nios-* | nios2-* \
354 | none-* | np1-* | ns16k-* | ns32k-* \
355 | orion-* \
356 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
357 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
358 | pyramid-* \
359 | romp-* | rs6000-* \
360 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
361 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
362 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
363 | sparclite-* \
364 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
365 | tahoe-* | thumb-* \
366 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
367 | tron-* \
368 | v850-* | v850e-* | vax-* \
369 | we32k-* \
370 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
371 | xstormy16-* | xtensa*-* \
372 | ymp-* \
373 | z8k-*)
374 ;;
375 # Recognize the basic CPU types without company name, with glob match.
376 xtensa*)
377 basic_machine=$basic_machine-unknown
378 ;;
379 # Recognize the various machine names and aliases which stand
380 # for a CPU type and a company and sometimes even an OS.
381 386bsd)
382 basic_machine=i386-unknown
383 os=-bsd
384 ;;
385 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
386 basic_machine=m68000-att
387 ;;
388 3b*)
389 basic_machine=we32k-att
390 ;;
391 a29khif)
392 basic_machine=a29k-amd
393 os=-udi
394 ;;
395 abacus)
396 basic_machine=abacus-unknown
397 ;;
398 adobe68k)
399 basic_machine=m68010-adobe
400 os=-scout
401 ;;
402 alliant | fx80)
403 basic_machine=fx80-alliant
404 ;;
405 altos | altos3068)
406 basic_machine=m68k-altos
407 ;;
408 am29k)
409 basic_machine=a29k-none
410 os=-bsd
411 ;;
412 amd64)
413 basic_machine=x86_64-pc
414 ;;
415 amd64-*)
416 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
417 ;;
418 amdahl)
419 basic_machine=580-amdahl
420 os=-sysv
421 ;;
422 amiga | amiga-*)
423 basic_machine=m68k-unknown
424 ;;
425 amigaos | amigados)
426 basic_machine=m68k-unknown
427 os=-amigaos
428 ;;
429 amigaunix | amix)
430 basic_machine=m68k-unknown
431 os=-sysv4
432 ;;
433 apollo68)
434 basic_machine=m68k-apollo
435 os=-sysv
436 ;;
437 apollo68bsd)
438 basic_machine=m68k-apollo
439 os=-bsd
440 ;;
441 aux)
442 basic_machine=m68k-apple
443 os=-aux
444 ;;
445 balance)
446 basic_machine=ns32k-sequent
447 os=-dynix
448 ;;
449 blackfin)
450 basic_machine=bfin-unknown
451 os=-linux
452 ;;
453 blackfin-*)
454 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
455 os=-linux
456 ;;
457 c90)
458 basic_machine=c90-cray
459 os=-unicos
460 ;;
461 convex-c1)
462 basic_machine=c1-convex
463 os=-bsd
464 ;;
465 convex-c2)
466 basic_machine=c2-convex
467 os=-bsd
468 ;;
469 convex-c32)
470 basic_machine=c32-convex
471 os=-bsd
472 ;;
473 convex-c34)
474 basic_machine=c34-convex
475 os=-bsd
476 ;;
477 convex-c38)
478 basic_machine=c38-convex
479 os=-bsd
480 ;;
481 cray | j90)
482 basic_machine=j90-cray
483 os=-unicos
484 ;;
485 craynv)
486 basic_machine=craynv-cray
487 os=-unicosmp
488 ;;
489 cr16)
490 basic_machine=cr16-unknown
491 os=-elf
492 ;;
493 crds | unos)
494 basic_machine=m68k-crds
495 ;;
496 crisv32 | crisv32-* | etraxfs*)
497 basic_machine=crisv32-axis
498 ;;
499 cris | cris-* | etrax*)
500 basic_machine=cris-axis
501 ;;
502 crx)
503 basic_machine=crx-unknown
504 os=-elf
505 ;;
506 da30 | da30-*)
507 basic_machine=m68k-da30
508 ;;
509 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
510 basic_machine=mips-dec
511 ;;
512 decsystem10* | dec10*)
513 basic_machine=pdp10-dec
514 os=-tops10
515 ;;
516 decsystem20* | dec20*)
517 basic_machine=pdp10-dec
518 os=-tops20
519 ;;
520 delta | 3300 | motorola-3300 | motorola-delta \
521 | 3300-motorola | delta-motorola)
522 basic_machine=m68k-motorola
523 ;;
524 delta88)
525 basic_machine=m88k-motorola
526 os=-sysv3
527 ;;
528 djgpp)
529 basic_machine=i586-pc
530 os=-msdosdjgpp
531 ;;
532 dpx20 | dpx20-*)
533 basic_machine=rs6000-bull
534 os=-bosx
535 ;;
536 dpx2* | dpx2*-bull)
537 basic_machine=m68k-bull
538 os=-sysv3
539 ;;
540 ebmon29k)
541 basic_machine=a29k-amd
542 os=-ebmon
543 ;;
544 elxsi)
545 basic_machine=elxsi-elxsi
546 os=-bsd
547 ;;
548 encore | umax | mmax)
549 basic_machine=ns32k-encore
550 ;;
551 es1800 | OSE68k | ose68k | ose | OSE)
552 basic_machine=m68k-ericsson
553 os=-ose
554 ;;
555 fx2800)
556 basic_machine=i860-alliant
557 ;;
558 genix)
559 basic_machine=ns32k-ns
560 ;;
561 gmicro)
562 basic_machine=tron-gmicro
563 os=-sysv
564 ;;
565 go32)
566 basic_machine=i386-pc
567 os=-go32
568 ;;
569 h3050r* | hiux*)
570 basic_machine=hppa1.1-hitachi
571 os=-hiuxwe2
572 ;;
573 h8300hms)
574 basic_machine=h8300-hitachi
575 os=-hms
576 ;;
577 h8300xray)
578 basic_machine=h8300-hitachi
579 os=-xray
580 ;;
581 h8500hms)
582 basic_machine=h8500-hitachi
583 os=-hms
584 ;;
585 harris)
586 basic_machine=m88k-harris
587 os=-sysv3
588 ;;
589 hp300-*)
590 basic_machine=m68k-hp
591 ;;
592 hp300bsd)
593 basic_machine=m68k-hp
594 os=-bsd
595 ;;
596 hp300hpux)
597 basic_machine=m68k-hp
598 os=-hpux
599 ;;
600 hp3k9[0-9][0-9] | hp9[0-9][0-9])
601 basic_machine=hppa1.0-hp
602 ;;
603 hp9k2[0-9][0-9] | hp9k31[0-9])
604 basic_machine=m68000-hp
605 ;;
606 hp9k3[2-9][0-9])
607 basic_machine=m68k-hp
608 ;;
609 hp9k6[0-9][0-9] | hp6[0-9][0-9])
610 basic_machine=hppa1.0-hp
611 ;;
612 hp9k7[0-79][0-9] | hp7[0-79][0-9])
613 basic_machine=hppa1.1-hp
614 ;;
615 hp9k78[0-9] | hp78[0-9])
616 # FIXME: really hppa2.0-hp
617 basic_machine=hppa1.1-hp
618 ;;
619 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
620 # FIXME: really hppa2.0-hp
621 basic_machine=hppa1.1-hp
622 ;;
623 hp9k8[0-9][13679] | hp8[0-9][13679])
624 basic_machine=hppa1.1-hp
625 ;;
626 hp9k8[0-9][0-9] | hp8[0-9][0-9])
627 basic_machine=hppa1.0-hp
628 ;;
629 hppa-next)
630 os=-nextstep3
631 ;;
632 hppaosf)
633 basic_machine=hppa1.1-hp
634 os=-osf
635 ;;
636 hppro)
637 basic_machine=hppa1.1-hp
638 os=-proelf
639 ;;
640 i370-ibm* | ibm*)
641 basic_machine=i370-ibm
642 ;;
643 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
644 i*86v32)
645 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
646 os=-sysv32
647 ;;
648 i*86v4*)
649 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
650 os=-sysv4
651 ;;
652 i*86v)
653 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
654 os=-sysv
655 ;;
656 i*86sol2)
657 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
658 os=-solaris2
659 ;;
660 i386mach)
661 basic_machine=i386-mach
662 os=-mach
663 ;;
664 i386-vsta | vsta)
665 basic_machine=i386-unknown
666 os=-vsta
667 ;;
668 iris | iris4d)
669 basic_machine=mips-sgi
670 case $os in
671 -irix*)
672 ;;
673 *)
674 os=-irix4
675 ;;
676 esac
677 ;;
678 isi68 | isi)
679 basic_machine=m68k-isi
680 os=-sysv
681 ;;
682 m68knommu)
683 basic_machine=m68k-unknown
684 os=-linux
685 ;;
686 m68knommu-*)
687 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
688 os=-linux
689 ;;
690 m88k-omron*)
691 basic_machine=m88k-omron
692 ;;
693 magnum | m3230)
694 basic_machine=mips-mips
695 os=-sysv
696 ;;
697 merlin)
698 basic_machine=ns32k-utek
699 os=-sysv
700 ;;
701 mingw32)
702 basic_machine=i386-pc
703 os=-mingw32
704 ;;
705 mingw32ce)
706 basic_machine=arm-unknown
707 os=-mingw32ce
708 ;;
709 miniframe)
710 basic_machine=m68000-convergent
711 ;;
712 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
713 basic_machine=m68k-atari
714 os=-mint
715 ;;
716 mips3*-*)
717 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
718 ;;
719 mips3*)
720 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
721 ;;
722 monitor)
723 basic_machine=m68k-rom68k
724 os=-coff
725 ;;
726 morphos)
727 basic_machine=powerpc-unknown
728 os=-morphos
729 ;;
730 msdos)
731 basic_machine=i386-pc
732 os=-msdos
733 ;;
734 ms1-*)
735 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
736 ;;
737 mvs)
738 basic_machine=i370-ibm
739 os=-mvs
740 ;;
741 ncr3000)
742 basic_machine=i486-ncr
743 os=-sysv4
744 ;;
745 netbsd386)
746 basic_machine=i386-unknown
747 os=-netbsd
748 ;;
749 netwinder)
750 basic_machine=armv4l-rebel
751 os=-linux
752 ;;
753 news | news700 | news800 | news900)
754 basic_machine=m68k-sony
755 os=-newsos
756 ;;
757 news1000)
758 basic_machine=m68030-sony
759 os=-newsos
760 ;;
761 news-3600 | risc-news)
762 basic_machine=mips-sony
763 os=-newsos
764 ;;
765 necv70)
766 basic_machine=v70-nec
767 os=-sysv
768 ;;
769 next | m*-next )
770 basic_machine=m68k-next
771 case $os in
772 -nextstep* )
773 ;;
774 -ns2*)
775 os=-nextstep2
776 ;;
777 *)
778 os=-nextstep3
779 ;;
780 esac
781 ;;
782 nh3000)
783 basic_machine=m68k-harris
784 os=-cxux
785 ;;
786 nh[45]000)
787 basic_machine=m88k-harris
788 os=-cxux
789 ;;
790 nindy960)
791 basic_machine=i960-intel
792 os=-nindy
793 ;;
794 mon960)
795 basic_machine=i960-intel
796 os=-mon960
797 ;;
798 nonstopux)
799 basic_machine=mips-compaq
800 os=-nonstopux
801 ;;
802 np1)
803 basic_machine=np1-gould
804 ;;
805 nsr-tandem)
806 basic_machine=nsr-tandem
807 ;;
808 op50n-* | op60c-*)
809 basic_machine=hppa1.1-oki
810 os=-proelf
811 ;;
812 openrisc | openrisc-*)
813 basic_machine=or32-unknown
814 ;;
815 os400)
816 basic_machine=powerpc-ibm
817 os=-os400
818 ;;
819 OSE68000 | ose68000)
820 basic_machine=m68000-ericsson
821 os=-ose
822 ;;
823 os68k)
824 basic_machine=m68k-none
825 os=-os68k
826 ;;
827 pa-hitachi)
828 basic_machine=hppa1.1-hitachi
829 os=-hiuxwe2
830 ;;
831 paragon)
832 basic_machine=i860-intel
833 os=-osf
834 ;;
835 parisc)
836 basic_machine=hppa-unknown
837 os=-linux
838 ;;
839 parisc-*)
840 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
841 os=-linux
842 ;;
843 pbd)
844 basic_machine=sparc-tti
845 ;;
846 pbb)
847 basic_machine=m68k-tti
848 ;;
849 pc532 | pc532-*)
850 basic_machine=ns32k-pc532
851 ;;
852 pc98)
853 basic_machine=i386-pc
854 ;;
855 pc98-*)
856 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
857 ;;
858 pentium | p5 | k5 | k6 | nexgen | viac3)
859 basic_machine=i586-pc
860 ;;
861 pentiumpro | p6 | 6x86 | athlon | athlon_*)
862 basic_machine=i686-pc
863 ;;
864 pentiumii | pentium2 | pentiumiii | pentium3)
865 basic_machine=i686-pc
866 ;;
867 pentium4)
868 basic_machine=i786-pc
869 ;;
870 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
871 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
872 ;;
873 pentiumpro-* | p6-* | 6x86-* | athlon-*)
874 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
875 ;;
876 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
877 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
878 ;;
879 pentium4-*)
880 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
881 ;;
882 pn)
883 basic_machine=pn-gould
884 ;;
885 power) basic_machine=power-ibm
886 ;;
887 ppc) basic_machine=powerpc-unknown
888 ;;
889 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
890 ;;
891 ppcle | powerpclittle | ppc-le | powerpc-little)
892 basic_machine=powerpcle-unknown
893 ;;
894 ppcle-* | powerpclittle-*)
895 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
896 ;;
897 ppc64) basic_machine=powerpc64-unknown
898 ;;
899 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
900 ;;
901 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
902 basic_machine=powerpc64le-unknown
903 ;;
904 ppc64le-* | powerpc64little-*)
905 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
906 ;;
907 ps2)
908 basic_machine=i386-ibm
909 ;;
910 pw32)
911 basic_machine=i586-unknown
912 os=-pw32
913 ;;
914 rdos)
915 basic_machine=i386-pc
916 os=-rdos
917 ;;
918 rom68k)
919 basic_machine=m68k-rom68k
920 os=-coff
921 ;;
922 rm[46]00)
923 basic_machine=mips-siemens
924 ;;
925 rtpc | rtpc-*)
926 basic_machine=romp-ibm
927 ;;
928 s390 | s390-*)
929 basic_machine=s390-ibm
930 ;;
931 s390x | s390x-*)
932 basic_machine=s390x-ibm
933 ;;
934 sa29200)
935 basic_machine=a29k-amd
936 os=-udi
937 ;;
938 sb1)
939 basic_machine=mipsisa64sb1-unknown
940 ;;
941 sb1el)
942 basic_machine=mipsisa64sb1el-unknown
943 ;;
944 sde)
945 basic_machine=mipsisa32-sde
946 os=-elf
947 ;;
948 sei)
949 basic_machine=mips-sei
950 os=-seiux
951 ;;
952 sequent)
953 basic_machine=i386-sequent
954 ;;
955 sh)
956 basic_machine=sh-hitachi
957 os=-hms
958 ;;
959 sh5el)
960 basic_machine=sh5le-unknown
961 ;;
962 sh64)
963 basic_machine=sh64-unknown
964 ;;
965 sparclite-wrs | simso-wrs)
966 basic_machine=sparclite-wrs
967 os=-vxworks
968 ;;
969 sps7)
970 basic_machine=m68k-bull
971 os=-sysv2
972 ;;
973 spur)
974 basic_machine=spur-unknown
975 ;;
976 st2000)
977 basic_machine=m68k-tandem
978 ;;
979 stratus)
980 basic_machine=i860-stratus
981 os=-sysv4
982 ;;
983 sun2)
984 basic_machine=m68000-sun
985 ;;
986 sun2os3)
987 basic_machine=m68000-sun
988 os=-sunos3
989 ;;
990 sun2os4)
991 basic_machine=m68000-sun
992 os=-sunos4
993 ;;
994 sun3os3)
995 basic_machine=m68k-sun
996 os=-sunos3
997 ;;
998 sun3os4)
999 basic_machine=m68k-sun
1000 os=-sunos4
1001 ;;
1002 sun4os3)
1003 basic_machine=sparc-sun
1004 os=-sunos3
1005 ;;
1006 sun4os4)
1007 basic_machine=sparc-sun
1008 os=-sunos4
1009 ;;
1010 sun4sol2)
1011 basic_machine=sparc-sun
1012 os=-solaris2
1013 ;;
1014 sun3 | sun3-*)
1015 basic_machine=m68k-sun
1016 ;;
1017 sun4)
1018 basic_machine=sparc-sun
1019 ;;
1020 sun386 | sun386i | roadrunner)
1021 basic_machine=i386-sun
1022 ;;
1023 sv1)
1024 basic_machine=sv1-cray
1025 os=-unicos
1026 ;;
1027 symmetry)
1028 basic_machine=i386-sequent
1029 os=-dynix
1030 ;;
1031 t3e)
1032 basic_machine=alphaev5-cray
1033 os=-unicos
1034 ;;
1035 t90)
1036 basic_machine=t90-cray
1037 os=-unicos
1038 ;;
1039 tic54x | c54x*)
1040 basic_machine=tic54x-unknown
1041 os=-coff
1042 ;;
1043 tic55x | c55x*)
1044 basic_machine=tic55x-unknown
1045 os=-coff
1046 ;;
1047 tic6x | c6x*)
1048 basic_machine=tic6x-unknown
1049 os=-coff
1050 ;;
1051 tile*)
1052 basic_machine=tile-unknown
1053 os=-linux-gnu
1054 ;;
1055 tx39)
1056 basic_machine=mipstx39-unknown
1057 ;;
1058 tx39el)
1059 basic_machine=mipstx39el-unknown
1060 ;;
1061 toad1)
1062 basic_machine=pdp10-xkl
1063 os=-tops20
1064 ;;
1065 tower | tower-32)
1066 basic_machine=m68k-ncr
1067 ;;
1068 tpf)
1069 basic_machine=s390x-ibm
1070 os=-tpf
1071 ;;
1072 udi29k)
1073 basic_machine=a29k-amd
1074 os=-udi
1075 ;;
1076 ultra3)
1077 basic_machine=a29k-nyu
1078 os=-sym1
1079 ;;
1080 v810 | necv810)
1081 basic_machine=v810-nec
1082 os=-none
1083 ;;
1084 vaxv)
1085 basic_machine=vax-dec
1086 os=-sysv
1087 ;;
1088 vms)
1089 basic_machine=vax-dec
1090 os=-vms
1091 ;;
1092 vpp*|vx|vx-*)
1093 basic_machine=f301-fujitsu
1094 ;;
1095 vxworks960)
1096 basic_machine=i960-wrs
1097 os=-vxworks
1098 ;;
1099 vxworks68)
1100 basic_machine=m68k-wrs
1101 os=-vxworks
1102 ;;
1103 vxworks29k)
1104 basic_machine=a29k-wrs
1105 os=-vxworks
1106 ;;
1107 w65*)
1108 basic_machine=w65-wdc
1109 os=-none
1110 ;;
1111 w89k-*)
1112 basic_machine=hppa1.1-winbond
1113 os=-proelf
1114 ;;
1115 xbox)
1116 basic_machine=i686-pc
1117 os=-mingw32
1118 ;;
1119 xps | xps100)
1120 basic_machine=xps100-honeywell
1121 ;;
1122 ymp)
1123 basic_machine=ymp-cray
1124 os=-unicos
1125 ;;
1126 z8k-*-coff)
1127 basic_machine=z8k-unknown
1128 os=-sim
1129 ;;
1130 none)
1131 basic_machine=none-none
1132 os=-none
1133 ;;
1134
1135 # Here we handle the default manufacturer of certain CPU types. It is in
1136 # some cases the only manufacturer, in others, it is the most popular.
1137 w89k)
1138 basic_machine=hppa1.1-winbond
1139 ;;
1140 op50n)
1141 basic_machine=hppa1.1-oki
1142 ;;
1143 op60c)
1144 basic_machine=hppa1.1-oki
1145 ;;
1146 romp)
1147 basic_machine=romp-ibm
1148 ;;
1149 mmix)
1150 basic_machine=mmix-knuth
1151 ;;
1152 rs6000)
1153 basic_machine=rs6000-ibm
1154 ;;
1155 vax)
1156 basic_machine=vax-dec
1157 ;;
1158 pdp10)
1159 # there are many clones, so DEC is not a safe bet
1160 basic_machine=pdp10-unknown
1161 ;;
1162 pdp11)
1163 basic_machine=pdp11-dec
1164 ;;
1165 we32k)
1166 basic_machine=we32k-att
1167 ;;
1168 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1169 basic_machine=sh-unknown
1170 ;;
1171 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1172 basic_machine=sparc-sun
1173 ;;
1174 cydra)
1175 basic_machine=cydra-cydrome
1176 ;;
1177 orion)
1178 basic_machine=orion-highlevel
1179 ;;
1180 orion105)
1181 basic_machine=clipper-highlevel
1182 ;;
1183 mac | mpw | mac-mpw)
1184 basic_machine=m68k-apple
1185 ;;
1186 pmac | pmac-mpw)
1187 basic_machine=powerpc-apple
1188 ;;
1189 *-unknown)
1190 # Make sure to match an already-canonicalized machine name.
1191 ;;
1192 *)
1193 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1194 exit 1
1195 ;;
1196 esac
1197
1198 # Here we canonicalize certain aliases for manufacturers.
1199 case $basic_machine in
1200 *-digital*)
1201 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1202 ;;
1203 *-commodore*)
1204 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1205 ;;
1206 *)
1207 ;;
1208 esac
1209
1210 # Decode manufacturer-specific aliases for certain operating systems.
1211
1212 if [ x"$os" != x"" ]
1213 then
1214 case $os in
1215 # First match some system type aliases
1216 # that might get confused with valid system types.
1217 # -solaris* is a basic system type, with this one exception.
1218 -solaris1 | -solaris1.*)
1219 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1220 ;;
1221 -solaris)
1222 os=-solaris2
1223 ;;
1224 -svr4*)
1225 os=-sysv4
1226 ;;
1227 -unixware*)
1228 os=-sysv4.2uw
1229 ;;
1230 -gnu/linux*)
1231 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1232 ;;
1233 # First accept the basic system types.
1234 # The portable systems comes first.
1235 # Each alternative MUST END IN A *, to match a version number.
1236 # -sysv* is not here because it comes later, after sysvr4.
1237 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1238 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1239 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1240 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1241 | -aos* \
1242 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1243 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1244 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1245 | -openbsd* | -solidbsd* \
1246 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1247 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1248 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1249 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1250 | -chorusos* | -chorusrdb* \
1251 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1252 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1253 | -uxpv* | -beos* | -mpeix* | -udk* \
1254 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1255 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1256 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1257 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1258 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1259 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1260 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1261 # Remember, each alternative MUST END IN *, to match a version number.
1262 ;;
1263 -qnx*)
1264 case $basic_machine in
1265 x86-* | i*86-*)
1266 ;;
1267 *)
1268 os=-nto$os
1269 ;;
1270 esac
1271 ;;
1272 -nto-qnx*)
1273 ;;
1274 -nto*)
1275 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1276 ;;
1277 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1278 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1279 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1280 ;;
1281 -mac*)
1282 os=`echo $os | sed -e 's|mac|macos|'`
1283 ;;
1284 -linux-dietlibc)
1285 os=-linux-dietlibc
1286 ;;
1287 -linux*)
1288 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1289 ;;
1290 -sunos5*)
1291 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1292 ;;
1293 -sunos6*)
1294 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1295 ;;
1296 -opened*)
1297 os=-openedition
1298 ;;
1299 -os400*)
1300 os=-os400
1301 ;;
1302 -wince*)
1303 os=-wince
1304 ;;
1305 -osfrose*)
1306 os=-osfrose
1307 ;;
1308 -osf*)
1309 os=-osf
1310 ;;
1311 -utek*)
1312 os=-bsd
1313 ;;
1314 -dynix*)
1315 os=-bsd
1316 ;;
1317 -acis*)
1318 os=-aos
1319 ;;
1320 -atheos*)
1321 os=-atheos
1322 ;;
1323 -syllable*)
1324 os=-syllable
1325 ;;
1326 -386bsd)
1327 os=-bsd
1328 ;;
1329 -ctix* | -uts*)
1330 os=-sysv
1331 ;;
1332 -nova*)
1333 os=-rtmk-nova
1334 ;;
1335 -ns2 )
1336 os=-nextstep2
1337 ;;
1338 -nsk*)
1339 os=-nsk
1340 ;;
1341 # Preserve the version number of sinix5.
1342 -sinix5.*)
1343 os=`echo $os | sed -e 's|sinix|sysv|'`
1344 ;;
1345 -sinix*)
1346 os=-sysv4
1347 ;;
1348 -tpf*)
1349 os=-tpf
1350 ;;
1351 -triton*)
1352 os=-sysv3
1353 ;;
1354 -oss*)
1355 os=-sysv3
1356 ;;
1357 -svr4)
1358 os=-sysv4
1359 ;;
1360 -svr3)
1361 os=-sysv3
1362 ;;
1363 -sysvr4)
1364 os=-sysv4
1365 ;;
1366 # This must come after -sysvr4.
1367 -sysv*)
1368 ;;
1369 -ose*)
1370 os=-ose
1371 ;;
1372 -es1800*)
1373 os=-ose
1374 ;;
1375 -xenix)
1376 os=-xenix
1377 ;;
1378 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1379 os=-mint
1380 ;;
1381 -aros*)
1382 os=-aros
1383 ;;
1384 -kaos*)
1385 os=-kaos
1386 ;;
1387 -zvmoe)
1388 os=-zvmoe
1389 ;;
1390 -none)
1391 ;;
1392 *)
1393 # Get rid of the `-' at the beginning of $os.
1394 os=`echo $os | sed 's/[^-]*-//'`
1395 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1396 exit 1
1397 ;;
1398 esac
1399 else
1400
1401 # Here we handle the default operating systems that come with various machines.
1402 # The value should be what the vendor currently ships out the door with their
1403 # machine or put another way, the most popular os provided with the machine.
1404
1405 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1406 # "-sun"), then you have to tell the case statement up towards the top
1407 # that MANUFACTURER isn't an operating system. Otherwise, code above
1408 # will signal an error saying that MANUFACTURER isn't an operating
1409 # system, and we'll never get to this point.
1410
1411 case $basic_machine in
1412 score-*)
1413 os=-elf
1414 ;;
1415 spu-*)
1416 os=-elf
1417 ;;
1418 *-acorn)
1419 os=-riscix1.2
1420 ;;
1421 arm*-rebel)
1422 os=-linux
1423 ;;
1424 arm*-semi)
1425 os=-aout
1426 ;;
1427 c4x-* | tic4x-*)
1428 os=-coff
1429 ;;
1430 # This must come before the *-dec entry.
1431 pdp10-*)
1432 os=-tops20
1433 ;;
1434 pdp11-*)
1435 os=-none
1436 ;;
1437 *-dec | vax-*)
1438 os=-ultrix4.2
1439 ;;
1440 m68*-apollo)
1441 os=-domain
1442 ;;
1443 i386-sun)
1444 os=-sunos4.0.2
1445 ;;
1446 m68000-sun)
1447 os=-sunos3
1448 # This also exists in the configure program, but was not the
1449 # default.
1450 # os=-sunos4
1451 ;;
1452 m68*-cisco)
1453 os=-aout
1454 ;;
1455 mep-*)
1456 os=-elf
1457 ;;
1458 mips*-cisco)
1459 os=-elf
1460 ;;
1461 mips*-*)
1462 os=-elf
1463 ;;
1464 or32-*)
1465 os=-coff
1466 ;;
1467 *-tti) # must be before sparc entry or we get the wrong os.
1468 os=-sysv3
1469 ;;
1470 sparc-* | *-sun)
1471 os=-sunos4.1.1
1472 ;;
1473 *-be)
1474 os=-beos
1475 ;;
1476 *-haiku)
1477 os=-haiku
1478 ;;
1479 *-ibm)
1480 os=-aix
1481 ;;
1482 *-knuth)
1483 os=-mmixware
1484 ;;
1485 *-wec)
1486 os=-proelf
1487 ;;
1488 *-winbond)
1489 os=-proelf
1490 ;;
1491 *-oki)
1492 os=-proelf
1493 ;;
1494 *-hp)
1495 os=-hpux
1496 ;;
1497 *-hitachi)
1498 os=-hiux
1499 ;;
1500 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1501 os=-sysv
1502 ;;
1503 *-cbm)
1504 os=-amigaos
1505 ;;
1506 *-dg)
1507 os=-dgux
1508 ;;
1509 *-dolphin)
1510 os=-sysv3
1511 ;;
1512 m68k-ccur)
1513 os=-rtu
1514 ;;
1515 m88k-omron*)
1516 os=-luna
1517 ;;
1518 *-next )
1519 os=-nextstep
1520 ;;
1521 *-sequent)
1522 os=-ptx
1523 ;;
1524 *-crds)
1525 os=-unos
1526 ;;
1527 *-ns)
1528 os=-genix
1529 ;;
1530 i370-*)
1531 os=-mvs
1532 ;;
1533 *-next)
1534 os=-nextstep3
1535 ;;
1536 *-gould)
1537 os=-sysv
1538 ;;
1539 *-highlevel)
1540 os=-bsd
1541 ;;
1542 *-encore)
1543 os=-bsd
1544 ;;
1545 *-sgi)
1546 os=-irix
1547 ;;
1548 *-siemens)
1549 os=-sysv4
1550 ;;
1551 *-masscomp)
1552 os=-rtu
1553 ;;
1554 f30[01]-fujitsu | f700-fujitsu)
1555 os=-uxpv
1556 ;;
1557 *-rom68k)
1558 os=-coff
1559 ;;
1560 *-*bug)
1561 os=-coff
1562 ;;
1563 *-apple)
1564 os=-macos
1565 ;;
1566 *-atari*)
1567 os=-mint
1568 ;;
1569 *)
1570 os=-none
1571 ;;
1572 esac
1573 fi
1574
1575 # Here we handle the case where we know the os, and the CPU type, but not the
1576 # manufacturer. We pick the logical manufacturer.
1577 vendor=unknown
1578 case $basic_machine in
1579 *-unknown)
1580 case $os in
1581 -riscix*)
1582 vendor=acorn
1583 ;;
1584 -sunos*)
1585 vendor=sun
1586 ;;
1587 -aix*)
1588 vendor=ibm
1589 ;;
1590 -beos*)
1591 vendor=be
1592 ;;
1593 -hpux*)
1594 vendor=hp
1595 ;;
1596 -mpeix*)
1597 vendor=hp
1598 ;;
1599 -hiux*)
1600 vendor=hitachi
1601 ;;
1602 -unos*)
1603 vendor=crds
1604 ;;
1605 -dgux*)
1606 vendor=dg
1607 ;;
1608 -luna*)
1609 vendor=omron
1610 ;;
1611 -genix*)
1612 vendor=ns
1613 ;;
1614 -mvs* | -opened*)
1615 vendor=ibm
1616 ;;
1617 -os400*)
1618 vendor=ibm
1619 ;;
1620 -ptx*)
1621 vendor=sequent
1622 ;;
1623 -tpf*)
1624 vendor=ibm
1625 ;;
1626 -vxsim* | -vxworks* | -windiss*)
1627 vendor=wrs
1628 ;;
1629 -aux*)
1630 vendor=apple
1631 ;;
1632 -hms*)
1633 vendor=hitachi
1634 ;;
1635 -mpw* | -macos*)
1636 vendor=apple
1637 ;;
1638 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1639 vendor=atari
1640 ;;
1641 -vos*)
1642 vendor=stratus
1643 ;;
1644 esac
1645 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1646 ;;
1647 esac
1648
1649 echo $basic_machine$os
1650 exit
1651
1652 # Local variables:
1653 # eval: (add-hook 'write-file-hooks 'time-stamp)
1654 # time-stamp-start: "timestamp='"
1655 # time-stamp-format: "%:y-%02m-%02d"
1656 # time-stamp-end: "'"
1657 # End:
19181918 ac_compiler_gnu=$ac_cv_c_compiler_gnu
19191919
19201920
1921
1922 ac_config_headers="$ac_config_headers include/config.h"
1923
1924 am__api_version='1.10'
1925
19211926 ac_aux_dir=
1922 for ac_dir in config "$srcdir"/config; do
1927 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
19231928 if test -f "$ac_dir/install-sh"; then
19241929 ac_aux_dir=$ac_dir
19251930 ac_install_sh="$ac_aux_dir/install-sh -c"
19351940 fi
19361941 done
19371942 if test -z "$ac_aux_dir"; then
1938 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
1939 echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
1943 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
1944 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
19401945 { (exit 1); exit 1; }; }
19411946 fi
19421947
19481953 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
19491954 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
19501955
1951
1952
1953 ac_config_headers="$ac_config_headers include/config.h"
1954
1955 am__api_version='1.10'
19561956
19571957 # Find a good install program. We prefer a C program (faster),
19581958 # so one script is as good as another. But avoid the broken or
00 AC_INIT(configure.in)
1 AC_CONFIG_AUX_DIR(config)
21
32 AM_CONFIG_HEADER(include/config.h)
43 AM_INIT_AUTOMAKE(libmpcs, 0.1)
0 libmpc (1:0.1~r406-1) experimental; urgency=low
1
2 * New upstream SVN snapshot:
3 + debian/control:
4 - Build depend on new enough libreplaygain-dev.
5 * debian/rules:
6 + Correctly set shlibs version.
7
8 -- Sebastian Dröge <slomo@debian.org> Thu, 22 May 2008 11:14:53 +0200
9
010 libmpc (1:0.1~r402-1) experimental; urgency=low
111
212 * New upstream SVN snapshot:
55 Jorge Salamero Sanz <bencer@cauterized.net>
66 Build-Depends: cdbs (>= 0.4.20),
77 debhelper (>= 5),
8 libreplaygain-dev
8 libreplaygain-dev (>= 1.0~r406)
99 Standards-Version: 3.7.3
1010 Homepage: http://www.musepack.net
1111
66
77 common-binary-post-install-arch:: list-missing
88
9 DEB_DH_MAKESHLIBS_ARGS_libmpcdec6 := -V 'libmpcdec6 (>= 0.1~r406)'
10
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2007-03-29.01
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
6 # Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
29
30 case $1 in
31 '')
32 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
33 exit 1;
34 ;;
35 -h | --h*)
36 cat <<\EOF
37 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
38
39 Run PROGRAMS ARGS to compile a file, generating dependencies
40 as side-effects.
41
42 Environment variables:
43 depmode Dependency tracking mode.
44 source Source file read by `PROGRAMS ARGS'.
45 object Object file output by `PROGRAMS ARGS'.
46 DEPDIR directory where to store dependencies.
47 depfile Dependency file to output.
48 tmpdepfile Temporary file to use when outputing dependencies.
49 libtool Whether libtool is used (yes/no).
50
51 Report bugs to <bug-automake@gnu.org>.
52 EOF
53 exit $?
54 ;;
55 -v | --v*)
56 echo "depcomp $scriptversion"
57 exit $?
58 ;;
59 esac
60
61 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
62 echo "depcomp: Variables source, object and depmode must be set" 1>&2
63 exit 1
64 fi
65
66 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
67 depfile=${depfile-`echo "$object" |
68 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
69 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
70
71 rm -f "$tmpdepfile"
72
73 # Some modes work just like other modes, but use different flags. We
74 # parameterize here, but still list the modes in the big case below,
75 # to make depend.m4 easier to write. Note that we *cannot* use a case
76 # here, because this file can only contain one case statement.
77 if test "$depmode" = hp; then
78 # HP compiler uses -M and no extra arg.
79 gccflag=-M
80 depmode=gcc
81 fi
82
83 if test "$depmode" = dashXmstdout; then
84 # This is just like dashmstdout with a different argument.
85 dashmflag=-xM
86 depmode=dashmstdout
87 fi
88
89 case "$depmode" in
90 gcc3)
91 ## gcc 3 implements dependency tracking that does exactly what
92 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
93 ## it if -MD -MP comes after the -MF stuff. Hmm.
94 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
95 ## the command line argument order; so add the flags where they
96 ## appear in depend2.am. Note that the slowdown incurred here
97 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
98 for arg
99 do
100 case $arg in
101 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
102 *) set fnord "$@" "$arg" ;;
103 esac
104 shift # fnord
105 shift # $arg
106 done
107 "$@"
108 stat=$?
109 if test $stat -eq 0; then :
110 else
111 rm -f "$tmpdepfile"
112 exit $stat
113 fi
114 mv "$tmpdepfile" "$depfile"
115 ;;
116
117 gcc)
118 ## There are various ways to get dependency output from gcc. Here's
119 ## why we pick this rather obscure method:
120 ## - Don't want to use -MD because we'd like the dependencies to end
121 ## up in a subdir. Having to rename by hand is ugly.
122 ## (We might end up doing this anyway to support other compilers.)
123 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
124 ## -MM, not -M (despite what the docs say).
125 ## - Using -M directly means running the compiler twice (even worse
126 ## than renaming).
127 if test -z "$gccflag"; then
128 gccflag=-MD,
129 fi
130 "$@" -Wp,"$gccflag$tmpdepfile"
131 stat=$?
132 if test $stat -eq 0; then :
133 else
134 rm -f "$tmpdepfile"
135 exit $stat
136 fi
137 rm -f "$depfile"
138 echo "$object : \\" > "$depfile"
139 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
140 ## The second -e expression handles DOS-style file names with drive letters.
141 sed -e 's/^[^:]*: / /' \
142 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
143 ## This next piece of magic avoids the `deleted header file' problem.
144 ## The problem is that when a header file which appears in a .P file
145 ## is deleted, the dependency causes make to die (because there is
146 ## typically no way to rebuild the header). We avoid this by adding
147 ## dummy dependencies for each header file. Too bad gcc doesn't do
148 ## this for us directly.
149 tr ' ' '
150 ' < "$tmpdepfile" |
151 ## Some versions of gcc put a space before the `:'. On the theory
152 ## that the space means something, we add a space to the output as
153 ## well.
154 ## Some versions of the HPUX 10.20 sed can't process this invocation
155 ## correctly. Breaking it into two sed invocations is a workaround.
156 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
157 rm -f "$tmpdepfile"
158 ;;
159
160 hp)
161 # This case exists only to let depend.m4 do its work. It works by
162 # looking at the text of this script. This case will never be run,
163 # since it is checked for above.
164 exit 1
165 ;;
166
167 sgi)
168 if test "$libtool" = yes; then
169 "$@" "-Wp,-MDupdate,$tmpdepfile"
170 else
171 "$@" -MDupdate "$tmpdepfile"
172 fi
173 stat=$?
174 if test $stat -eq 0; then :
175 else
176 rm -f "$tmpdepfile"
177 exit $stat
178 fi
179 rm -f "$depfile"
180
181 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
182 echo "$object : \\" > "$depfile"
183
184 # Clip off the initial element (the dependent). Don't try to be
185 # clever and replace this with sed code, as IRIX sed won't handle
186 # lines with more than a fixed number of characters (4096 in
187 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
188 # the IRIX cc adds comments like `#:fec' to the end of the
189 # dependency line.
190 tr ' ' '
191 ' < "$tmpdepfile" \
192 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
193 tr '
194 ' ' ' >> $depfile
195 echo >> $depfile
196
197 # The second pass generates a dummy entry for each header file.
198 tr ' ' '
199 ' < "$tmpdepfile" \
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
201 >> $depfile
202 else
203 # The sourcefile does not contain any dependencies, so just
204 # store a dummy comment line, to avoid errors with the Makefile
205 # "include basename.Plo" scheme.
206 echo "#dummy" > "$depfile"
207 fi
208 rm -f "$tmpdepfile"
209 ;;
210
211 aix)
212 # The C for AIX Compiler uses -M and outputs the dependencies
213 # in a .u file. In older versions, this file always lives in the
214 # current directory. Also, the AIX compiler puts `$object:' at the
215 # start of each line; $object doesn't have directory information.
216 # Version 6 uses the directory in both cases.
217 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
218 test "x$dir" = "x$object" && dir=
219 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
220 if test "$libtool" = yes; then
221 tmpdepfile1=$dir$base.u
222 tmpdepfile2=$base.u
223 tmpdepfile3=$dir.libs/$base.u
224 "$@" -Wc,-M
225 else
226 tmpdepfile1=$dir$base.u
227 tmpdepfile2=$dir$base.u
228 tmpdepfile3=$dir$base.u
229 "$@" -M
230 fi
231 stat=$?
232
233 if test $stat -eq 0; then :
234 else
235 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
236 exit $stat
237 fi
238
239 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
240 do
241 test -f "$tmpdepfile" && break
242 done
243 if test -f "$tmpdepfile"; then
244 # Each line is of the form `foo.o: dependent.h'.
245 # Do two passes, one to just change these to
246 # `$object: dependent.h' and one to simply `dependent.h:'.
247 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
248 # That's a tab and a space in the [].
249 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
250 else
251 # The sourcefile does not contain any dependencies, so just
252 # store a dummy comment line, to avoid errors with the Makefile
253 # "include basename.Plo" scheme.
254 echo "#dummy" > "$depfile"
255 fi
256 rm -f "$tmpdepfile"
257 ;;
258
259 icc)
260 # Intel's C compiler understands `-MD -MF file'. However on
261 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
262 # ICC 7.0 will fill foo.d with something like
263 # foo.o: sub/foo.c
264 # foo.o: sub/foo.h
265 # which is wrong. We want:
266 # sub/foo.o: sub/foo.c
267 # sub/foo.o: sub/foo.h
268 # sub/foo.c:
269 # sub/foo.h:
270 # ICC 7.1 will output
271 # foo.o: sub/foo.c sub/foo.h
272 # and will wrap long lines using \ :
273 # foo.o: sub/foo.c ... \
274 # sub/foo.h ... \
275 # ...
276
277 "$@" -MD -MF "$tmpdepfile"
278 stat=$?
279 if test $stat -eq 0; then :
280 else
281 rm -f "$tmpdepfile"
282 exit $stat
283 fi
284 rm -f "$depfile"
285 # Each line is of the form `foo.o: dependent.h',
286 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
287 # Do two passes, one to just change these to
288 # `$object: dependent.h' and one to simply `dependent.h:'.
289 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
290 # Some versions of the HPUX 10.20 sed can't process this invocation
291 # correctly. Breaking it into two sed invocations is a workaround.
292 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
293 sed -e 's/$/ :/' >> "$depfile"
294 rm -f "$tmpdepfile"
295 ;;
296
297 hp2)
298 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
299 # compilers, which have integrated preprocessors. The correct option
300 # to use with these is +Maked; it writes dependencies to a file named
301 # 'foo.d', which lands next to the object file, wherever that
302 # happens to be.
303 # Much of this is similar to the tru64 case; see comments there.
304 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
305 test "x$dir" = "x$object" && dir=
306 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
307 if test "$libtool" = yes; then
308 tmpdepfile1=$dir$base.d
309 tmpdepfile2=$dir.libs/$base.d
310 "$@" -Wc,+Maked
311 else
312 tmpdepfile1=$dir$base.d
313 tmpdepfile2=$dir$base.d
314 "$@" +Maked
315 fi
316 stat=$?
317 if test $stat -eq 0; then :
318 else
319 rm -f "$tmpdepfile1" "$tmpdepfile2"
320 exit $stat
321 fi
322
323 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
324 do
325 test -f "$tmpdepfile" && break
326 done
327 if test -f "$tmpdepfile"; then
328 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
329 # Add `dependent.h:' lines.
330 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
331 else
332 echo "#dummy" > "$depfile"
333 fi
334 rm -f "$tmpdepfile" "$tmpdepfile2"
335 ;;
336
337 tru64)
338 # The Tru64 compiler uses -MD to generate dependencies as a side
339 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
340 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
341 # dependencies in `foo.d' instead, so we check for that too.
342 # Subdirectories are respected.
343 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
344 test "x$dir" = "x$object" && dir=
345 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
346
347 if test "$libtool" = yes; then
348 # With Tru64 cc, shared objects can also be used to make a
349 # static library. This mechanism is used in libtool 1.4 series to
350 # handle both shared and static libraries in a single compilation.
351 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
352 #
353 # With libtool 1.5 this exception was removed, and libtool now
354 # generates 2 separate objects for the 2 libraries. These two
355 # compilations output dependencies in $dir.libs/$base.o.d and
356 # in $dir$base.o.d. We have to check for both files, because
357 # one of the two compilations can be disabled. We should prefer
358 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
359 # automatically cleaned when .libs/ is deleted, while ignoring
360 # the former would cause a distcleancheck panic.
361 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
362 tmpdepfile2=$dir$base.o.d # libtool 1.5
363 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
364 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
365 "$@" -Wc,-MD
366 else
367 tmpdepfile1=$dir$base.o.d
368 tmpdepfile2=$dir$base.d
369 tmpdepfile3=$dir$base.d
370 tmpdepfile4=$dir$base.d
371 "$@" -MD
372 fi
373
374 stat=$?
375 if test $stat -eq 0; then :
376 else
377 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
378 exit $stat
379 fi
380
381 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
382 do
383 test -f "$tmpdepfile" && break
384 done
385 if test -f "$tmpdepfile"; then
386 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
387 # That's a tab and a space in the [].
388 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
389 else
390 echo "#dummy" > "$depfile"
391 fi
392 rm -f "$tmpdepfile"
393 ;;
394
395 #nosideeffect)
396 # This comment above is used by automake to tell side-effect
397 # dependency tracking mechanisms from slower ones.
398
399 dashmstdout)
400 # Important note: in order to support this mode, a compiler *must*
401 # always write the preprocessed file to stdout, regardless of -o.
402 "$@" || exit $?
403
404 # Remove the call to Libtool.
405 if test "$libtool" = yes; then
406 while test $1 != '--mode=compile'; do
407 shift
408 done
409 shift
410 fi
411
412 # Remove `-o $object'.
413 IFS=" "
414 for arg
415 do
416 case $arg in
417 -o)
418 shift
419 ;;
420 $object)
421 shift
422 ;;
423 *)
424 set fnord "$@" "$arg"
425 shift # fnord
426 shift # $arg
427 ;;
428 esac
429 done
430
431 test -z "$dashmflag" && dashmflag=-M
432 # Require at least two characters before searching for `:'
433 # in the target name. This is to cope with DOS-style filenames:
434 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
435 "$@" $dashmflag |
436 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
437 rm -f "$depfile"
438 cat < "$tmpdepfile" > "$depfile"
439 tr ' ' '
440 ' < "$tmpdepfile" | \
441 ## Some versions of the HPUX 10.20 sed can't process this invocation
442 ## correctly. Breaking it into two sed invocations is a workaround.
443 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
444 rm -f "$tmpdepfile"
445 ;;
446
447 dashXmstdout)
448 # This case only exists to satisfy depend.m4. It is never actually
449 # run, as this mode is specially recognized in the preamble.
450 exit 1
451 ;;
452
453 makedepend)
454 "$@" || exit $?
455 # Remove any Libtool call
456 if test "$libtool" = yes; then
457 while test $1 != '--mode=compile'; do
458 shift
459 done
460 shift
461 fi
462 # X makedepend
463 shift
464 cleared=no
465 for arg in "$@"; do
466 case $cleared in
467 no)
468 set ""; shift
469 cleared=yes ;;
470 esac
471 case "$arg" in
472 -D*|-I*)
473 set fnord "$@" "$arg"; shift ;;
474 # Strip any option that makedepend may not understand. Remove
475 # the object too, otherwise makedepend will parse it as a source file.
476 -*|$object)
477 ;;
478 *)
479 set fnord "$@" "$arg"; shift ;;
480 esac
481 done
482 obj_suffix="`echo $object | sed 's/^.*\././'`"
483 touch "$tmpdepfile"
484 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
485 rm -f "$depfile"
486 cat < "$tmpdepfile" > "$depfile"
487 sed '1,2d' "$tmpdepfile" | tr ' ' '
488 ' | \
489 ## Some versions of the HPUX 10.20 sed can't process this invocation
490 ## correctly. Breaking it into two sed invocations is a workaround.
491 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
492 rm -f "$tmpdepfile" "$tmpdepfile".bak
493 ;;
494
495 cpp)
496 # Important note: in order to support this mode, a compiler *must*
497 # always write the preprocessed file to stdout.
498 "$@" || exit $?
499
500 # Remove the call to Libtool.
501 if test "$libtool" = yes; then
502 while test $1 != '--mode=compile'; do
503 shift
504 done
505 shift
506 fi
507
508 # Remove `-o $object'.
509 IFS=" "
510 for arg
511 do
512 case $arg in
513 -o)
514 shift
515 ;;
516 $object)
517 shift
518 ;;
519 *)
520 set fnord "$@" "$arg"
521 shift # fnord
522 shift # $arg
523 ;;
524 esac
525 done
526
527 "$@" -E |
528 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
529 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
530 sed '$ s: \\$::' > "$tmpdepfile"
531 rm -f "$depfile"
532 echo "$object : \\" > "$depfile"
533 cat < "$tmpdepfile" >> "$depfile"
534 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
535 rm -f "$tmpdepfile"
536 ;;
537
538 msvisualcpp)
539 # Important note: in order to support this mode, a compiler *must*
540 # always write the preprocessed file to stdout, regardless of -o,
541 # because we must use -o when running libtool.
542 "$@" || exit $?
543 IFS=" "
544 for arg
545 do
546 case "$arg" in
547 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
548 set fnord "$@"
549 shift
550 shift
551 ;;
552 *)
553 set fnord "$@" "$arg"
554 shift
555 shift
556 ;;
557 esac
558 done
559 "$@" -E |
560 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
561 rm -f "$depfile"
562 echo "$object : \\" > "$depfile"
563 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
564 echo " " >> "$depfile"
565 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
566 rm -f "$tmpdepfile"
567 ;;
568
569 none)
570 exec "$@"
571 ;;
572
573 *)
574 echo "Unknown depmode $depmode" 1>&2
575 exit 1
576 ;;
577 esac
578
579 exit 0
580
581 # Local Variables:
582 # mode: shell-script
583 # sh-indentation: 2
584 # eval: (add-hook 'write-file-hooks 'time-stamp)
585 # time-stamp-start: "scriptversion="
586 # time-stamp-format: "%:y-%02m-%02d.%02H"
587 # time-stamp-end: "$"
588 # End:
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2006-12-25.00
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 shift;;
159
160 -T) no_target_directory=true;;
161
162 --version) echo "$0 $scriptversion"; exit $?;;
163
164 --) shift
165 break;;
166
167 -*) echo "$0: invalid option: $1" >&2
168 exit 1;;
169
170 *) break;;
171 esac
172 shift
173 done
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 done
189 fi
190
191 if test $# -eq 0; then
192 if test -z "$dir_arg"; then
193 echo "$0: no input file specified." >&2
194 exit 1
195 fi
196 # It's OK to call `install-sh -d' without argument.
197 # This can happen when creating conditional directories.
198 exit 0
199 fi
200
201 if test -z "$dir_arg"; then
202 trap '(exit $?); exit' 1 2 13 15
203
204 # Set umask so as not to create temps with too-generous modes.
205 # However, 'strip' requires both read and write access to temps.
206 case $mode in
207 # Optimize common cases.
208 *644) cp_umask=133;;
209 *755) cp_umask=22;;
210
211 *[0-7])
212 if test -z "$stripcmd"; then
213 u_plus_rw=
214 else
215 u_plus_rw='% 200'
216 fi
217 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
218 *)
219 if test -z "$stripcmd"; then
220 u_plus_rw=
221 else
222 u_plus_rw=,u+rw
223 fi
224 cp_umask=$mode$u_plus_rw;;
225 esac
226 fi
227
228 for src
229 do
230 # Protect names starting with `-'.
231 case $src in
232 -*) src=./$src;;
233 esac
234
235 if test -n "$dir_arg"; then
236 dst=$src
237 dstdir=$dst
238 test -d "$dstdir"
239 dstdir_status=$?
240 else
241
242 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
243 # might cause directories to be created, which would be especially bad
244 # if $src (and thus $dsttmp) contains '*'.
245 if test ! -f "$src" && test ! -d "$src"; then
246 echo "$0: $src does not exist." >&2
247 exit 1
248 fi
249
250 if test -z "$dst_arg"; then
251 echo "$0: no destination specified." >&2
252 exit 1
253 fi
254
255 dst=$dst_arg
256 # Protect names starting with `-'.
257 case $dst in
258 -*) dst=./$dst;;
259 esac
260
261 # If destination is a directory, append the input filename; won't work
262 # if double slashes aren't ignored.
263 if test -d "$dst"; then
264 if test -n "$no_target_directory"; then
265 echo "$0: $dst_arg: Is a directory" >&2
266 exit 1
267 fi
268 dstdir=$dst
269 dst=$dstdir/`basename "$src"`
270 dstdir_status=0
271 else
272 # Prefer dirname, but fall back on a substitute if dirname fails.
273 dstdir=`
274 (dirname "$dst") 2>/dev/null ||
275 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
276 X"$dst" : 'X\(//\)[^/]' \| \
277 X"$dst" : 'X\(//\)$' \| \
278 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
279 echo X"$dst" |
280 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
281 s//\1/
282 q
283 }
284 /^X\(\/\/\)[^/].*/{
285 s//\1/
286 q
287 }
288 /^X\(\/\/\)$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\).*/{
293 s//\1/
294 q
295 }
296 s/.*/./; q'
297 `
298
299 test -d "$dstdir"
300 dstdir_status=$?
301 fi
302 fi
303
304 obsolete_mkdir_used=false
305
306 if test $dstdir_status != 0; then
307 case $posix_mkdir in
308 '')
309 # Create intermediate dirs using mode 755 as modified by the umask.
310 # This is like FreeBSD 'install' as of 1997-10-28.
311 umask=`umask`
312 case $stripcmd.$umask in
313 # Optimize common cases.
314 *[2367][2367]) mkdir_umask=$umask;;
315 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
316
317 *[0-7])
318 mkdir_umask=`expr $umask + 22 \
319 - $umask % 100 % 40 + $umask % 20 \
320 - $umask % 10 % 4 + $umask % 2
321 `;;
322 *) mkdir_umask=$umask,go-w;;
323 esac
324
325 # With -d, create the new directory with the user-specified mode.
326 # Otherwise, rely on $mkdir_umask.
327 if test -n "$dir_arg"; then
328 mkdir_mode=-m$mode
329 else
330 mkdir_mode=
331 fi
332
333 posix_mkdir=false
334 case $umask in
335 *[123567][0-7][0-7])
336 # POSIX mkdir -p sets u+wx bits regardless of umask, which
337 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
338 ;;
339 *)
340 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
341 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
342
343 if (umask $mkdir_umask &&
344 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 then
346 if test -z "$dir_arg" || {
347 # Check for POSIX incompatibilities with -m.
348 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
349 # other-writeable bit of parent directory when it shouldn't.
350 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
351 ls_ld_tmpdir=`ls -ld "$tmpdir"`
352 case $ls_ld_tmpdir in
353 d????-?r-*) different_mode=700;;
354 d????-?--*) different_mode=755;;
355 *) false;;
356 esac &&
357 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
358 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
359 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
360 }
361 }
362 then posix_mkdir=:
363 fi
364 rmdir "$tmpdir/d" "$tmpdir"
365 else
366 # Remove any dirs left behind by ancient mkdir implementations.
367 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
368 fi
369 trap '' 0;;
370 esac;;
371 esac
372
373 if
374 $posix_mkdir && (
375 umask $mkdir_umask &&
376 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
377 )
378 then :
379 else
380
381 # The umask is ridiculous, or mkdir does not conform to POSIX,
382 # or it failed possibly due to a race condition. Create the
383 # directory the slow way, step by step, checking for races as we go.
384
385 case $dstdir in
386 /*) prefix='/';;
387 -*) prefix='./';;
388 *) prefix='';;
389 esac
390
391 eval "$initialize_posix_glob"
392
393 oIFS=$IFS
394 IFS=/
395 $posix_glob set -f
396 set fnord $dstdir
397 shift
398 $posix_glob set +f
399 IFS=$oIFS
400
401 prefixes=
402
403 for d
404 do
405 test -z "$d" && continue
406
407 prefix=$prefix$d
408 if test -d "$prefix"; then
409 prefixes=
410 else
411 if $posix_mkdir; then
412 (umask=$mkdir_umask &&
413 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
414 # Don't fail if two instances are running concurrently.
415 test -d "$prefix" || exit 1
416 else
417 case $prefix in
418 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
419 *) qprefix=$prefix;;
420 esac
421 prefixes="$prefixes '$qprefix'"
422 fi
423 fi
424 prefix=$prefix/
425 done
426
427 if test -n "$prefixes"; then
428 # Don't fail if two instances are running concurrently.
429 (umask $mkdir_umask &&
430 eval "\$doit_exec \$mkdirprog $prefixes") ||
431 test -d "$dstdir" || exit 1
432 obsolete_mkdir_used=true
433 fi
434 fi
435 fi
436
437 if test -n "$dir_arg"; then
438 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
439 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
440 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
441 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
442 else
443
444 # Make a couple of temp file names in the proper directory.
445 dsttmp=$dstdir/_inst.$$_
446 rmtmp=$dstdir/_rm.$$_
447
448 # Trap to clean up those temp files at exit.
449 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
450
451 # Copy the file name to the temp name.
452 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453
454 # and set any options; do chmod last to preserve setuid bits.
455 #
456 # If any of these fail, we abort the whole thing. If we want to
457 # ignore errors from any of these, just make sure not to ignore
458 # errors from the above "$doit $cpprog $src $dsttmp" command.
459 #
460 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
461 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
462 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
463 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
464
465 # If -C, don't bother to copy if it wouldn't change the file.
466 if $copy_on_change &&
467 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
468 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
469
470 eval "$initialize_posix_glob" &&
471 $posix_glob set -f &&
472 set X $old && old=:$2:$4:$5:$6 &&
473 set X $new && new=:$2:$4:$5:$6 &&
474 $posix_glob set +f &&
475
476 test "$old" = "$new" &&
477 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
478 then
479 rm -f "$dsttmp"
480 else
481 # Rename the file to the real destination.
482 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
483
484 # The rename failed, perhaps because mv can't rename something else
485 # to itself, or perhaps because mv is so ancient that it does not
486 # support -f.
487 {
488 # Now remove or move aside any old file at destination location.
489 # We try this two ways since rm can't unlink itself on some
490 # systems and the destination file might be busy for other
491 # reasons. In this case, the final cleanup might fail but the new
492 # file should still install successfully.
493 {
494 test ! -f "$dst" ||
495 $doit $rmcmd -f "$dst" 2>/dev/null ||
496 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
497 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
498 } ||
499 { echo "$0: cannot unlink or rename $dst" >&2
500 (exit 1); exit 1
501 }
502 } &&
503
504 # Now rename the file to the real destination.
505 $doit $mvcmd "$dsttmp" "$dst"
506 }
507 fi || exit 1
508
509 trap '' 0
510 fi
511 done
512
513 # Local variables:
514 # eval: (add-hook 'write-file-hooks 'time-stamp)
515 # time-stamp-start: "scriptversion="
516 # time-stamp-format: "%:y-%02m-%02d.%02H"
517 # time-stamp-end: "$"
518 # End:
6161 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
6262 $(libmpcdec_la_LDFLAGS) $(LDFLAGS) -o $@
6363 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
64 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
64 depcomp = $(SHELL) $(top_srcdir)/depcomp
6565 am__depfiles_maybe = depfiles
6666 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
6767 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
314314 }
315315
316316 if (d->chap_nb > 0) {
317 char * ptag;
317318 d->chap = malloc(sizeof(mpc_chap_t) * d->chap_nb + tag_size);
318 char * ptag = (char*)(d->chap + d->chap_nb);
319 ptag = (char*)(d->chap + d->chap_nb);
319320
320321 mpc_demux_seek(d, d->chap_pos, 11);
321322 size = mpc_bits_get_block(&d->bits_reader, &b);
5050 encode_sv7.$(OBJEXT) huffsv7.$(OBJEXT) quant.$(OBJEXT)
5151 libmpcenc_a_OBJECTS = $(am_libmpcenc_a_OBJECTS)
5252 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
53 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
53 depcomp = $(SHELL) $(top_srcdir)/depcomp
5454 am__depfiles_maybe = depfiles
5555 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5656 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
5151 profile.$(OBJEXT)
5252 libmpcpsy_a_OBJECTS = $(am_libmpcpsy_a_OBJECTS)
5353 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
54 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
54 depcomp = $(SHELL) $(top_srcdir)/depcomp
5555 am__depfiles_maybe = depfiles
5656 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5757 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
4747 am_libwavformat_a_OBJECTS = input.$(OBJEXT) output.$(OBJEXT)
4848 libwavformat_a_OBJECTS = $(am_libwavformat_a_OBJECTS)
4949 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
50 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
50 depcomp = $(SHELL) $(top_srcdir)/depcomp
5151 am__depfiles_maybe = depfiles
5252 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5353 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
0 # ltmain.sh - Provide generalized library-building support services.
1 # NOTE: Changing this file will not affect anything until you rerun configure.
2 #
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
4 # 2007, 2008 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 basename="s,^.*/,,g"
27
28 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
29 # is ksh but when the shell is invoked as "sh" and the current value of
30 # the _XPG environment variable is not equal to 1 (one), the special
31 # positional parameter $0, within a function call, is the name of the
32 # function.
33 progpath="$0"
34
35 # The name of this program:
36 progname=`echo "$progpath" | $SED $basename`
37 modename="$progname"
38
39 # Global variables:
40 EXIT_SUCCESS=0
41 EXIT_FAILURE=1
42
43 PROGRAM=ltmain.sh
44 PACKAGE=libtool
45 VERSION="1.5.26 Debian 1.5.26-4"
46 TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
47
48 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
49 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
50 emulate sh
51 NULLCMD=:
52 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
53 # is contrary to our usage. Disable this feature.
54 alias -g '${1+"$@"}'='"$@"'
55 setopt NO_GLOB_SUBST
56 else
57 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
58 fi
59 BIN_SH=xpg4; export BIN_SH # for Tru64
60 DUALCASE=1; export DUALCASE # for MKS sh
61
62 # Check that we have a working $echo.
63 if test "X$1" = X--no-reexec; then
64 # Discard the --no-reexec flag, and continue.
65 shift
66 elif test "X$1" = X--fallback-echo; then
67 # Avoid inline document here, it may be left over
68 :
69 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
70 # Yippee, $echo works!
71 :
72 else
73 # Restart under the correct shell, and then maybe $echo will work.
74 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
75 fi
76
77 if test "X$1" = X--fallback-echo; then
78 # used as fallback echo
79 shift
80 cat <<EOF
81 $*
82 EOF
83 exit $EXIT_SUCCESS
84 fi
85
86 default_mode=
87 help="Try \`$progname --help' for more information."
88 magic="%%%MAGIC variable%%%"
89 mkdir="mkdir"
90 mv="mv -f"
91 rm="rm -f"
92
93 # Sed substitution that helps us do robust quoting. It backslashifies
94 # metacharacters that are still active within double-quoted strings.
95 Xsed="${SED}"' -e 1s/^X//'
96 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
97 # test EBCDIC or ASCII
98 case `echo X|tr X '\101'` in
99 A) # ASCII based system
100 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
101 SP2NL='tr \040 \012'
102 NL2SP='tr \015\012 \040\040'
103 ;;
104 *) # EBCDIC based system
105 SP2NL='tr \100 \n'
106 NL2SP='tr \r\n \100\100'
107 ;;
108 esac
109
110 # NLS nuisances.
111 # Only set LANG and LC_ALL to C if already set.
112 # These must not be set unconditionally because not all systems understand
113 # e.g. LANG=C (notably SCO).
114 # We save the old values to restore during execute mode.
115 lt_env=
116 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
117 do
118 eval "if test \"\${$lt_var+set}\" = set; then
119 save_$lt_var=\$$lt_var
120 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
121 $lt_var=C
122 export $lt_var
123 fi"
124 done
125
126 if test -n "$lt_env"; then
127 lt_env="env $lt_env"
128 fi
129
130 # Make sure IFS has a sensible default
131 lt_nl='
132 '
133 IFS=" $lt_nl"
134
135 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
136 $echo "$modename: not configured to build any kind of library" 1>&2
137 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
138 exit $EXIT_FAILURE
139 fi
140
141 # Global variables.
142 mode=$default_mode
143 nonopt=
144 prev=
145 prevopt=
146 run=
147 show="$echo"
148 show_help=
149 execute_dlfiles=
150 duplicate_deps=no
151 preserve_args=
152 lo2o="s/\\.lo\$/.${objext}/"
153 o2lo="s/\\.${objext}\$/.lo/"
154 extracted_archives=
155 extracted_serial=0
156
157 #####################################
158 # Shell function definitions:
159 # This seems to be the best place for them
160
161 # func_mktempdir [string]
162 # Make a temporary directory that won't clash with other running
163 # libtool processes, and avoids race conditions if possible. If
164 # given, STRING is the basename for that directory.
165 func_mktempdir ()
166 {
167 my_template="${TMPDIR-/tmp}/${1-$progname}"
168
169 if test "$run" = ":"; then
170 # Return a directory name, but don't create it in dry-run mode
171 my_tmpdir="${my_template}-$$"
172 else
173
174 # If mktemp works, use that first and foremost
175 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
176
177 if test ! -d "$my_tmpdir"; then
178 # Failing that, at least try and use $RANDOM to avoid a race
179 my_tmpdir="${my_template}-${RANDOM-0}$$"
180
181 save_mktempdir_umask=`umask`
182 umask 0077
183 $mkdir "$my_tmpdir"
184 umask $save_mktempdir_umask
185 fi
186
187 # If we're not in dry-run mode, bomb out on failure
188 test -d "$my_tmpdir" || {
189 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
190 exit $EXIT_FAILURE
191 }
192 fi
193
194 $echo "X$my_tmpdir" | $Xsed
195 }
196
197
198 # func_win32_libid arg
199 # return the library type of file 'arg'
200 #
201 # Need a lot of goo to handle *both* DLLs and import libs
202 # Has to be a shell function in order to 'eat' the argument
203 # that is supplied when $file_magic_command is called.
204 func_win32_libid ()
205 {
206 win32_libid_type="unknown"
207 win32_fileres=`file -L $1 2>/dev/null`
208 case $win32_fileres in
209 *ar\ archive\ import\ library*) # definitely import
210 win32_libid_type="x86 archive import"
211 ;;
212 *ar\ archive*) # could be an import, or static
213 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
214 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
215 win32_nmres=`eval $NM -f posix -A $1 | \
216 $SED -n -e '1,100{
217 / I /{
218 s,.*,import,
219 p
220 q
221 }
222 }'`
223 case $win32_nmres in
224 import*) win32_libid_type="x86 archive import";;
225 *) win32_libid_type="x86 archive static";;
226 esac
227 fi
228 ;;
229 *DLL*)
230 win32_libid_type="x86 DLL"
231 ;;
232 *executable*) # but shell scripts are "executable" too...
233 case $win32_fileres in
234 *MS\ Windows\ PE\ Intel*)
235 win32_libid_type="x86 DLL"
236 ;;
237 esac
238 ;;
239 esac
240 $echo $win32_libid_type
241 }
242
243
244 # func_infer_tag arg
245 # Infer tagged configuration to use if any are available and
246 # if one wasn't chosen via the "--tag" command line option.
247 # Only attempt this if the compiler in the base compile
248 # command doesn't match the default compiler.
249 # arg is usually of the form 'gcc ...'
250 func_infer_tag ()
251 {
252 if test -n "$available_tags" && test -z "$tagname"; then
253 CC_quoted=
254 for arg in $CC; do
255 case $arg in
256 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
257 arg="\"$arg\""
258 ;;
259 esac
260 CC_quoted="$CC_quoted $arg"
261 done
262 case $@ in
263 # Blanks in the command may have been stripped by the calling shell,
264 # but not from the CC environment variable when configure was run.
265 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
266 # Blanks at the start of $base_compile will cause this to fail
267 # if we don't check for them as well.
268 *)
269 for z in $available_tags; do
270 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
271 # Evaluate the configuration.
272 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
273 CC_quoted=
274 for arg in $CC; do
275 # Double-quote args containing other shell metacharacters.
276 case $arg in
277 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
278 arg="\"$arg\""
279 ;;
280 esac
281 CC_quoted="$CC_quoted $arg"
282 done
283 case "$@ " in
284 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
285 # The compiler in the base compile command matches
286 # the one in the tagged configuration.
287 # Assume this is the tagged configuration we want.
288 tagname=$z
289 break
290 ;;
291 esac
292 fi
293 done
294 # If $tagname still isn't set, then no tagged configuration
295 # was found and let the user know that the "--tag" command
296 # line option must be used.
297 if test -z "$tagname"; then
298 $echo "$modename: unable to infer tagged configuration"
299 $echo "$modename: specify a tag with \`--tag'" 1>&2
300 exit $EXIT_FAILURE
301 # else
302 # $echo "$modename: using $tagname tagged configuration"
303 fi
304 ;;
305 esac
306 fi
307 }
308
309
310 # func_extract_an_archive dir oldlib
311 func_extract_an_archive ()
312 {
313 f_ex_an_ar_dir="$1"; shift
314 f_ex_an_ar_oldlib="$1"
315
316 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
317 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
318 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
319 :
320 else
321 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
322 exit $EXIT_FAILURE
323 fi
324 }
325
326 # func_extract_archives gentop oldlib ...
327 func_extract_archives ()
328 {
329 my_gentop="$1"; shift
330 my_oldlibs=${1+"$@"}
331 my_oldobjs=""
332 my_xlib=""
333 my_xabs=""
334 my_xdir=""
335 my_status=""
336
337 $show "${rm}r $my_gentop"
338 $run ${rm}r "$my_gentop"
339 $show "$mkdir $my_gentop"
340 $run $mkdir "$my_gentop"
341 my_status=$?
342 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
343 exit $my_status
344 fi
345
346 for my_xlib in $my_oldlibs; do
347 # Extract the objects.
348 case $my_xlib in
349 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
350 *) my_xabs=`pwd`"/$my_xlib" ;;
351 esac
352 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
353 my_xlib_u=$my_xlib
354 while :; do
355 case " $extracted_archives " in
356 *" $my_xlib_u "*)
357 extracted_serial=`expr $extracted_serial + 1`
358 my_xlib_u=lt$extracted_serial-$my_xlib ;;
359 *) break ;;
360 esac
361 done
362 extracted_archives="$extracted_archives $my_xlib_u"
363 my_xdir="$my_gentop/$my_xlib_u"
364
365 $show "${rm}r $my_xdir"
366 $run ${rm}r "$my_xdir"
367 $show "$mkdir $my_xdir"
368 $run $mkdir "$my_xdir"
369 exit_status=$?
370 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
371 exit $exit_status
372 fi
373 case $host in
374 *-darwin*)
375 $show "Extracting $my_xabs"
376 # Do not bother doing anything if just a dry run
377 if test -z "$run"; then
378 darwin_orig_dir=`pwd`
379 cd $my_xdir || exit $?
380 darwin_archive=$my_xabs
381 darwin_curdir=`pwd`
382 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
383 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
384 if test -n "$darwin_arches"; then
385 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
386 darwin_arch=
387 $show "$darwin_base_archive has multiple architectures $darwin_arches"
388 for darwin_arch in $darwin_arches ; do
389 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
390 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
391 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
392 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
393 cd "$darwin_curdir"
394 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
395 done # $darwin_arches
396 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
397 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
398 darwin_file=
399 darwin_files=
400 for darwin_file in $darwin_filelist; do
401 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
402 lipo -create -output "$darwin_file" $darwin_files
403 done # $darwin_filelist
404 ${rm}r unfat-$$
405 cd "$darwin_orig_dir"
406 else
407 cd "$darwin_orig_dir"
408 func_extract_an_archive "$my_xdir" "$my_xabs"
409 fi # $darwin_arches
410 fi # $run
411 ;;
412 *)
413 func_extract_an_archive "$my_xdir" "$my_xabs"
414 ;;
415 esac
416 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
417 done
418 func_extract_archives_result="$my_oldobjs"
419 }
420 # End of Shell function definitions
421 #####################################
422
423 # Darwin sucks
424 eval std_shrext=\"$shrext_cmds\"
425
426 disable_libs=no
427
428 # Parse our command line options once, thoroughly.
429 while test "$#" -gt 0
430 do
431 arg="$1"
432 shift
433
434 case $arg in
435 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
436 *) optarg= ;;
437 esac
438
439 # If the previous option needs an argument, assign it.
440 if test -n "$prev"; then
441 case $prev in
442 execute_dlfiles)
443 execute_dlfiles="$execute_dlfiles $arg"
444 ;;
445 tag)
446 tagname="$arg"
447 preserve_args="${preserve_args}=$arg"
448
449 # Check whether tagname contains only valid characters
450 case $tagname in
451 *[!-_A-Za-z0-9,/]*)
452 $echo "$progname: invalid tag name: $tagname" 1>&2
453 exit $EXIT_FAILURE
454 ;;
455 esac
456
457 case $tagname in
458 CC)
459 # Don't test for the "default" C tag, as we know, it's there, but
460 # not specially marked.
461 ;;
462 *)
463 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
464 taglist="$taglist $tagname"
465 # Evaluate the configuration.
466 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
467 else
468 $echo "$progname: ignoring unknown tag $tagname" 1>&2
469 fi
470 ;;
471 esac
472 ;;
473 *)
474 eval "$prev=\$arg"
475 ;;
476 esac
477
478 prev=
479 prevopt=
480 continue
481 fi
482
483 # Have we seen a non-optional argument yet?
484 case $arg in
485 --help)
486 show_help=yes
487 ;;
488
489 --version)
490 echo "\
491 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
492
493 Copyright (C) 2008 Free Software Foundation, Inc.
494 This is free software; see the source for copying conditions. There is NO
495 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
496 exit $?
497 ;;
498
499 --config)
500 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
501 # Now print the configurations for the tags.
502 for tagname in $taglist; do
503 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
504 done
505 exit $?
506 ;;
507
508 --debug)
509 $echo "$progname: enabling shell trace mode"
510 set -x
511 preserve_args="$preserve_args $arg"
512 ;;
513
514 --dry-run | -n)
515 run=:
516 ;;
517
518 --features)
519 $echo "host: $host"
520 if test "$build_libtool_libs" = yes; then
521 $echo "enable shared libraries"
522 else
523 $echo "disable shared libraries"
524 fi
525 if test "$build_old_libs" = yes; then
526 $echo "enable static libraries"
527 else
528 $echo "disable static libraries"
529 fi
530 exit $?
531 ;;
532
533 --finish) mode="finish" ;;
534
535 --mode) prevopt="--mode" prev=mode ;;
536 --mode=*) mode="$optarg" ;;
537
538 --preserve-dup-deps) duplicate_deps="yes" ;;
539
540 --quiet | --silent)
541 show=:
542 preserve_args="$preserve_args $arg"
543 ;;
544
545 --tag)
546 prevopt="--tag"
547 prev=tag
548 preserve_args="$preserve_args --tag"
549 ;;
550 --tag=*)
551 set tag "$optarg" ${1+"$@"}
552 shift
553 prev=tag
554 preserve_args="$preserve_args --tag"
555 ;;
556
557 -dlopen)
558 prevopt="-dlopen"
559 prev=execute_dlfiles
560 ;;
561
562 -*)
563 $echo "$modename: unrecognized option \`$arg'" 1>&2
564 $echo "$help" 1>&2
565 exit $EXIT_FAILURE
566 ;;
567
568 *)
569 nonopt="$arg"
570 break
571 ;;
572 esac
573 done
574
575 if test -n "$prevopt"; then
576 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
577 $echo "$help" 1>&2
578 exit $EXIT_FAILURE
579 fi
580
581 case $disable_libs in
582 no)
583 ;;
584 shared)
585 build_libtool_libs=no
586 build_old_libs=yes
587 ;;
588 static)
589 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
590 ;;
591 esac
592
593 # If this variable is set in any of the actions, the command in it
594 # will be execed at the end. This prevents here-documents from being
595 # left over by shells.
596 exec_cmd=
597
598 if test -z "$show_help"; then
599
600 # Infer the operation mode.
601 if test -z "$mode"; then
602 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
603 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
604 case $nonopt in
605 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
606 mode=link
607 for arg
608 do
609 case $arg in
610 -c)
611 mode=compile
612 break
613 ;;
614 esac
615 done
616 ;;
617 *db | *dbx | *strace | *truss)
618 mode=execute
619 ;;
620 *install*|cp|mv)
621 mode=install
622 ;;
623 *rm)
624 mode=uninstall
625 ;;
626 *)
627 # If we have no mode, but dlfiles were specified, then do execute mode.
628 test -n "$execute_dlfiles" && mode=execute
629
630 # Just use the default operation mode.
631 if test -z "$mode"; then
632 if test -n "$nonopt"; then
633 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
634 else
635 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
636 fi
637 fi
638 ;;
639 esac
640 fi
641
642 # Only execute mode is allowed to have -dlopen flags.
643 if test -n "$execute_dlfiles" && test "$mode" != execute; then
644 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
645 $echo "$help" 1>&2
646 exit $EXIT_FAILURE
647 fi
648
649 # Change the help message to a mode-specific one.
650 generic_help="$help"
651 help="Try \`$modename --help --mode=$mode' for more information."
652
653 # These modes are in order of execution frequency so that they run quickly.
654 case $mode in
655 # libtool compile mode
656 compile)
657 modename="$modename: compile"
658 # Get the compilation command and the source file.
659 base_compile=
660 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
661 suppress_opt=yes
662 suppress_output=
663 arg_mode=normal
664 libobj=
665 later=
666
667 for arg
668 do
669 case $arg_mode in
670 arg )
671 # do not "continue". Instead, add this to base_compile
672 lastarg="$arg"
673 arg_mode=normal
674 ;;
675
676 target )
677 libobj="$arg"
678 arg_mode=normal
679 continue
680 ;;
681
682 normal )
683 # Accept any command-line options.
684 case $arg in
685 -o)
686 if test -n "$libobj" ; then
687 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
688 exit $EXIT_FAILURE
689 fi
690 arg_mode=target
691 continue
692 ;;
693
694 -static | -prefer-pic | -prefer-non-pic)
695 later="$later $arg"
696 continue
697 ;;
698
699 -no-suppress)
700 suppress_opt=no
701 continue
702 ;;
703
704 -Xcompiler)
705 arg_mode=arg # the next one goes into the "base_compile" arg list
706 continue # The current "srcfile" will either be retained or
707 ;; # replaced later. I would guess that would be a bug.
708
709 -Wc,*)
710 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
711 lastarg=
712 save_ifs="$IFS"; IFS=','
713 for arg in $args; do
714 IFS="$save_ifs"
715
716 # Double-quote args containing other shell metacharacters.
717 # Many Bourne shells cannot handle close brackets correctly
718 # in scan sets, so we specify it separately.
719 case $arg in
720 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
721 arg="\"$arg\""
722 ;;
723 esac
724 lastarg="$lastarg $arg"
725 done
726 IFS="$save_ifs"
727 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
728
729 # Add the arguments to base_compile.
730 base_compile="$base_compile $lastarg"
731 continue
732 ;;
733
734 * )
735 # Accept the current argument as the source file.
736 # The previous "srcfile" becomes the current argument.
737 #
738 lastarg="$srcfile"
739 srcfile="$arg"
740 ;;
741 esac # case $arg
742 ;;
743 esac # case $arg_mode
744
745 # Aesthetically quote the previous argument.
746 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
747
748 case $lastarg in
749 # Double-quote args containing other shell metacharacters.
750 # Many Bourne shells cannot handle close brackets correctly
751 # in scan sets, and some SunOS ksh mistreat backslash-escaping
752 # in scan sets (worked around with variable expansion),
753 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
754 # at all, so we specify them separately.
755 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
756 lastarg="\"$lastarg\""
757 ;;
758 esac
759
760 base_compile="$base_compile $lastarg"
761 done # for arg
762
763 case $arg_mode in
764 arg)
765 $echo "$modename: you must specify an argument for -Xcompile"
766 exit $EXIT_FAILURE
767 ;;
768 target)
769 $echo "$modename: you must specify a target with \`-o'" 1>&2
770 exit $EXIT_FAILURE
771 ;;
772 *)
773 # Get the name of the library object.
774 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
775 ;;
776 esac
777
778 # Recognize several different file suffixes.
779 # If the user specifies -o file.o, it is replaced with file.lo
780 xform='[cCFSifmso]'
781 case $libobj in
782 *.ada) xform=ada ;;
783 *.adb) xform=adb ;;
784 *.ads) xform=ads ;;
785 *.asm) xform=asm ;;
786 *.c++) xform=c++ ;;
787 *.cc) xform=cc ;;
788 *.ii) xform=ii ;;
789 *.class) xform=class ;;
790 *.cpp) xform=cpp ;;
791 *.cxx) xform=cxx ;;
792 *.[fF][09]?) xform=[fF][09]. ;;
793 *.for) xform=for ;;
794 *.java) xform=java ;;
795 *.obj) xform=obj ;;
796 *.sx) xform=sx ;;
797 esac
798
799 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
800
801 case $libobj in
802 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
803 *)
804 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
805 exit $EXIT_FAILURE
806 ;;
807 esac
808
809 func_infer_tag $base_compile
810
811 for arg in $later; do
812 case $arg in
813 -static)
814 build_old_libs=yes
815 continue
816 ;;
817
818 -prefer-pic)
819 pic_mode=yes
820 continue
821 ;;
822
823 -prefer-non-pic)
824 pic_mode=no
825 continue
826 ;;
827 esac
828 done
829
830 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
831 case $qlibobj in
832 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
833 qlibobj="\"$qlibobj\"" ;;
834 esac
835 test "X$libobj" != "X$qlibobj" \
836 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
837 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
838 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
839 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
840 if test "X$xdir" = "X$obj"; then
841 xdir=
842 else
843 xdir=$xdir/
844 fi
845 lobj=${xdir}$objdir/$objname
846
847 if test -z "$base_compile"; then
848 $echo "$modename: you must specify a compilation command" 1>&2
849 $echo "$help" 1>&2
850 exit $EXIT_FAILURE
851 fi
852
853 # Delete any leftover library objects.
854 if test "$build_old_libs" = yes; then
855 removelist="$obj $lobj $libobj ${libobj}T"
856 else
857 removelist="$lobj $libobj ${libobj}T"
858 fi
859
860 $run $rm $removelist
861 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
862
863 # On Cygwin there's no "real" PIC flag so we must build both object types
864 case $host_os in
865 cygwin* | mingw* | pw32* | os2*)
866 pic_mode=default
867 ;;
868 esac
869 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
870 # non-PIC code in shared libraries is not supported
871 pic_mode=default
872 fi
873
874 # Calculate the filename of the output object if compiler does
875 # not support -o with -c
876 if test "$compiler_c_o" = no; then
877 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
878 lockfile="$output_obj.lock"
879 removelist="$removelist $output_obj $lockfile"
880 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
881 else
882 output_obj=
883 need_locks=no
884 lockfile=
885 fi
886
887 # Lock this critical section if it is needed
888 # We use this script file to make the link, it avoids creating a new file
889 if test "$need_locks" = yes; then
890 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
891 $show "Waiting for $lockfile to be removed"
892 sleep 2
893 done
894 elif test "$need_locks" = warn; then
895 if test -f "$lockfile"; then
896 $echo "\
897 *** ERROR, $lockfile exists and contains:
898 `cat $lockfile 2>/dev/null`
899
900 This indicates that another process is trying to use the same
901 temporary object file, and libtool could not work around it because
902 your compiler does not support \`-c' and \`-o' together. If you
903 repeat this compilation, it may succeed, by chance, but you had better
904 avoid parallel builds (make -j) in this platform, or get a better
905 compiler."
906
907 $run $rm $removelist
908 exit $EXIT_FAILURE
909 fi
910 $echo "$srcfile" > "$lockfile"
911 fi
912
913 if test -n "$fix_srcfile_path"; then
914 eval srcfile=\"$fix_srcfile_path\"
915 fi
916 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
917 case $qsrcfile in
918 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
919 qsrcfile="\"$qsrcfile\"" ;;
920 esac
921
922 $run $rm "$libobj" "${libobj}T"
923
924 # Create a libtool object file (analogous to a ".la" file),
925 # but don't create it if we're doing a dry run.
926 test -z "$run" && cat > ${libobj}T <<EOF
927 # $libobj - a libtool object file
928 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
929 #
930 # Please DO NOT delete this file!
931 # It is necessary for linking the library.
932
933 # Name of the PIC object.
934 EOF
935
936 # Only build a PIC object if we are building libtool libraries.
937 if test "$build_libtool_libs" = yes; then
938 # Without this assignment, base_compile gets emptied.
939 fbsd_hideous_sh_bug=$base_compile
940
941 if test "$pic_mode" != no; then
942 command="$base_compile $qsrcfile $pic_flag"
943 else
944 # Don't build PIC code
945 command="$base_compile $qsrcfile"
946 fi
947
948 if test ! -d "${xdir}$objdir"; then
949 $show "$mkdir ${xdir}$objdir"
950 $run $mkdir ${xdir}$objdir
951 exit_status=$?
952 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
953 exit $exit_status
954 fi
955 fi
956
957 if test -z "$output_obj"; then
958 # Place PIC objects in $objdir
959 command="$command -o $lobj"
960 fi
961
962 $run $rm "$lobj" "$output_obj"
963
964 $show "$command"
965 if $run eval $lt_env "$command"; then :
966 else
967 test -n "$output_obj" && $run $rm $removelist
968 exit $EXIT_FAILURE
969 fi
970
971 if test "$need_locks" = warn &&
972 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
973 $echo "\
974 *** ERROR, $lockfile contains:
975 `cat $lockfile 2>/dev/null`
976
977 but it should contain:
978 $srcfile
979
980 This indicates that another process is trying to use the same
981 temporary object file, and libtool could not work around it because
982 your compiler does not support \`-c' and \`-o' together. If you
983 repeat this compilation, it may succeed, by chance, but you had better
984 avoid parallel builds (make -j) in this platform, or get a better
985 compiler."
986
987 $run $rm $removelist
988 exit $EXIT_FAILURE
989 fi
990
991 # Just move the object if needed, then go on to compile the next one
992 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
993 $show "$mv $output_obj $lobj"
994 if $run $mv $output_obj $lobj; then :
995 else
996 error=$?
997 $run $rm $removelist
998 exit $error
999 fi
1000 fi
1001
1002 # Append the name of the PIC object to the libtool object file.
1003 test -z "$run" && cat >> ${libobj}T <<EOF
1004 pic_object='$objdir/$objname'
1005
1006 EOF
1007
1008 # Allow error messages only from the first compilation.
1009 if test "$suppress_opt" = yes; then
1010 suppress_output=' >/dev/null 2>&1'
1011 fi
1012 else
1013 # No PIC object so indicate it doesn't exist in the libtool
1014 # object file.
1015 test -z "$run" && cat >> ${libobj}T <<EOF
1016 pic_object=none
1017
1018 EOF
1019 fi
1020
1021 # Only build a position-dependent object if we build old libraries.
1022 if test "$build_old_libs" = yes; then
1023 if test "$pic_mode" != yes; then
1024 # Don't build PIC code
1025 command="$base_compile $qsrcfile"
1026 else
1027 command="$base_compile $qsrcfile $pic_flag"
1028 fi
1029 if test "$compiler_c_o" = yes; then
1030 command="$command -o $obj"
1031 fi
1032
1033 # Suppress compiler output if we already did a PIC compilation.
1034 command="$command$suppress_output"
1035 $run $rm "$obj" "$output_obj"
1036 $show "$command"
1037 if $run eval $lt_env "$command"; then :
1038 else
1039 $run $rm $removelist
1040 exit $EXIT_FAILURE
1041 fi
1042
1043 if test "$need_locks" = warn &&
1044 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1045 $echo "\
1046 *** ERROR, $lockfile contains:
1047 `cat $lockfile 2>/dev/null`
1048
1049 but it should contain:
1050 $srcfile
1051
1052 This indicates that another process is trying to use the same
1053 temporary object file, and libtool could not work around it because
1054 your compiler does not support \`-c' and \`-o' together. If you
1055 repeat this compilation, it may succeed, by chance, but you had better
1056 avoid parallel builds (make -j) in this platform, or get a better
1057 compiler."
1058
1059 $run $rm $removelist
1060 exit $EXIT_FAILURE
1061 fi
1062
1063 # Just move the object if needed
1064 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1065 $show "$mv $output_obj $obj"
1066 if $run $mv $output_obj $obj; then :
1067 else
1068 error=$?
1069 $run $rm $removelist
1070 exit $error
1071 fi
1072 fi
1073
1074 # Append the name of the non-PIC object the libtool object file.
1075 # Only append if the libtool object file exists.
1076 test -z "$run" && cat >> ${libobj}T <<EOF
1077 # Name of the non-PIC object.
1078 non_pic_object='$objname'
1079
1080 EOF
1081 else
1082 # Append the name of the non-PIC object the libtool object file.
1083 # Only append if the libtool object file exists.
1084 test -z "$run" && cat >> ${libobj}T <<EOF
1085 # Name of the non-PIC object.
1086 non_pic_object=none
1087
1088 EOF
1089 fi
1090
1091 $run $mv "${libobj}T" "${libobj}"
1092
1093 # Unlock the critical section if it was locked
1094 if test "$need_locks" != no; then
1095 $run $rm "$lockfile"
1096 fi
1097
1098 exit $EXIT_SUCCESS
1099 ;;
1100
1101 # libtool link mode
1102 link | relink)
1103 modename="$modename: link"
1104 case $host in
1105 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1106 # It is impossible to link a dll without this setting, and
1107 # we shouldn't force the makefile maintainer to figure out
1108 # which system we are compiling for in order to pass an extra
1109 # flag for every libtool invocation.
1110 # allow_undefined=no
1111
1112 # FIXME: Unfortunately, there are problems with the above when trying
1113 # to make a dll which has undefined symbols, in which case not
1114 # even a static library is built. For now, we need to specify
1115 # -no-undefined on the libtool link line when we can be certain
1116 # that all symbols are satisfied, otherwise we get a static library.
1117 allow_undefined=yes
1118 ;;
1119 *)
1120 allow_undefined=yes
1121 ;;
1122 esac
1123 libtool_args="$nonopt"
1124 base_compile="$nonopt $@"
1125 compile_command="$nonopt"
1126 finalize_command="$nonopt"
1127
1128 compile_rpath=
1129 finalize_rpath=
1130 compile_shlibpath=
1131 finalize_shlibpath=
1132 convenience=
1133 old_convenience=
1134 deplibs=
1135 old_deplibs=
1136 compiler_flags=
1137 linker_flags=
1138 dllsearchpath=
1139 lib_search_path=`pwd`
1140 inst_prefix_dir=
1141
1142 avoid_version=no
1143 dlfiles=
1144 dlprefiles=
1145 dlself=no
1146 export_dynamic=no
1147 export_symbols=
1148 export_symbols_regex=
1149 generated=
1150 libobjs=
1151 ltlibs=
1152 module=no
1153 no_install=no
1154 objs=
1155 non_pic_objects=
1156 notinst_path= # paths that contain not-installed libtool libraries
1157 precious_files_regex=
1158 prefer_static_libs=no
1159 preload=no
1160 prev=
1161 prevarg=
1162 release=
1163 rpath=
1164 xrpath=
1165 perm_rpath=
1166 temp_rpath=
1167 thread_safe=no
1168 vinfo=
1169 vinfo_number=no
1170 single_module="${wl}-single_module"
1171
1172 func_infer_tag $base_compile
1173
1174 # We need to know -static, to get the right output filenames.
1175 for arg
1176 do
1177 case $arg in
1178 -all-static | -static | -static-libtool-libs)
1179 case $arg in
1180 -all-static)
1181 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1182 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1183 fi
1184 if test -n "$link_static_flag"; then
1185 dlopen_self=$dlopen_self_static
1186 fi
1187 prefer_static_libs=yes
1188 ;;
1189 -static)
1190 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1191 dlopen_self=$dlopen_self_static
1192 fi
1193 prefer_static_libs=built
1194 ;;
1195 -static-libtool-libs)
1196 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1197 dlopen_self=$dlopen_self_static
1198 fi
1199 prefer_static_libs=yes
1200 ;;
1201 esac
1202 build_libtool_libs=no
1203 build_old_libs=yes
1204 break
1205 ;;
1206 esac
1207 done
1208
1209 # See if our shared archives depend on static archives.
1210 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1211
1212 # Go through the arguments, transforming them on the way.
1213 while test "$#" -gt 0; do
1214 arg="$1"
1215 shift
1216 case $arg in
1217 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1218 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1219 ;;
1220 *) qarg=$arg ;;
1221 esac
1222 libtool_args="$libtool_args $qarg"
1223
1224 # If the previous option needs an argument, assign it.
1225 if test -n "$prev"; then
1226 case $prev in
1227 output)
1228 compile_command="$compile_command @OUTPUT@"
1229 finalize_command="$finalize_command @OUTPUT@"
1230 ;;
1231 esac
1232
1233 case $prev in
1234 dlfiles|dlprefiles)
1235 if test "$preload" = no; then
1236 # Add the symbol object into the linking commands.
1237 compile_command="$compile_command @SYMFILE@"
1238 finalize_command="$finalize_command @SYMFILE@"
1239 preload=yes
1240 fi
1241 case $arg in
1242 *.la | *.lo) ;; # We handle these cases below.
1243 force)
1244 if test "$dlself" = no; then
1245 dlself=needless
1246 export_dynamic=yes
1247 fi
1248 prev=
1249 continue
1250 ;;
1251 self)
1252 if test "$prev" = dlprefiles; then
1253 dlself=yes
1254 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1255 dlself=yes
1256 else
1257 dlself=needless
1258 export_dynamic=yes
1259 fi
1260 prev=
1261 continue
1262 ;;
1263 *)
1264 if test "$prev" = dlfiles; then
1265 dlfiles="$dlfiles $arg"
1266 else
1267 dlprefiles="$dlprefiles $arg"
1268 fi
1269 prev=
1270 continue
1271 ;;
1272 esac
1273 ;;
1274 expsyms)
1275 export_symbols="$arg"
1276 if test ! -f "$arg"; then
1277 $echo "$modename: symbol file \`$arg' does not exist"
1278 exit $EXIT_FAILURE
1279 fi
1280 prev=
1281 continue
1282 ;;
1283 expsyms_regex)
1284 export_symbols_regex="$arg"
1285 prev=
1286 continue
1287 ;;
1288 inst_prefix)
1289 inst_prefix_dir="$arg"
1290 prev=
1291 continue
1292 ;;
1293 precious_regex)
1294 precious_files_regex="$arg"
1295 prev=
1296 continue
1297 ;;
1298 release)
1299 release="-$arg"
1300 prev=
1301 continue
1302 ;;
1303 objectlist)
1304 if test -f "$arg"; then
1305 save_arg=$arg
1306 moreargs=
1307 for fil in `cat $save_arg`
1308 do
1309 # moreargs="$moreargs $fil"
1310 arg=$fil
1311 # A libtool-controlled object.
1312
1313 # Check to see that this really is a libtool object.
1314 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1315 pic_object=
1316 non_pic_object=
1317
1318 # Read the .lo file
1319 # If there is no directory component, then add one.
1320 case $arg in
1321 */* | *\\*) . $arg ;;
1322 *) . ./$arg ;;
1323 esac
1324
1325 if test -z "$pic_object" || \
1326 test -z "$non_pic_object" ||
1327 test "$pic_object" = none && \
1328 test "$non_pic_object" = none; then
1329 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1330 exit $EXIT_FAILURE
1331 fi
1332
1333 # Extract subdirectory from the argument.
1334 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1335 if test "X$xdir" = "X$arg"; then
1336 xdir=
1337 else
1338 xdir="$xdir/"
1339 fi
1340
1341 if test "$pic_object" != none; then
1342 # Prepend the subdirectory the object is found in.
1343 pic_object="$xdir$pic_object"
1344
1345 if test "$prev" = dlfiles; then
1346 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1347 dlfiles="$dlfiles $pic_object"
1348 prev=
1349 continue
1350 else
1351 # If libtool objects are unsupported, then we need to preload.
1352 prev=dlprefiles
1353 fi
1354 fi
1355
1356 # CHECK ME: I think I busted this. -Ossama
1357 if test "$prev" = dlprefiles; then
1358 # Preload the old-style object.
1359 dlprefiles="$dlprefiles $pic_object"
1360 prev=
1361 fi
1362
1363 # A PIC object.
1364 libobjs="$libobjs $pic_object"
1365 arg="$pic_object"
1366 fi
1367
1368 # Non-PIC object.
1369 if test "$non_pic_object" != none; then
1370 # Prepend the subdirectory the object is found in.
1371 non_pic_object="$xdir$non_pic_object"
1372
1373 # A standard non-PIC object
1374 non_pic_objects="$non_pic_objects $non_pic_object"
1375 if test -z "$pic_object" || test "$pic_object" = none ; then
1376 arg="$non_pic_object"
1377 fi
1378 else
1379 # If the PIC object exists, use it instead.
1380 # $xdir was prepended to $pic_object above.
1381 non_pic_object="$pic_object"
1382 non_pic_objects="$non_pic_objects $non_pic_object"
1383 fi
1384 else
1385 # Only an error if not doing a dry-run.
1386 if test -z "$run"; then
1387 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1388 exit $EXIT_FAILURE
1389 else
1390 # Dry-run case.
1391
1392 # Extract subdirectory from the argument.
1393 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1394 if test "X$xdir" = "X$arg"; then
1395 xdir=
1396 else
1397 xdir="$xdir/"
1398 fi
1399
1400 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1401 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1402 libobjs="$libobjs $pic_object"
1403 non_pic_objects="$non_pic_objects $non_pic_object"
1404 fi
1405 fi
1406 done
1407 else
1408 $echo "$modename: link input file \`$save_arg' does not exist"
1409 exit $EXIT_FAILURE
1410 fi
1411 arg=$save_arg
1412 prev=
1413 continue
1414 ;;
1415 rpath | xrpath)
1416 # We need an absolute path.
1417 case $arg in
1418 [\\/]* | [A-Za-z]:[\\/]*) ;;
1419 *)
1420 $echo "$modename: only absolute run-paths are allowed" 1>&2
1421 exit $EXIT_FAILURE
1422 ;;
1423 esac
1424 if test "$prev" = rpath; then
1425 case "$rpath " in
1426 *" $arg "*) ;;
1427 *) rpath="$rpath $arg" ;;
1428 esac
1429 else
1430 case "$xrpath " in
1431 *" $arg "*) ;;
1432 *) xrpath="$xrpath $arg" ;;
1433 esac
1434 fi
1435 prev=
1436 continue
1437 ;;
1438 xcompiler)
1439 compiler_flags="$compiler_flags $qarg"
1440 prev=
1441 compile_command="$compile_command $qarg"
1442 finalize_command="$finalize_command $qarg"
1443 continue
1444 ;;
1445 xlinker)
1446 linker_flags="$linker_flags $qarg"
1447 compiler_flags="$compiler_flags $wl$qarg"
1448 prev=
1449 compile_command="$compile_command $wl$qarg"
1450 finalize_command="$finalize_command $wl$qarg"
1451 continue
1452 ;;
1453 xcclinker)
1454 linker_flags="$linker_flags $qarg"
1455 compiler_flags="$compiler_flags $qarg"
1456 prev=
1457 compile_command="$compile_command $qarg"
1458 finalize_command="$finalize_command $qarg"
1459 continue
1460 ;;
1461 shrext)
1462 shrext_cmds="$arg"
1463 prev=
1464 continue
1465 ;;
1466 darwin_framework|darwin_framework_skip)
1467 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1468 compile_command="$compile_command $arg"
1469 finalize_command="$finalize_command $arg"
1470 prev=
1471 continue
1472 ;;
1473 *)
1474 eval "$prev=\"\$arg\""
1475 prev=
1476 continue
1477 ;;
1478 esac
1479 fi # test -n "$prev"
1480
1481 prevarg="$arg"
1482
1483 case $arg in
1484 -all-static)
1485 if test -n "$link_static_flag"; then
1486 compile_command="$compile_command $link_static_flag"
1487 finalize_command="$finalize_command $link_static_flag"
1488 fi
1489 continue
1490 ;;
1491
1492 -allow-undefined)
1493 # FIXME: remove this flag sometime in the future.
1494 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1495 continue
1496 ;;
1497
1498 -avoid-version)
1499 avoid_version=yes
1500 continue
1501 ;;
1502
1503 -dlopen)
1504 prev=dlfiles
1505 continue
1506 ;;
1507
1508 -dlpreopen)
1509 prev=dlprefiles
1510 continue
1511 ;;
1512
1513 -export-dynamic)
1514 export_dynamic=yes
1515 continue
1516 ;;
1517
1518 -export-symbols | -export-symbols-regex)
1519 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1520 $echo "$modename: more than one -exported-symbols argument is not allowed"
1521 exit $EXIT_FAILURE
1522 fi
1523 if test "X$arg" = "X-export-symbols"; then
1524 prev=expsyms
1525 else
1526 prev=expsyms_regex
1527 fi
1528 continue
1529 ;;
1530
1531 -framework|-arch|-isysroot)
1532 case " $CC " in
1533 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1534 prev=darwin_framework_skip ;;
1535 *) compiler_flags="$compiler_flags $arg"
1536 prev=darwin_framework ;;
1537 esac
1538 compile_command="$compile_command $arg"
1539 finalize_command="$finalize_command $arg"
1540 continue
1541 ;;
1542
1543 -inst-prefix-dir)
1544 prev=inst_prefix
1545 continue
1546 ;;
1547
1548 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1549 # so, if we see these flags be careful not to treat them like -L
1550 -L[A-Z][A-Z]*:*)
1551 case $with_gcc/$host in
1552 no/*-*-irix* | /*-*-irix*)
1553 compile_command="$compile_command $arg"
1554 finalize_command="$finalize_command $arg"
1555 ;;
1556 esac
1557 continue
1558 ;;
1559
1560 -L*)
1561 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1562 # We need an absolute path.
1563 case $dir in
1564 [\\/]* | [A-Za-z]:[\\/]*) ;;
1565 *)
1566 absdir=`cd "$dir" && pwd`
1567 if test -z "$absdir"; then
1568 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1569 absdir="$dir"
1570 notinst_path="$notinst_path $dir"
1571 fi
1572 dir="$absdir"
1573 ;;
1574 esac
1575 case "$deplibs " in
1576 *" -L$dir "*) ;;
1577 *)
1578 deplibs="$deplibs -L$dir"
1579 lib_search_path="$lib_search_path $dir"
1580 ;;
1581 esac
1582 case $host in
1583 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1584 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1585 case :$dllsearchpath: in
1586 *":$dir:"*) ;;
1587 *) dllsearchpath="$dllsearchpath:$dir";;
1588 esac
1589 case :$dllsearchpath: in
1590 *":$testbindir:"*) ;;
1591 *) dllsearchpath="$dllsearchpath:$testbindir";;
1592 esac
1593 ;;
1594 esac
1595 continue
1596 ;;
1597
1598 -l*)
1599 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1600 case $host in
1601 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1602 # These systems don't actually have a C or math library (as such)
1603 continue
1604 ;;
1605 *-*-os2*)
1606 # These systems don't actually have a C library (as such)
1607 test "X$arg" = "X-lc" && continue
1608 ;;
1609 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1610 # Do not include libc due to us having libc/libc_r.
1611 test "X$arg" = "X-lc" && continue
1612 ;;
1613 *-*-rhapsody* | *-*-darwin1.[012])
1614 # Rhapsody C and math libraries are in the System framework
1615 deplibs="$deplibs -framework System"
1616 continue
1617 ;;
1618 *-*-sco3.2v5* | *-*-sco5v6*)
1619 # Causes problems with __ctype
1620 test "X$arg" = "X-lc" && continue
1621 ;;
1622 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1623 # Compiler inserts libc in the correct place for threads to work
1624 test "X$arg" = "X-lc" && continue
1625 ;;
1626 esac
1627 elif test "X$arg" = "X-lc_r"; then
1628 case $host in
1629 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1630 # Do not include libc_r directly, use -pthread flag.
1631 continue
1632 ;;
1633 esac
1634 fi
1635 deplibs="$deplibs $arg"
1636 continue
1637 ;;
1638
1639 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1640 # classes, name mangling, and exception handling.
1641 -model)
1642 compile_command="$compile_command $arg"
1643 compiler_flags="$compiler_flags $arg"
1644 finalize_command="$finalize_command $arg"
1645 prev=xcompiler
1646 continue
1647 ;;
1648
1649 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1650 compiler_flags="$compiler_flags $arg"
1651 compile_command="$compile_command $arg"
1652 finalize_command="$finalize_command $arg"
1653 continue
1654 ;;
1655
1656 -multi_module)
1657 single_module="${wl}-multi_module"
1658 continue
1659 ;;
1660
1661 -module)
1662 module=yes
1663 continue
1664 ;;
1665
1666 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1667 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1668 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1669 # +DA*, +DD* enable 64-bit mode on the HP compiler
1670 # -q* pass through compiler args for the IBM compiler
1671 # -m* pass through architecture-specific compiler args for GCC
1672 # -m*, -t[45]*, -txscale* pass through architecture-specific
1673 # compiler args for GCC
1674 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1675 # -F/path gives path to uninstalled frameworks, gcc on darwin
1676 # @file GCC response files
1677 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1678 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
1679
1680 # Unknown arguments in both finalize_command and compile_command need
1681 # to be aesthetically quoted because they are evaled later.
1682 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1683 case $arg in
1684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1685 arg="\"$arg\""
1686 ;;
1687 esac
1688 compile_command="$compile_command $arg"
1689 finalize_command="$finalize_command $arg"
1690 compiler_flags="$compiler_flags $arg"
1691 continue
1692 ;;
1693
1694 -shrext)
1695 prev=shrext
1696 continue
1697 ;;
1698
1699 -no-fast-install)
1700 fast_install=no
1701 continue
1702 ;;
1703
1704 -no-install)
1705 case $host in
1706 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1707 # The PATH hackery in wrapper scripts is required on Windows
1708 # and Darwin in order for the loader to find any dlls it needs.
1709 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1710 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1711 fast_install=no
1712 ;;
1713 *) no_install=yes ;;
1714 esac
1715 continue
1716 ;;
1717
1718 -no-undefined)
1719 allow_undefined=no
1720 continue
1721 ;;
1722
1723 -objectlist)
1724 prev=objectlist
1725 continue
1726 ;;
1727
1728 -o) prev=output ;;
1729
1730 -precious-files-regex)
1731 prev=precious_regex
1732 continue
1733 ;;
1734
1735 -release)
1736 prev=release
1737 continue
1738 ;;
1739
1740 -rpath)
1741 prev=rpath
1742 continue
1743 ;;
1744
1745 -R)
1746 prev=xrpath
1747 continue
1748 ;;
1749
1750 -R*)
1751 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1752 # We need an absolute path.
1753 case $dir in
1754 [\\/]* | [A-Za-z]:[\\/]*) ;;
1755 *)
1756 $echo "$modename: only absolute run-paths are allowed" 1>&2
1757 exit $EXIT_FAILURE
1758 ;;
1759 esac
1760 case "$xrpath " in
1761 *" $dir "*) ;;
1762 *) xrpath="$xrpath $dir" ;;
1763 esac
1764 continue
1765 ;;
1766
1767 -static | -static-libtool-libs)
1768 # The effects of -static are defined in a previous loop.
1769 # We used to do the same as -all-static on platforms that
1770 # didn't have a PIC flag, but the assumption that the effects
1771 # would be equivalent was wrong. It would break on at least
1772 # Digital Unix and AIX.
1773 continue
1774 ;;
1775
1776 -thread-safe)
1777 thread_safe=yes
1778 continue
1779 ;;
1780
1781 -version-info)
1782 prev=vinfo
1783 continue
1784 ;;
1785 -version-number)
1786 prev=vinfo
1787 vinfo_number=yes
1788 continue
1789 ;;
1790
1791 -Wc,*)
1792 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1793 arg=
1794 save_ifs="$IFS"; IFS=','
1795 for flag in $args; do
1796 IFS="$save_ifs"
1797 case $flag in
1798 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1799 flag="\"$flag\""
1800 ;;
1801 esac
1802 arg="$arg $wl$flag"
1803 compiler_flags="$compiler_flags $flag"
1804 done
1805 IFS="$save_ifs"
1806 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1807 ;;
1808
1809 -Wl,*)
1810 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1811 arg=
1812 save_ifs="$IFS"; IFS=','
1813 for flag in $args; do
1814 IFS="$save_ifs"
1815 case $flag in
1816 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1817 flag="\"$flag\""
1818 ;;
1819 esac
1820 arg="$arg $wl$flag"
1821 compiler_flags="$compiler_flags $wl$flag"
1822 linker_flags="$linker_flags $flag"
1823 done
1824 IFS="$save_ifs"
1825 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1826 ;;
1827
1828 -Xcompiler)
1829 prev=xcompiler
1830 continue
1831 ;;
1832
1833 -Xlinker)
1834 prev=xlinker
1835 continue
1836 ;;
1837
1838 -XCClinker)
1839 prev=xcclinker
1840 continue
1841 ;;
1842
1843 # Some other compiler flag.
1844 -* | +*)
1845 # Unknown arguments in both finalize_command and compile_command need
1846 # to be aesthetically quoted because they are evaled later.
1847 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1848 case $arg in
1849 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1850 arg="\"$arg\""
1851 ;;
1852 esac
1853 ;;
1854
1855 *.$objext)
1856 # A standard object.
1857 objs="$objs $arg"
1858 ;;
1859
1860 *.lo)
1861 # A libtool-controlled object.
1862
1863 # Check to see that this really is a libtool object.
1864 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1865 pic_object=
1866 non_pic_object=
1867
1868 # Read the .lo file
1869 # If there is no directory component, then add one.
1870 case $arg in
1871 */* | *\\*) . $arg ;;
1872 *) . ./$arg ;;
1873 esac
1874
1875 if test -z "$pic_object" || \
1876 test -z "$non_pic_object" ||
1877 test "$pic_object" = none && \
1878 test "$non_pic_object" = none; then
1879 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1880 exit $EXIT_FAILURE
1881 fi
1882
1883 # Extract subdirectory from the argument.
1884 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1885 if test "X$xdir" = "X$arg"; then
1886 xdir=
1887 else
1888 xdir="$xdir/"
1889 fi
1890
1891 if test "$pic_object" != none; then
1892 # Prepend the subdirectory the object is found in.
1893 pic_object="$xdir$pic_object"
1894
1895 if test "$prev" = dlfiles; then
1896 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1897 dlfiles="$dlfiles $pic_object"
1898 prev=
1899 continue
1900 else
1901 # If libtool objects are unsupported, then we need to preload.
1902 prev=dlprefiles
1903 fi
1904 fi
1905
1906 # CHECK ME: I think I busted this. -Ossama
1907 if test "$prev" = dlprefiles; then
1908 # Preload the old-style object.
1909 dlprefiles="$dlprefiles $pic_object"
1910 prev=
1911 fi
1912
1913 # A PIC object.
1914 libobjs="$libobjs $pic_object"
1915 arg="$pic_object"
1916 fi
1917
1918 # Non-PIC object.
1919 if test "$non_pic_object" != none; then
1920 # Prepend the subdirectory the object is found in.
1921 non_pic_object="$xdir$non_pic_object"
1922
1923 # A standard non-PIC object
1924 non_pic_objects="$non_pic_objects $non_pic_object"
1925 if test -z "$pic_object" || test "$pic_object" = none ; then
1926 arg="$non_pic_object"
1927 fi
1928 else
1929 # If the PIC object exists, use it instead.
1930 # $xdir was prepended to $pic_object above.
1931 non_pic_object="$pic_object"
1932 non_pic_objects="$non_pic_objects $non_pic_object"
1933 fi
1934 else
1935 # Only an error if not doing a dry-run.
1936 if test -z "$run"; then
1937 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1938 exit $EXIT_FAILURE
1939 else
1940 # Dry-run case.
1941
1942 # Extract subdirectory from the argument.
1943 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1944 if test "X$xdir" = "X$arg"; then
1945 xdir=
1946 else
1947 xdir="$xdir/"
1948 fi
1949
1950 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1951 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1952 libobjs="$libobjs $pic_object"
1953 non_pic_objects="$non_pic_objects $non_pic_object"
1954 fi
1955 fi
1956 ;;
1957
1958 *.$libext)
1959 # An archive.
1960 deplibs="$deplibs $arg"
1961 old_deplibs="$old_deplibs $arg"
1962 continue
1963 ;;
1964
1965 *.la)
1966 # A libtool-controlled library.
1967
1968 if test "$prev" = dlfiles; then
1969 # This library was specified with -dlopen.
1970 dlfiles="$dlfiles $arg"
1971 prev=
1972 elif test "$prev" = dlprefiles; then
1973 # The library was specified with -dlpreopen.
1974 dlprefiles="$dlprefiles $arg"
1975 prev=
1976 else
1977 deplibs="$deplibs $arg"
1978 fi
1979 continue
1980 ;;
1981
1982 # Some other compiler argument.
1983 *)
1984 # Unknown arguments in both finalize_command and compile_command need
1985 # to be aesthetically quoted because they are evaled later.
1986 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1987 case $arg in
1988 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1989 arg="\"$arg\""
1990 ;;
1991 esac
1992 ;;
1993 esac # arg
1994
1995 # Now actually substitute the argument into the commands.
1996 if test -n "$arg"; then
1997 compile_command="$compile_command $arg"
1998 finalize_command="$finalize_command $arg"
1999 fi
2000 done # argument parsing loop
2001
2002 if test -n "$prev"; then
2003 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2004 $echo "$help" 1>&2
2005 exit $EXIT_FAILURE
2006 fi
2007
2008 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2009 eval arg=\"$export_dynamic_flag_spec\"
2010 compile_command="$compile_command $arg"
2011 finalize_command="$finalize_command $arg"
2012 fi
2013
2014 oldlibs=
2015 # calculate the name of the file, without its directory
2016 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2017 libobjs_save="$libobjs"
2018
2019 if test -n "$shlibpath_var"; then
2020 # get the directories listed in $shlibpath_var
2021 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2022 else
2023 shlib_search_path=
2024 fi
2025 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2026 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2027
2028 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2029 if test "X$output_objdir" = "X$output"; then
2030 output_objdir="$objdir"
2031 else
2032 output_objdir="$output_objdir/$objdir"
2033 fi
2034 # Create the object directory.
2035 if test ! -d "$output_objdir"; then
2036 $show "$mkdir $output_objdir"
2037 $run $mkdir $output_objdir
2038 exit_status=$?
2039 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2040 exit $exit_status
2041 fi
2042 fi
2043
2044 # Determine the type of output
2045 case $output in
2046 "")
2047 $echo "$modename: you must specify an output file" 1>&2
2048 $echo "$help" 1>&2
2049 exit $EXIT_FAILURE
2050 ;;
2051 *.$libext) linkmode=oldlib ;;
2052 *.lo | *.$objext) linkmode=obj ;;
2053 *.la) linkmode=lib ;;
2054 *) linkmode=prog ;; # Anything else should be a program.
2055 esac
2056
2057 case $host in
2058 *cygwin* | *mingw* | *pw32*)
2059 # don't eliminate duplications in $postdeps and $predeps
2060 duplicate_compiler_generated_deps=yes
2061 ;;
2062 *)
2063 duplicate_compiler_generated_deps=$duplicate_deps
2064 ;;
2065 esac
2066 specialdeplibs=
2067
2068 libs=
2069 # Find all interdependent deplibs by searching for libraries
2070 # that are linked more than once (e.g. -la -lb -la)
2071 for deplib in $deplibs; do
2072 if test "X$duplicate_deps" = "Xyes" ; then
2073 case "$libs " in
2074 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2075 esac
2076 fi
2077 libs="$libs $deplib"
2078 done
2079
2080 if test "$linkmode" = lib; then
2081 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2082
2083 # Compute libraries that are listed more than once in $predeps
2084 # $postdeps and mark them as special (i.e., whose duplicates are
2085 # not to be eliminated).
2086 pre_post_deps=
2087 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2088 for pre_post_dep in $predeps $postdeps; do
2089 case "$pre_post_deps " in
2090 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2091 esac
2092 pre_post_deps="$pre_post_deps $pre_post_dep"
2093 done
2094 fi
2095 pre_post_deps=
2096 fi
2097
2098 deplibs=
2099 newdependency_libs=
2100 newlib_search_path=
2101 need_relink=no # whether we're linking any uninstalled libtool libraries
2102 notinst_deplibs= # not-installed libtool libraries
2103 case $linkmode in
2104 lib)
2105 passes="conv link"
2106 for file in $dlfiles $dlprefiles; do
2107 case $file in
2108 *.la) ;;
2109 *)
2110 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2111 exit $EXIT_FAILURE
2112 ;;
2113 esac
2114 done
2115 ;;
2116 prog)
2117 compile_deplibs=
2118 finalize_deplibs=
2119 alldeplibs=no
2120 newdlfiles=
2121 newdlprefiles=
2122 passes="conv scan dlopen dlpreopen link"
2123 ;;
2124 *) passes="conv"
2125 ;;
2126 esac
2127 for pass in $passes; do
2128 if test "$linkmode,$pass" = "lib,link" ||
2129 test "$linkmode,$pass" = "prog,scan"; then
2130 libs="$deplibs"
2131 deplibs=
2132 fi
2133 if test "$linkmode" = prog; then
2134 case $pass in
2135 dlopen) libs="$dlfiles" ;;
2136 dlpreopen) libs="$dlprefiles" ;;
2137 link)
2138 libs="$deplibs %DEPLIBS%"
2139 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2140 ;;
2141 esac
2142 fi
2143 if test "$pass" = dlopen; then
2144 # Collect dlpreopened libraries
2145 save_deplibs="$deplibs"
2146 deplibs=
2147 fi
2148 for deplib in $libs; do
2149 lib=
2150 found=no
2151 case $deplib in
2152 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2153 if test "$linkmode,$pass" = "prog,link"; then
2154 compile_deplibs="$deplib $compile_deplibs"
2155 finalize_deplibs="$deplib $finalize_deplibs"
2156 else
2157 compiler_flags="$compiler_flags $deplib"
2158 fi
2159 continue
2160 ;;
2161 -l*)
2162 if test "$linkmode" != lib && test "$linkmode" != prog; then
2163 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2164 continue
2165 fi
2166 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2167 if test "$linkmode" = lib; then
2168 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2169 else
2170 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2171 fi
2172 for searchdir in $searchdirs; do
2173 for search_ext in .la $std_shrext .so .a; do
2174 # Search the libtool library
2175 lib="$searchdir/lib${name}${search_ext}"
2176 if test -f "$lib"; then
2177 if test "$search_ext" = ".la"; then
2178 found=yes
2179 else
2180 found=no
2181 fi
2182 break 2
2183 fi
2184 done
2185 done
2186 if test "$found" != yes; then
2187 # deplib doesn't seem to be a libtool library
2188 if test "$linkmode,$pass" = "prog,link"; then
2189 compile_deplibs="$deplib $compile_deplibs"
2190 finalize_deplibs="$deplib $finalize_deplibs"
2191 else
2192 deplibs="$deplib $deplibs"
2193 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2194 fi
2195 continue
2196 else # deplib is a libtool library
2197 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2198 # We need to do some special things here, and not later.
2199 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2200 case " $predeps $postdeps " in
2201 *" $deplib "*)
2202 if (${SED} -e '2q' $lib |
2203 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2204 library_names=
2205 old_library=
2206 case $lib in
2207 */* | *\\*) . $lib ;;
2208 *) . ./$lib ;;
2209 esac
2210 for l in $old_library $library_names; do
2211 ll="$l"
2212 done
2213 if test "X$ll" = "X$old_library" ; then # only static version available
2214 found=no
2215 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2216 test "X$ladir" = "X$lib" && ladir="."
2217 lib=$ladir/$old_library
2218 if test "$linkmode,$pass" = "prog,link"; then
2219 compile_deplibs="$deplib $compile_deplibs"
2220 finalize_deplibs="$deplib $finalize_deplibs"
2221 else
2222 deplibs="$deplib $deplibs"
2223 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2224 fi
2225 continue
2226 fi
2227 fi
2228 ;;
2229 *) ;;
2230 esac
2231 fi
2232 fi
2233 ;; # -l
2234 -L*)
2235 case $linkmode in
2236 lib)
2237 deplibs="$deplib $deplibs"
2238 test "$pass" = conv && continue
2239 newdependency_libs="$deplib $newdependency_libs"
2240 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2241 ;;
2242 prog)
2243 if test "$pass" = conv; then
2244 deplibs="$deplib $deplibs"
2245 continue
2246 fi
2247 if test "$pass" = scan; then
2248 deplibs="$deplib $deplibs"
2249 else
2250 compile_deplibs="$deplib $compile_deplibs"
2251 finalize_deplibs="$deplib $finalize_deplibs"
2252 fi
2253 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2254 ;;
2255 *)
2256 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2257 ;;
2258 esac # linkmode
2259 continue
2260 ;; # -L
2261 -R*)
2262 if test "$pass" = link; then
2263 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2264 # Make sure the xrpath contains only unique directories.
2265 case "$xrpath " in
2266 *" $dir "*) ;;
2267 *) xrpath="$xrpath $dir" ;;
2268 esac
2269 fi
2270 deplibs="$deplib $deplibs"
2271 continue
2272 ;;
2273 *.la) lib="$deplib" ;;
2274 *.$libext)
2275 if test "$pass" = conv; then
2276 deplibs="$deplib $deplibs"
2277 continue
2278 fi
2279 case $linkmode in
2280 lib)
2281 valid_a_lib=no
2282 case $deplibs_check_method in
2283 match_pattern*)
2284 set dummy $deplibs_check_method
2285 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2286 if eval $echo \"$deplib\" 2>/dev/null \
2287 | $SED 10q \
2288 | $EGREP "$match_pattern_regex" > /dev/null; then
2289 valid_a_lib=yes
2290 fi
2291 ;;
2292 pass_all)
2293 valid_a_lib=yes
2294 ;;
2295 esac
2296 if test "$valid_a_lib" != yes; then
2297 $echo
2298 $echo "*** Warning: Trying to link with static lib archive $deplib."
2299 $echo "*** I have the capability to make that library automatically link in when"
2300 $echo "*** you link to this library. But I can only do this if you have a"
2301 $echo "*** shared version of the library, which you do not appear to have"
2302 $echo "*** because the file extensions .$libext of this argument makes me believe"
2303 $echo "*** that it is just a static archive that I should not used here."
2304 else
2305 $echo
2306 $echo "*** Warning: Linking the shared library $output against the"
2307 $echo "*** static library $deplib is not portable!"
2308 deplibs="$deplib $deplibs"
2309 fi
2310 continue
2311 ;;
2312 prog)
2313 if test "$pass" != link; then
2314 deplibs="$deplib $deplibs"
2315 else
2316 compile_deplibs="$deplib $compile_deplibs"
2317 finalize_deplibs="$deplib $finalize_deplibs"
2318 fi
2319 continue
2320 ;;
2321 esac # linkmode
2322 ;; # *.$libext
2323 *.lo | *.$objext)
2324 if test "$pass" = conv; then
2325 deplibs="$deplib $deplibs"
2326 elif test "$linkmode" = prog; then
2327 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2328 # If there is no dlopen support or we're linking statically,
2329 # we need to preload.
2330 newdlprefiles="$newdlprefiles $deplib"
2331 compile_deplibs="$deplib $compile_deplibs"
2332 finalize_deplibs="$deplib $finalize_deplibs"
2333 else
2334 newdlfiles="$newdlfiles $deplib"
2335 fi
2336 fi
2337 continue
2338 ;;
2339 %DEPLIBS%)
2340 alldeplibs=yes
2341 continue
2342 ;;
2343 esac # case $deplib
2344 if test "$found" = yes || test -f "$lib"; then :
2345 else
2346 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2347 exit $EXIT_FAILURE
2348 fi
2349
2350 # Check to see that this really is a libtool archive.
2351 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2352 else
2353 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2354 exit $EXIT_FAILURE
2355 fi
2356
2357 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2358 test "X$ladir" = "X$lib" && ladir="."
2359
2360 dlname=
2361 dlopen=
2362 dlpreopen=
2363 libdir=
2364 library_names=
2365 old_library=
2366 # If the library was installed with an old release of libtool,
2367 # it will not redefine variables installed, or shouldnotlink
2368 installed=yes
2369 shouldnotlink=no
2370 avoidtemprpath=
2371
2372
2373 # Read the .la file
2374 case $lib in
2375 */* | *\\*) . $lib ;;
2376 *) . ./$lib ;;
2377 esac
2378
2379 if test "$linkmode,$pass" = "lib,link" ||
2380 test "$linkmode,$pass" = "prog,scan" ||
2381 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2382 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2383 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2384 fi
2385
2386 if test "$pass" = conv; then
2387 # Only check for convenience libraries
2388 deplibs="$lib $deplibs"
2389 if test -z "$libdir"; then
2390 if test -z "$old_library"; then
2391 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2392 exit $EXIT_FAILURE
2393 fi
2394 # It is a libtool convenience library, so add in its objects.
2395 convenience="$convenience $ladir/$objdir/$old_library"
2396 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2397 tmp_libs=
2398 for deplib in $dependency_libs; do
2399 deplibs="$deplib $deplibs"
2400 if test "X$duplicate_deps" = "Xyes" ; then
2401 case "$tmp_libs " in
2402 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2403 esac
2404 fi
2405 tmp_libs="$tmp_libs $deplib"
2406 done
2407 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2408 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2409 exit $EXIT_FAILURE
2410 fi
2411 continue
2412 fi # $pass = conv
2413
2414
2415 # Get the name of the library we link against.
2416 linklib=
2417 for l in $old_library $library_names; do
2418 linklib="$l"
2419 done
2420 if test -z "$linklib"; then
2421 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2422 exit $EXIT_FAILURE
2423 fi
2424
2425 # This library was specified with -dlopen.
2426 if test "$pass" = dlopen; then
2427 if test -z "$libdir"; then
2428 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2429 exit $EXIT_FAILURE
2430 fi
2431 if test -z "$dlname" ||
2432 test "$dlopen_support" != yes ||
2433 test "$build_libtool_libs" = no; then
2434 # If there is no dlname, no dlopen support or we're linking
2435 # statically, we need to preload. We also need to preload any
2436 # dependent libraries so libltdl's deplib preloader doesn't
2437 # bomb out in the load deplibs phase.
2438 dlprefiles="$dlprefiles $lib $dependency_libs"
2439 else
2440 newdlfiles="$newdlfiles $lib"
2441 fi
2442 continue
2443 fi # $pass = dlopen
2444
2445 # We need an absolute path.
2446 case $ladir in
2447 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2448 *)
2449 abs_ladir=`cd "$ladir" && pwd`
2450 if test -z "$abs_ladir"; then
2451 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2452 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2453 abs_ladir="$ladir"
2454 fi
2455 ;;
2456 esac
2457 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2458
2459 # Find the relevant object directory and library name.
2460 if test "X$installed" = Xyes; then
2461 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2462 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2463 dir="$ladir"
2464 absdir="$abs_ladir"
2465 libdir="$abs_ladir"
2466 else
2467 dir="$libdir"
2468 absdir="$libdir"
2469 fi
2470 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2471 else
2472 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2473 dir="$ladir"
2474 absdir="$abs_ladir"
2475 # Remove this search path later
2476 notinst_path="$notinst_path $abs_ladir"
2477 else
2478 dir="$ladir/$objdir"
2479 absdir="$abs_ladir/$objdir"
2480 # Remove this search path later
2481 notinst_path="$notinst_path $abs_ladir"
2482 fi
2483 fi # $installed = yes
2484 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2485
2486 # This library was specified with -dlpreopen.
2487 if test "$pass" = dlpreopen; then
2488 if test -z "$libdir"; then
2489 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2490 exit $EXIT_FAILURE
2491 fi
2492 # Prefer using a static library (so that no silly _DYNAMIC symbols
2493 # are required to link).
2494 if test -n "$old_library"; then
2495 newdlprefiles="$newdlprefiles $dir/$old_library"
2496 # Otherwise, use the dlname, so that lt_dlopen finds it.
2497 elif test -n "$dlname"; then
2498 newdlprefiles="$newdlprefiles $dir/$dlname"
2499 else
2500 newdlprefiles="$newdlprefiles $dir/$linklib"
2501 fi
2502 fi # $pass = dlpreopen
2503
2504 if test -z "$libdir"; then
2505 # Link the convenience library
2506 if test "$linkmode" = lib; then
2507 deplibs="$dir/$old_library $deplibs"
2508 elif test "$linkmode,$pass" = "prog,link"; then
2509 compile_deplibs="$dir/$old_library $compile_deplibs"
2510 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2511 else
2512 deplibs="$lib $deplibs" # used for prog,scan pass
2513 fi
2514 continue
2515 fi
2516
2517
2518 if test "$linkmode" = prog && test "$pass" != link; then
2519 newlib_search_path="$newlib_search_path $ladir"
2520 deplibs="$lib $deplibs"
2521
2522 linkalldeplibs=no
2523 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2524 test "$build_libtool_libs" = no; then
2525 linkalldeplibs=yes
2526 fi
2527
2528 tmp_libs=
2529 for deplib in $dependency_libs; do
2530 case $deplib in
2531 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2532 esac
2533 # Need to link against all dependency_libs?
2534 if test "$linkalldeplibs" = yes; then
2535 deplibs="$deplib $deplibs"
2536 else
2537 # Need to hardcode shared library paths
2538 # or/and link against static libraries
2539 newdependency_libs="$deplib $newdependency_libs"
2540 fi
2541 if test "X$duplicate_deps" = "Xyes" ; then
2542 case "$tmp_libs " in
2543 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2544 esac
2545 fi
2546 tmp_libs="$tmp_libs $deplib"
2547 done # for deplib
2548 continue
2549 fi # $linkmode = prog...
2550
2551 if test "$linkmode,$pass" = "prog,link"; then
2552 if test -n "$library_names" &&
2553 { { test "$prefer_static_libs" = no ||
2554 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2555 test -z "$old_library"; }; then
2556 # We need to hardcode the library path
2557 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2558 # Make sure the rpath contains only unique directories.
2559 case "$temp_rpath " in
2560 *" $dir "*) ;;
2561 *" $absdir "*) ;;
2562 *) temp_rpath="$temp_rpath $absdir" ;;
2563 esac
2564 fi
2565
2566 # Hardcode the library path.
2567 # Skip directories that are in the system default run-time
2568 # search path.
2569 case " $sys_lib_dlsearch_path " in
2570 *" $absdir "*) ;;
2571 *)
2572 case "$compile_rpath " in
2573 *" $absdir "*) ;;
2574 *) compile_rpath="$compile_rpath $absdir"
2575 esac
2576 ;;
2577 esac
2578 case " $sys_lib_dlsearch_path " in
2579 *" $libdir "*) ;;
2580 *)
2581 case "$finalize_rpath " in
2582 *" $libdir "*) ;;
2583 *) finalize_rpath="$finalize_rpath $libdir"
2584 esac
2585 ;;
2586 esac
2587 fi # $linkmode,$pass = prog,link...
2588
2589 if test "$alldeplibs" = yes &&
2590 { test "$deplibs_check_method" = pass_all ||
2591 { test "$build_libtool_libs" = yes &&
2592 test -n "$library_names"; }; }; then
2593 # We only need to search for static libraries
2594 continue
2595 fi
2596 fi
2597
2598 link_static=no # Whether the deplib will be linked statically
2599 use_static_libs=$prefer_static_libs
2600 if test "$use_static_libs" = built && test "$installed" = yes ; then
2601 use_static_libs=no
2602 fi
2603 if test -n "$library_names" &&
2604 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2605 if test "$installed" = no; then
2606 notinst_deplibs="$notinst_deplibs $lib"
2607 need_relink=yes
2608 fi
2609 # This is a shared library
2610
2611 # Warn about portability, can't link against -module's on
2612 # some systems (darwin)
2613 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2614 $echo
2615 if test "$linkmode" = prog; then
2616 $echo "*** Warning: Linking the executable $output against the loadable module"
2617 else
2618 $echo "*** Warning: Linking the shared library $output against the loadable module"
2619 fi
2620 $echo "*** $linklib is not portable!"
2621 fi
2622 if test "$linkmode" = lib &&
2623 test "$hardcode_into_libs" = yes; then
2624 # Hardcode the library path.
2625 # Skip directories that are in the system default run-time
2626 # search path.
2627 case " $sys_lib_dlsearch_path " in
2628 *" $absdir "*) ;;
2629 *)
2630 case "$compile_rpath " in
2631 *" $absdir "*) ;;
2632 *) compile_rpath="$compile_rpath $absdir"
2633 esac
2634 ;;
2635 esac
2636 case " $sys_lib_dlsearch_path " in
2637 *" $libdir "*) ;;
2638 *)
2639 case "$finalize_rpath " in
2640 *" $libdir "*) ;;
2641 *) finalize_rpath="$finalize_rpath $libdir"
2642 esac
2643 ;;
2644 esac
2645 fi
2646
2647 if test -n "$old_archive_from_expsyms_cmds"; then
2648 # figure out the soname
2649 set dummy $library_names
2650 realname="$2"
2651 shift; shift
2652 libname=`eval \\$echo \"$libname_spec\"`
2653 # use dlname if we got it. it's perfectly good, no?
2654 if test -n "$dlname"; then
2655 soname="$dlname"
2656 elif test -n "$soname_spec"; then
2657 # bleh windows
2658 case $host in
2659 *cygwin* | mingw*)
2660 major=`expr $current - $age`
2661 versuffix="-$major"
2662 ;;
2663 esac
2664 eval soname=\"$soname_spec\"
2665 else
2666 soname="$realname"
2667 fi
2668
2669 # Make a new name for the extract_expsyms_cmds to use
2670 soroot="$soname"
2671 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2672 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2673
2674 # If the library has no export list, then create one now
2675 if test -f "$output_objdir/$soname-def"; then :
2676 else
2677 $show "extracting exported symbol list from \`$soname'"
2678 save_ifs="$IFS"; IFS='~'
2679 cmds=$extract_expsyms_cmds
2680 for cmd in $cmds; do
2681 IFS="$save_ifs"
2682 eval cmd=\"$cmd\"
2683 $show "$cmd"
2684 $run eval "$cmd" || exit $?
2685 done
2686 IFS="$save_ifs"
2687 fi
2688
2689 # Create $newlib
2690 if test -f "$output_objdir/$newlib"; then :; else
2691 $show "generating import library for \`$soname'"
2692 save_ifs="$IFS"; IFS='~'
2693 cmds=$old_archive_from_expsyms_cmds
2694 for cmd in $cmds; do
2695 IFS="$save_ifs"
2696 eval cmd=\"$cmd\"
2697 $show "$cmd"
2698 $run eval "$cmd" || exit $?
2699 done
2700 IFS="$save_ifs"
2701 fi
2702 # make sure the library variables are pointing to the new library
2703 dir=$output_objdir
2704 linklib=$newlib
2705 fi # test -n "$old_archive_from_expsyms_cmds"
2706
2707 if test "$linkmode" = prog || test "$mode" != relink; then
2708 add_shlibpath=
2709 add_dir=
2710 add=
2711 lib_linked=yes
2712 case $hardcode_action in
2713 immediate | unsupported)
2714 if test "$hardcode_direct" = no; then
2715 add="$dir/$linklib"
2716 case $host in
2717 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
2718 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
2719 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
2720 *-*-unixware7*) add_dir="-L$dir" ;;
2721 *-*-darwin* )
2722 # if the lib is a module then we can not link against
2723 # it, someone is ignoring the new warnings I added
2724 if /usr/bin/file -L $add 2> /dev/null |
2725 $EGREP ": [^:]* bundle" >/dev/null ; then
2726 $echo "** Warning, lib $linklib is a module, not a shared library"
2727 if test -z "$old_library" ; then
2728 $echo
2729 $echo "** And there doesn't seem to be a static archive available"
2730 $echo "** The link will probably fail, sorry"
2731 else
2732 add="$dir/$old_library"
2733 fi
2734 fi
2735 esac
2736 elif test "$hardcode_minus_L" = no; then
2737 case $host in
2738 *-*-sunos*) add_shlibpath="$dir" ;;
2739 esac
2740 add_dir="-L$dir"
2741 add="-l$name"
2742 elif test "$hardcode_shlibpath_var" = no; then
2743 add_shlibpath="$dir"
2744 add="-l$name"
2745 else
2746 lib_linked=no
2747 fi
2748 ;;
2749 relink)
2750 if test "$hardcode_direct" = yes; then
2751 add="$dir/$linklib"
2752 elif test "$hardcode_minus_L" = yes; then
2753 add_dir="-L$dir"
2754 # Try looking first in the location we're being installed to.
2755 if test -n "$inst_prefix_dir"; then
2756 case $libdir in
2757 [\\/]*)
2758 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2759 ;;
2760 esac
2761 fi
2762 add="-l$name"
2763 elif test "$hardcode_shlibpath_var" = yes; then
2764 add_shlibpath="$dir"
2765 add="-l$name"
2766 else
2767 lib_linked=no
2768 fi
2769 ;;
2770 *) lib_linked=no ;;
2771 esac
2772
2773 if test "$lib_linked" != yes; then
2774 $echo "$modename: configuration error: unsupported hardcode properties"
2775 exit $EXIT_FAILURE
2776 fi
2777
2778 if test -n "$add_shlibpath"; then
2779 case :$compile_shlibpath: in
2780 *":$add_shlibpath:"*) ;;
2781 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2782 esac
2783 fi
2784 if test "$linkmode" = prog; then
2785 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2786 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2787 else
2788 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2789 test -n "$add" && deplibs="$add $deplibs"
2790 if test "$hardcode_direct" != yes && \
2791 test "$hardcode_minus_L" != yes && \
2792 test "$hardcode_shlibpath_var" = yes; then
2793 case :$finalize_shlibpath: in
2794 *":$libdir:"*) ;;
2795 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2796 esac
2797 fi
2798 fi
2799 fi
2800
2801 if test "$linkmode" = prog || test "$mode" = relink; then
2802 add_shlibpath=
2803 add_dir=
2804 add=
2805 # Finalize command for both is simple: just hardcode it.
2806 if test "$hardcode_direct" = yes; then
2807 add="$libdir/$linklib"
2808 elif test "$hardcode_minus_L" = yes; then
2809 add_dir="-L$libdir"
2810 add="-l$name"
2811 elif test "$hardcode_shlibpath_var" = yes; then
2812 case :$finalize_shlibpath: in
2813 *":$libdir:"*) ;;
2814 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2815 esac
2816 add="-l$name"
2817 elif test "$hardcode_automatic" = yes; then
2818 if test -n "$inst_prefix_dir" &&
2819 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2820 add="$inst_prefix_dir$libdir/$linklib"
2821 else
2822 add="$libdir/$linklib"
2823 fi
2824 else
2825 # We cannot seem to hardcode it, guess we'll fake it.
2826 add_dir="-L$libdir"
2827 # Try looking first in the location we're being installed to.
2828 if test -n "$inst_prefix_dir"; then
2829 case $libdir in
2830 [\\/]*)
2831 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2832 ;;
2833 esac
2834 fi
2835 add="-l$name"
2836 fi
2837
2838 if test "$linkmode" = prog; then
2839 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2840 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2841 else
2842 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2843 test -n "$add" && deplibs="$add $deplibs"
2844 fi
2845 fi
2846 elif test "$linkmode" = prog; then
2847 # Here we assume that one of hardcode_direct or hardcode_minus_L
2848 # is not unsupported. This is valid on all known static and
2849 # shared platforms.
2850 if test "$hardcode_direct" != unsupported; then
2851 test -n "$old_library" && linklib="$old_library"
2852 compile_deplibs="$dir/$linklib $compile_deplibs"
2853 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2854 else
2855 compile_deplibs="-l$name -L$dir $compile_deplibs"
2856 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2857 fi
2858 elif test "$build_libtool_libs" = yes; then
2859 # Not a shared library
2860 if test "$deplibs_check_method" != pass_all; then
2861 # We're trying link a shared library against a static one
2862 # but the system doesn't support it.
2863
2864 # Just print a warning and add the library to dependency_libs so
2865 # that the program can be linked against the static library.
2866 $echo
2867 $echo "*** Warning: This system can not link to static lib archive $lib."
2868 $echo "*** I have the capability to make that library automatically link in when"
2869 $echo "*** you link to this library. But I can only do this if you have a"
2870 $echo "*** shared version of the library, which you do not appear to have."
2871 if test "$module" = yes; then
2872 $echo "*** But as you try to build a module library, libtool will still create "
2873 $echo "*** a static module, that should work as long as the dlopening application"
2874 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2875 if test -z "$global_symbol_pipe"; then
2876 $echo
2877 $echo "*** However, this would only work if libtool was able to extract symbol"
2878 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2879 $echo "*** not find such a program. So, this module is probably useless."
2880 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2881 fi
2882 if test "$build_old_libs" = no; then
2883 build_libtool_libs=module
2884 build_old_libs=yes
2885 else
2886 build_libtool_libs=no
2887 fi
2888 fi
2889 else
2890 deplibs="$dir/$old_library $deplibs"
2891 link_static=yes
2892 fi
2893 fi # link shared/static library?
2894
2895 if test "$linkmode" = lib; then
2896 if test -n "$dependency_libs" &&
2897 { test "$hardcode_into_libs" != yes ||
2898 test "$build_old_libs" = yes ||
2899 test "$link_static" = yes; }; then
2900 # Extract -R from dependency_libs
2901 temp_deplibs=
2902 for libdir in $dependency_libs; do
2903 case $libdir in
2904 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2905 case " $xrpath " in
2906 *" $temp_xrpath "*) ;;
2907 *) xrpath="$xrpath $temp_xrpath";;
2908 esac;;
2909 *) temp_deplibs="$temp_deplibs $libdir";;
2910 esac
2911 done
2912 dependency_libs="$temp_deplibs"
2913 fi
2914
2915 newlib_search_path="$newlib_search_path $absdir"
2916 # Link against this library
2917 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2918 # ... and its dependency_libs
2919 tmp_libs=
2920 for deplib in $dependency_libs; do
2921 newdependency_libs="$deplib $newdependency_libs"
2922 if test "X$duplicate_deps" = "Xyes" ; then
2923 case "$tmp_libs " in
2924 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2925 esac
2926 fi
2927 tmp_libs="$tmp_libs $deplib"
2928 done
2929
2930 if test "$link_all_deplibs" != no; then
2931 # Add the search paths of all dependency libraries
2932 for deplib in $dependency_libs; do
2933 case $deplib in
2934 -L*) path="$deplib" ;;
2935 *.la)
2936 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2937 test "X$dir" = "X$deplib" && dir="."
2938 # We need an absolute path.
2939 case $dir in
2940 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2941 *)
2942 absdir=`cd "$dir" && pwd`
2943 if test -z "$absdir"; then
2944 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2945 absdir="$dir"
2946 fi
2947 ;;
2948 esac
2949 if grep "^installed=no" $deplib > /dev/null; then
2950 path="$absdir/$objdir"
2951 else
2952 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2953 if test -z "$libdir"; then
2954 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2955 exit $EXIT_FAILURE
2956 fi
2957 if test "$absdir" != "$libdir"; then
2958 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2959 fi
2960 path="$absdir"
2961 fi
2962 depdepl=
2963 case $host in
2964 *-*-darwin*)
2965 # we do not want to link against static libs,
2966 # but need to link against shared
2967 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2968 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2969 if test -n "$deplibrary_names" ; then
2970 for tmp in $deplibrary_names ; do
2971 depdepl=$tmp
2972 done
2973 if test -f "$deplibdir/$depdepl" ; then
2974 depdepl="$deplibdir/$depdepl"
2975 elif test -f "$path/$depdepl" ; then
2976 depdepl="$path/$depdepl"
2977 else
2978 # Can't find it, oh well...
2979 depdepl=
2980 fi
2981 # do not add paths which are already there
2982 case " $newlib_search_path " in
2983 *" $path "*) ;;
2984 *) newlib_search_path="$newlib_search_path $path";;
2985 esac
2986 fi
2987 path=""
2988 ;;
2989 *)
2990 path="-L$path"
2991 ;;
2992 esac
2993 ;;
2994 -l*)
2995 case $host in
2996 *-*-darwin*)
2997 # Again, we only want to link against shared libraries
2998 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2999 for tmp in $newlib_search_path ; do
3000 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3001 eval depdepl="$tmp/lib$tmp_libs.dylib"
3002 break
3003 fi
3004 done
3005 path=""
3006 ;;
3007 *) continue ;;
3008 esac
3009 ;;
3010 *) continue ;;
3011 esac
3012 case " $deplibs " in
3013 *" $path "*) ;;
3014 *) deplibs="$path $deplibs" ;;
3015 esac
3016 case " $deplibs " in
3017 *" $depdepl "*) ;;
3018 *) deplibs="$depdepl $deplibs" ;;
3019 esac
3020 done
3021 fi # link_all_deplibs != no
3022 fi # linkmode = lib
3023 done # for deplib in $libs
3024 dependency_libs="$newdependency_libs"
3025 if test "$pass" = dlpreopen; then
3026 # Link the dlpreopened libraries before other libraries
3027 for deplib in $save_deplibs; do
3028 deplibs="$deplib $deplibs"
3029 done
3030 fi
3031 if test "$pass" != dlopen; then
3032 if test "$pass" != conv; then
3033 # Make sure lib_search_path contains only unique directories.
3034 lib_search_path=
3035 for dir in $newlib_search_path; do
3036 case "$lib_search_path " in
3037 *" $dir "*) ;;
3038 *) lib_search_path="$lib_search_path $dir" ;;
3039 esac
3040 done
3041 newlib_search_path=
3042 fi
3043
3044 if test "$linkmode,$pass" != "prog,link"; then
3045 vars="deplibs"
3046 else
3047 vars="compile_deplibs finalize_deplibs"
3048 fi
3049 for var in $vars dependency_libs; do
3050 # Add libraries to $var in reverse order
3051 eval tmp_libs=\"\$$var\"
3052 new_libs=
3053 for deplib in $tmp_libs; do
3054 # FIXME: Pedantically, this is the right thing to do, so
3055 # that some nasty dependency loop isn't accidentally
3056 # broken:
3057 #new_libs="$deplib $new_libs"
3058 # Pragmatically, this seems to cause very few problems in
3059 # practice:
3060 case $deplib in
3061 -L*) new_libs="$deplib $new_libs" ;;
3062 -R*) ;;
3063 *)
3064 # And here is the reason: when a library appears more
3065 # than once as an explicit dependence of a library, or
3066 # is implicitly linked in more than once by the
3067 # compiler, it is considered special, and multiple
3068 # occurrences thereof are not removed. Compare this
3069 # with having the same library being listed as a
3070 # dependency of multiple other libraries: in this case,
3071 # we know (pedantically, we assume) the library does not
3072 # need to be listed more than once, so we keep only the
3073 # last copy. This is not always right, but it is rare
3074 # enough that we require users that really mean to play
3075 # such unportable linking tricks to link the library
3076 # using -Wl,-lname, so that libtool does not consider it
3077 # for duplicate removal.
3078 case " $specialdeplibs " in
3079 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3080 *)
3081 case " $new_libs " in
3082 *" $deplib "*) ;;
3083 *) new_libs="$deplib $new_libs" ;;
3084 esac
3085 ;;
3086 esac
3087 ;;
3088 esac
3089 done
3090 tmp_libs=
3091 for deplib in $new_libs; do
3092 case $deplib in
3093 -L*)
3094 case " $tmp_libs " in
3095 *" $deplib "*) ;;
3096 *) tmp_libs="$tmp_libs $deplib" ;;
3097 esac
3098 ;;
3099 *) tmp_libs="$tmp_libs $deplib" ;;
3100 esac
3101 done
3102 eval $var=\"$tmp_libs\"
3103 done # for var
3104 fi
3105 # Last step: remove runtime libs from dependency_libs
3106 # (they stay in deplibs)
3107 tmp_libs=
3108 for i in $dependency_libs ; do
3109 case " $predeps $postdeps $compiler_lib_search_path " in
3110 *" $i "*)
3111 i=""
3112 ;;
3113 esac
3114 if test -n "$i" ; then
3115 tmp_libs="$tmp_libs $i"
3116 fi
3117 done
3118 dependency_libs=$tmp_libs
3119 done # for pass
3120 if test "$linkmode" = prog; then
3121 dlfiles="$newdlfiles"
3122 dlprefiles="$newdlprefiles"
3123 fi
3124
3125 case $linkmode in
3126 oldlib)
3127 case " $deplibs" in
3128 *\ -l* | *\ -L*)
3129 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3130 esac
3131
3132 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3133 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3134 fi
3135
3136 if test -n "$rpath"; then
3137 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3138 fi
3139
3140 if test -n "$xrpath"; then
3141 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3142 fi
3143
3144 if test -n "$vinfo"; then
3145 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3146 fi
3147
3148 if test -n "$release"; then
3149 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3150 fi
3151
3152 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3153 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3154 fi
3155
3156 # Now set the variables for building old libraries.
3157 build_libtool_libs=no
3158 oldlibs="$output"
3159 objs="$objs$old_deplibs"
3160 ;;
3161
3162 lib)
3163 # Make sure we only generate libraries of the form `libNAME.la'.
3164 case $outputname in
3165 lib*)
3166 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3167 eval shared_ext=\"$shrext_cmds\"
3168 eval libname=\"$libname_spec\"
3169 ;;
3170 *)
3171 if test "$module" = no; then
3172 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3173 $echo "$help" 1>&2
3174 exit $EXIT_FAILURE
3175 fi
3176 if test "$need_lib_prefix" != no; then
3177 # Add the "lib" prefix for modules if required
3178 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3179 eval shared_ext=\"$shrext_cmds\"
3180 eval libname=\"$libname_spec\"
3181 else
3182 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3183 fi
3184 ;;
3185 esac
3186
3187 if test -n "$objs"; then
3188 if test "$deplibs_check_method" != pass_all; then
3189 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3190 exit $EXIT_FAILURE
3191 else
3192 $echo
3193 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3194 $echo "*** objects $objs is not portable!"
3195 libobjs="$libobjs $objs"
3196 fi
3197 fi
3198
3199 if test "$dlself" != no; then
3200 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3201 fi
3202
3203 set dummy $rpath
3204 if test "$#" -gt 2; then
3205 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3206 fi
3207 install_libdir="$2"
3208
3209 oldlibs=
3210 if test -z "$rpath"; then
3211 if test "$build_libtool_libs" = yes; then
3212 # Building a libtool convenience library.
3213 # Some compilers have problems with a `.al' extension so
3214 # convenience libraries should have the same extension an
3215 # archive normally would.
3216 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3217 build_libtool_libs=convenience
3218 build_old_libs=yes
3219 fi
3220
3221 if test -n "$vinfo"; then
3222 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3223 fi
3224
3225 if test -n "$release"; then
3226 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3227 fi
3228 else
3229
3230 # Parse the version information argument.
3231 save_ifs="$IFS"; IFS=':'
3232 set dummy $vinfo 0 0 0
3233 IFS="$save_ifs"
3234
3235 if test -n "$8"; then
3236 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3237 $echo "$help" 1>&2
3238 exit $EXIT_FAILURE
3239 fi
3240
3241 # convert absolute version numbers to libtool ages
3242 # this retains compatibility with .la files and attempts
3243 # to make the code below a bit more comprehensible
3244
3245 case $vinfo_number in
3246 yes)
3247 number_major="$2"
3248 number_minor="$3"
3249 number_revision="$4"
3250 #
3251 # There are really only two kinds -- those that
3252 # use the current revision as the major version
3253 # and those that subtract age and use age as
3254 # a minor version. But, then there is irix
3255 # which has an extra 1 added just for fun
3256 #
3257 case $version_type in
3258 darwin|linux|osf|windows|none)
3259 current=`expr $number_major + $number_minor`
3260 age="$number_minor"
3261 revision="$number_revision"
3262 ;;
3263 freebsd-aout|freebsd-elf|sunos)
3264 current="$number_major"
3265 revision="$number_minor"
3266 age="0"
3267 ;;
3268 irix|nonstopux)
3269 current=`expr $number_major + $number_minor`
3270 age="$number_minor"
3271 revision="$number_minor"
3272 lt_irix_increment=no
3273 ;;
3274 *)
3275 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3276 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3277 exit $EXIT_FAILURE
3278 ;;
3279 esac
3280 ;;
3281 no)
3282 current="$2"
3283 revision="$3"
3284 age="$4"
3285 ;;
3286 esac
3287
3288 # Check that each of the things are valid numbers.
3289 case $current in
3290 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]) ;;
3291 *)
3292 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3293 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3294 exit $EXIT_FAILURE
3295 ;;
3296 esac
3297
3298 case $revision in
3299 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]) ;;
3300 *)
3301 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3302 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3303 exit $EXIT_FAILURE
3304 ;;
3305 esac
3306
3307 case $age in
3308 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]) ;;
3309 *)
3310 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3311 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3312 exit $EXIT_FAILURE
3313 ;;
3314 esac
3315
3316 if test "$age" -gt "$current"; then
3317 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3318 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3319 exit $EXIT_FAILURE
3320 fi
3321
3322 # Calculate the version variables.
3323 major=
3324 versuffix=
3325 verstring=
3326 case $version_type in
3327 none) ;;
3328
3329 darwin)
3330 # Like Linux, but with the current version available in
3331 # verstring for coding it into the library header
3332 major=.`expr $current - $age`
3333 versuffix="$major.$age.$revision"
3334 # Darwin ld doesn't like 0 for these options...
3335 minor_current=`expr $current + 1`
3336 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3337 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3338 ;;
3339
3340 freebsd-aout)
3341 major=".$current"
3342 versuffix=".$current.$revision";
3343 ;;
3344
3345 freebsd-elf)
3346 major=".$current"
3347 versuffix=".$current";
3348 ;;
3349
3350 irix | nonstopux)
3351 if test "X$lt_irix_increment" = "Xno"; then
3352 major=`expr $current - $age`
3353 else
3354 major=`expr $current - $age + 1`
3355 fi
3356 case $version_type in
3357 nonstopux) verstring_prefix=nonstopux ;;
3358 *) verstring_prefix=sgi ;;
3359 esac
3360 verstring="$verstring_prefix$major.$revision"
3361
3362 # Add in all the interfaces that we are compatible with.
3363 loop=$revision
3364 while test "$loop" -ne 0; do
3365 iface=`expr $revision - $loop`
3366 loop=`expr $loop - 1`
3367 verstring="$verstring_prefix$major.$iface:$verstring"
3368 done
3369
3370 # Before this point, $major must not contain `.'.
3371 major=.$major
3372 versuffix="$major.$revision"
3373 ;;
3374
3375 linux)
3376 major=.`expr $current - $age`
3377 versuffix="$major.$age.$revision"
3378 ;;
3379
3380 osf)
3381 major=.`expr $current - $age`
3382 versuffix=".$current.$age.$revision"
3383 verstring="$current.$age.$revision"
3384
3385 # Add in all the interfaces that we are compatible with.
3386 loop=$age
3387 while test "$loop" -ne 0; do
3388 iface=`expr $current - $loop`
3389 loop=`expr $loop - 1`
3390 verstring="$verstring:${iface}.0"
3391 done
3392
3393 # Make executables depend on our current version.
3394 verstring="$verstring:${current}.0"
3395 ;;
3396
3397 sunos)
3398 major=".$current"
3399 versuffix=".$current.$revision"
3400 ;;
3401
3402 windows)
3403 # Use '-' rather than '.', since we only want one
3404 # extension on DOS 8.3 filesystems.
3405 major=`expr $current - $age`
3406 versuffix="-$major"
3407 ;;
3408
3409 *)
3410 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3411 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3412 exit $EXIT_FAILURE
3413 ;;
3414 esac
3415
3416 # Clear the version info if we defaulted, and they specified a release.
3417 if test -z "$vinfo" && test -n "$release"; then
3418 major=
3419 case $version_type in
3420 darwin)
3421 # we can't check for "0.0" in archive_cmds due to quoting
3422 # problems, so we reset it completely
3423 verstring=
3424 ;;
3425 *)
3426 verstring="0.0"
3427 ;;
3428 esac
3429 if test "$need_version" = no; then
3430 versuffix=
3431 else
3432 versuffix=".0.0"
3433 fi
3434 fi
3435
3436 # Remove version info from name if versioning should be avoided
3437 if test "$avoid_version" = yes && test "$need_version" = no; then
3438 major=
3439 versuffix=
3440 verstring=""
3441 fi
3442
3443 # Check to see if the archive will have undefined symbols.
3444 if test "$allow_undefined" = yes; then
3445 if test "$allow_undefined_flag" = unsupported; then
3446 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3447 build_libtool_libs=no
3448 build_old_libs=yes
3449 fi
3450 else
3451 # Don't allow undefined symbols.
3452 allow_undefined_flag="$no_undefined_flag"
3453 fi
3454 fi
3455
3456 if test "$mode" != relink; then
3457 # Remove our outputs, but don't remove object files since they
3458 # may have been created when compiling PIC objects.
3459 removelist=
3460 tempremovelist=`$echo "$output_objdir/*"`
3461 for p in $tempremovelist; do
3462 case $p in
3463 *.$objext)
3464 ;;
3465 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3466 if test "X$precious_files_regex" != "X"; then
3467 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3468 then
3469 continue
3470 fi
3471 fi
3472 removelist="$removelist $p"
3473 ;;
3474 *) ;;
3475 esac
3476 done
3477 if test -n "$removelist"; then
3478 $show "${rm}r $removelist"
3479 $run ${rm}r $removelist
3480 fi
3481 fi
3482
3483 # Now set the variables for building old libraries.
3484 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3485 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3486
3487 # Transform .lo files to .o files.
3488 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3489 fi
3490
3491 # Eliminate all temporary directories.
3492 #for path in $notinst_path; do
3493 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3494 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3495 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3496 #done
3497
3498 if test -n "$xrpath"; then
3499 # If the user specified any rpath flags, then add them.
3500 temp_xrpath=
3501 for libdir in $xrpath; do
3502 temp_xrpath="$temp_xrpath -R$libdir"
3503 case "$finalize_rpath " in
3504 *" $libdir "*) ;;
3505 *) finalize_rpath="$finalize_rpath $libdir" ;;
3506 esac
3507 done
3508 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3509 dependency_libs="$temp_xrpath $dependency_libs"
3510 fi
3511 fi
3512
3513 # Make sure dlfiles contains only unique files that won't be dlpreopened
3514 old_dlfiles="$dlfiles"
3515 dlfiles=
3516 for lib in $old_dlfiles; do
3517 case " $dlprefiles $dlfiles " in
3518 *" $lib "*) ;;
3519 *) dlfiles="$dlfiles $lib" ;;
3520 esac
3521 done
3522
3523 # Make sure dlprefiles contains only unique files
3524 old_dlprefiles="$dlprefiles"
3525 dlprefiles=
3526 for lib in $old_dlprefiles; do
3527 case "$dlprefiles " in
3528 *" $lib "*) ;;
3529 *) dlprefiles="$dlprefiles $lib" ;;
3530 esac
3531 done
3532
3533 if test "$build_libtool_libs" = yes; then
3534 if test -n "$rpath"; then
3535 case $host in
3536 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3537 # these systems don't actually have a c library (as such)!
3538 ;;
3539 *-*-rhapsody* | *-*-darwin1.[012])
3540 # Rhapsody C library is in the System framework
3541 deplibs="$deplibs -framework System"
3542 ;;
3543 *-*-netbsd*)
3544 # Don't link with libc until the a.out ld.so is fixed.
3545 ;;
3546 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3547 # Do not include libc due to us having libc/libc_r.
3548 ;;
3549 *-*-sco3.2v5* | *-*-sco5v6*)
3550 # Causes problems with __ctype
3551 ;;
3552 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3553 # Compiler inserts libc in the correct place for threads to work
3554 ;;
3555 *)
3556 # Add libc to deplibs on all other systems if necessary.
3557 if test "$build_libtool_need_lc" = "yes"; then
3558 deplibs="$deplibs -lc"
3559 fi
3560 ;;
3561 esac
3562 fi
3563
3564 # Transform deplibs into only deplibs that can be linked in shared.
3565 name_save=$name
3566 libname_save=$libname
3567 release_save=$release
3568 versuffix_save=$versuffix
3569 major_save=$major
3570 # I'm not sure if I'm treating the release correctly. I think
3571 # release should show up in the -l (ie -lgmp5) so we don't want to
3572 # add it in twice. Is that correct?
3573 release=""
3574 versuffix=""
3575 major=""
3576 newdeplibs=
3577 droppeddeps=no
3578 case $deplibs_check_method in
3579 pass_all)
3580 # Don't check for shared/static. Everything works.
3581 # This might be a little naive. We might want to check
3582 # whether the library exists or not. But this is on
3583 # osf3 & osf4 and I'm not really sure... Just
3584 # implementing what was already the behavior.
3585 newdeplibs=$deplibs
3586 ;;
3587 test_compile)
3588 # This code stresses the "libraries are programs" paradigm to its
3589 # limits. Maybe even breaks it. We compile a program, linking it
3590 # against the deplibs as a proxy for the library. Then we can check
3591 # whether they linked in statically or dynamically with ldd.
3592 $rm conftest.c
3593 cat > conftest.c <<EOF
3594 int main() { return 0; }
3595 EOF
3596 $rm conftest
3597 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3598 ldd_output=`ldd conftest`
3599 for i in $deplibs; do
3600 name=`expr $i : '-l\(.*\)'`
3601 # If $name is empty we are operating on a -L argument.
3602 if test "$name" != "" && test "$name" != "0"; then
3603 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3604 case " $predeps $postdeps " in
3605 *" $i "*)
3606 newdeplibs="$newdeplibs $i"
3607 i=""
3608 ;;
3609 esac
3610 fi
3611 if test -n "$i" ; then
3612 libname=`eval \\$echo \"$libname_spec\"`
3613 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3614 set dummy $deplib_matches
3615 deplib_match=$2
3616 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3617 newdeplibs="$newdeplibs $i"
3618 else
3619 droppeddeps=yes
3620 $echo
3621 $echo "*** Warning: dynamic linker does not accept needed library $i."
3622 $echo "*** I have the capability to make that library automatically link in when"
3623 $echo "*** you link to this library. But I can only do this if you have a"
3624 $echo "*** shared version of the library, which I believe you do not have"
3625 $echo "*** because a test_compile did reveal that the linker did not use it for"
3626 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3627 fi
3628 fi
3629 else
3630 newdeplibs="$newdeplibs $i"
3631 fi
3632 done
3633 else
3634 # Error occurred in the first compile. Let's try to salvage
3635 # the situation: Compile a separate program for each library.
3636 for i in $deplibs; do
3637 name=`expr $i : '-l\(.*\)'`
3638 # If $name is empty we are operating on a -L argument.
3639 if test "$name" != "" && test "$name" != "0"; then
3640 $rm conftest
3641 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3642 ldd_output=`ldd conftest`
3643 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3644 case " $predeps $postdeps " in
3645 *" $i "*)
3646 newdeplibs="$newdeplibs $i"
3647 i=""
3648 ;;
3649 esac
3650 fi
3651 if test -n "$i" ; then
3652 libname=`eval \\$echo \"$libname_spec\"`
3653 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3654 set dummy $deplib_matches
3655 deplib_match=$2
3656 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3657 newdeplibs="$newdeplibs $i"
3658 else
3659 droppeddeps=yes
3660 $echo
3661 $echo "*** Warning: dynamic linker does not accept needed library $i."
3662 $echo "*** I have the capability to make that library automatically link in when"
3663 $echo "*** you link to this library. But I can only do this if you have a"
3664 $echo "*** shared version of the library, which you do not appear to have"
3665 $echo "*** because a test_compile did reveal that the linker did not use this one"
3666 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3667 fi
3668 fi
3669 else
3670 droppeddeps=yes
3671 $echo
3672 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3673 $echo "*** make it link in! You will probably need to install it or some"
3674 $echo "*** library that it depends on before this library will be fully"
3675 $echo "*** functional. Installing it before continuing would be even better."
3676 fi
3677 else
3678 newdeplibs="$newdeplibs $i"
3679 fi
3680 done
3681 fi
3682 ;;
3683 file_magic*)
3684 set dummy $deplibs_check_method
3685 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3686 for a_deplib in $deplibs; do
3687 name=`expr $a_deplib : '-l\(.*\)'`
3688 # If $name is empty we are operating on a -L argument.
3689 if test "$name" != "" && test "$name" != "0"; then
3690 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3691 case " $predeps $postdeps " in
3692 *" $a_deplib "*)
3693 newdeplibs="$newdeplibs $a_deplib"
3694 a_deplib=""
3695 ;;
3696 esac
3697 fi
3698 if test -n "$a_deplib" ; then
3699 libname=`eval \\$echo \"$libname_spec\"`
3700 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3701 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3702 for potent_lib in $potential_libs; do
3703 # Follow soft links.
3704 if ls -lLd "$potent_lib" 2>/dev/null \
3705 | grep " -> " >/dev/null; then
3706 continue
3707 fi
3708 # The statement above tries to avoid entering an
3709 # endless loop below, in case of cyclic links.
3710 # We might still enter an endless loop, since a link
3711 # loop can be closed while we follow links,
3712 # but so what?
3713 potlib="$potent_lib"
3714 while test -h "$potlib" 2>/dev/null; do
3715 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3716 case $potliblink in
3717 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3718 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3719 esac
3720 done
3721 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3722 | ${SED} 10q \
3723 | $EGREP "$file_magic_regex" > /dev/null; then
3724 newdeplibs="$newdeplibs $a_deplib"
3725 a_deplib=""
3726 break 2
3727 fi
3728 done
3729 done
3730 fi
3731 if test -n "$a_deplib" ; then
3732 droppeddeps=yes
3733 $echo
3734 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3735 $echo "*** I have the capability to make that library automatically link in when"
3736 $echo "*** you link to this library. But I can only do this if you have a"
3737 $echo "*** shared version of the library, which you do not appear to have"
3738 $echo "*** because I did check the linker path looking for a file starting"
3739 if test -z "$potlib" ; then
3740 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3741 else
3742 $echo "*** with $libname and none of the candidates passed a file format test"
3743 $echo "*** using a file magic. Last file checked: $potlib"
3744 fi
3745 fi
3746 else
3747 # Add a -L argument.
3748 newdeplibs="$newdeplibs $a_deplib"
3749 fi
3750 done # Gone through all deplibs.
3751 ;;
3752 match_pattern*)
3753 set dummy $deplibs_check_method
3754 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3755 for a_deplib in $deplibs; do
3756 name=`expr $a_deplib : '-l\(.*\)'`
3757 # If $name is empty we are operating on a -L argument.
3758 if test -n "$name" && test "$name" != "0"; then
3759 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3760 case " $predeps $postdeps " in
3761 *" $a_deplib "*)
3762 newdeplibs="$newdeplibs $a_deplib"
3763 a_deplib=""
3764 ;;
3765 esac
3766 fi
3767 if test -n "$a_deplib" ; then
3768 libname=`eval \\$echo \"$libname_spec\"`
3769 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3770 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3771 for potent_lib in $potential_libs; do
3772 potlib="$potent_lib" # see symlink-check above in file_magic test
3773 if eval $echo \"$potent_lib\" 2>/dev/null \
3774 | ${SED} 10q \
3775 | $EGREP "$match_pattern_regex" > /dev/null; then
3776 newdeplibs="$newdeplibs $a_deplib"
3777 a_deplib=""
3778 break 2
3779 fi
3780 done
3781 done
3782 fi
3783 if test -n "$a_deplib" ; then
3784 droppeddeps=yes
3785 $echo
3786 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3787 $echo "*** I have the capability to make that library automatically link in when"
3788 $echo "*** you link to this library. But I can only do this if you have a"
3789 $echo "*** shared version of the library, which you do not appear to have"
3790 $echo "*** because I did check the linker path looking for a file starting"
3791 if test -z "$potlib" ; then
3792 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3793 else
3794 $echo "*** with $libname and none of the candidates passed a file format test"
3795 $echo "*** using a regex pattern. Last file checked: $potlib"
3796 fi
3797 fi
3798 else
3799 # Add a -L argument.
3800 newdeplibs="$newdeplibs $a_deplib"
3801 fi
3802 done # Gone through all deplibs.
3803 ;;
3804 none | unknown | *)
3805 newdeplibs=""
3806 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3807 -e 's/ -[LR][^ ]*//g'`
3808 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3809 for i in $predeps $postdeps ; do
3810 # can't use Xsed below, because $i might contain '/'
3811 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3812 done
3813 fi
3814 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3815 | grep . >/dev/null; then
3816 $echo
3817 if test "X$deplibs_check_method" = "Xnone"; then
3818 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3819 else
3820 $echo "*** Warning: inter-library dependencies are not known to be supported."
3821 fi
3822 $echo "*** All declared inter-library dependencies are being dropped."
3823 droppeddeps=yes
3824 fi
3825 ;;
3826 esac
3827 versuffix=$versuffix_save
3828 major=$major_save
3829 release=$release_save
3830 libname=$libname_save
3831 name=$name_save
3832
3833 case $host in
3834 *-*-rhapsody* | *-*-darwin1.[012])
3835 # On Rhapsody replace the C library is the System framework
3836 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3837 ;;
3838 esac
3839
3840 if test "$droppeddeps" = yes; then
3841 if test "$module" = yes; then
3842 $echo
3843 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3844 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3845 $echo "*** a static module, that should work as long as the dlopening"
3846 $echo "*** application is linked with the -dlopen flag."
3847 if test -z "$global_symbol_pipe"; then
3848 $echo
3849 $echo "*** However, this would only work if libtool was able to extract symbol"
3850 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3851 $echo "*** not find such a program. So, this module is probably useless."
3852 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3853 fi
3854 if test "$build_old_libs" = no; then
3855 oldlibs="$output_objdir/$libname.$libext"
3856 build_libtool_libs=module
3857 build_old_libs=yes
3858 else
3859 build_libtool_libs=no
3860 fi
3861 else
3862 $echo "*** The inter-library dependencies that have been dropped here will be"
3863 $echo "*** automatically added whenever a program is linked with this library"
3864 $echo "*** or is declared to -dlopen it."
3865
3866 if test "$allow_undefined" = no; then
3867 $echo
3868 $echo "*** Since this library must not contain undefined symbols,"
3869 $echo "*** because either the platform does not support them or"
3870 $echo "*** it was explicitly requested with -no-undefined,"
3871 $echo "*** libtool will only create a static version of it."
3872 if test "$build_old_libs" = no; then
3873 oldlibs="$output_objdir/$libname.$libext"
3874 build_libtool_libs=module
3875 build_old_libs=yes
3876 else
3877 build_libtool_libs=no
3878 fi
3879 fi
3880 fi
3881 fi
3882 # Done checking deplibs!
3883 deplibs=$newdeplibs
3884 fi
3885
3886
3887 # move library search paths that coincide with paths to not yet
3888 # installed libraries to the beginning of the library search list
3889 new_libs=
3890 for path in $notinst_path; do
3891 case " $new_libs " in
3892 *" -L$path/$objdir "*) ;;
3893 *)
3894 case " $deplibs " in
3895 *" -L$path/$objdir "*)
3896 new_libs="$new_libs -L$path/$objdir" ;;
3897 esac
3898 ;;
3899 esac
3900 done
3901 for deplib in $deplibs; do
3902 case $deplib in
3903 -L*)
3904 case " $new_libs " in
3905 *" $deplib "*) ;;
3906 *) new_libs="$new_libs $deplib" ;;
3907 esac
3908 ;;
3909 *) new_libs="$new_libs $deplib" ;;
3910 esac
3911 done
3912 deplibs="$new_libs"
3913
3914
3915 # All the library-specific variables (install_libdir is set above).
3916 library_names=
3917 old_library=
3918 dlname=
3919
3920 # Test again, we may have decided not to build it any more
3921 if test "$build_libtool_libs" = yes; then
3922 if test "$hardcode_into_libs" = yes; then
3923 # Hardcode the library paths
3924 hardcode_libdirs=
3925 dep_rpath=
3926 rpath="$finalize_rpath"
3927 test "$mode" != relink && rpath="$compile_rpath$rpath"
3928 for libdir in $rpath; do
3929 if test -n "$hardcode_libdir_flag_spec"; then
3930 if test -n "$hardcode_libdir_separator"; then
3931 if test -z "$hardcode_libdirs"; then
3932 hardcode_libdirs="$libdir"
3933 else
3934 # Just accumulate the unique libdirs.
3935 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3936 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3937 ;;
3938 *)
3939 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3940 ;;
3941 esac
3942 fi
3943 else
3944 eval flag=\"$hardcode_libdir_flag_spec\"
3945 dep_rpath="$dep_rpath $flag"
3946 fi
3947 elif test -n "$runpath_var"; then
3948 case "$perm_rpath " in
3949 *" $libdir "*) ;;
3950 *) perm_rpath="$perm_rpath $libdir" ;;
3951 esac
3952 fi
3953 done
3954 # Substitute the hardcoded libdirs into the rpath.
3955 if test -n "$hardcode_libdir_separator" &&
3956 test -n "$hardcode_libdirs"; then
3957 libdir="$hardcode_libdirs"
3958 if test -n "$hardcode_libdir_flag_spec_ld"; then
3959 case $archive_cmds in
3960 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
3961 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
3962 esac
3963 else
3964 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3965 fi
3966 fi
3967 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3968 # We should set the runpath_var.
3969 rpath=
3970 for dir in $perm_rpath; do
3971 rpath="$rpath$dir:"
3972 done
3973 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3974 fi
3975 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3976 fi
3977
3978 shlibpath="$finalize_shlibpath"
3979 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3980 if test -n "$shlibpath"; then
3981 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3982 fi
3983
3984 # Get the real and link names of the library.
3985 eval shared_ext=\"$shrext_cmds\"
3986 eval library_names=\"$library_names_spec\"
3987 set dummy $library_names
3988 realname="$2"
3989 shift; shift
3990
3991 if test -n "$soname_spec"; then
3992 eval soname=\"$soname_spec\"
3993 else
3994 soname="$realname"
3995 fi
3996 if test -z "$dlname"; then
3997 dlname=$soname
3998 fi
3999
4000 lib="$output_objdir/$realname"
4001 linknames=
4002 for link
4003 do
4004 linknames="$linknames $link"
4005 done
4006
4007 # Use standard objects if they are pic
4008 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4009
4010 # Prepare the list of exported symbols
4011 if test -z "$export_symbols"; then
4012 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4013 $show "generating symbol list for \`$libname.la'"
4014 export_symbols="$output_objdir/$libname.exp"
4015 $run $rm $export_symbols
4016 cmds=$export_symbols_cmds
4017 save_ifs="$IFS"; IFS='~'
4018 for cmd in $cmds; do
4019 IFS="$save_ifs"
4020 eval cmd=\"$cmd\"
4021 if len=`expr "X$cmd" : ".*"` &&
4022 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4023 $show "$cmd"
4024 $run eval "$cmd" || exit $?
4025 skipped_export=false
4026 else
4027 # The command line is too long to execute in one step.
4028 $show "using reloadable object file for export list..."
4029 skipped_export=:
4030 # Break out early, otherwise skipped_export may be
4031 # set to false by a later but shorter cmd.
4032 break
4033 fi
4034 done
4035 IFS="$save_ifs"
4036 if test -n "$export_symbols_regex"; then
4037 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4038 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4039 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4040 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4041 fi
4042 fi
4043 fi
4044
4045 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4046 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4047 fi
4048
4049 tmp_deplibs=
4050 for test_deplib in $deplibs; do
4051 case " $convenience " in
4052 *" $test_deplib "*) ;;
4053 *)
4054 tmp_deplibs="$tmp_deplibs $test_deplib"
4055 ;;
4056 esac
4057 done
4058 deplibs="$tmp_deplibs"
4059
4060 if test -n "$convenience"; then
4061 if test -n "$whole_archive_flag_spec"; then
4062 save_libobjs=$libobjs
4063 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4064 else
4065 gentop="$output_objdir/${outputname}x"
4066 generated="$generated $gentop"
4067
4068 func_extract_archives $gentop $convenience
4069 libobjs="$libobjs $func_extract_archives_result"
4070 fi
4071 fi
4072
4073 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4074 eval flag=\"$thread_safe_flag_spec\"
4075 linker_flags="$linker_flags $flag"
4076 fi
4077
4078 # Make a backup of the uninstalled library when relinking
4079 if test "$mode" = relink; then
4080 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4081 fi
4082
4083 # Do each of the archive commands.
4084 if test "$module" = yes && test -n "$module_cmds" ; then
4085 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4086 eval test_cmds=\"$module_expsym_cmds\"
4087 cmds=$module_expsym_cmds
4088 else
4089 eval test_cmds=\"$module_cmds\"
4090 cmds=$module_cmds
4091 fi
4092 else
4093 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4094 eval test_cmds=\"$archive_expsym_cmds\"
4095 cmds=$archive_expsym_cmds
4096 else
4097 eval test_cmds=\"$archive_cmds\"
4098 cmds=$archive_cmds
4099 fi
4100 fi
4101
4102 if test "X$skipped_export" != "X:" &&
4103 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4104 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4105 :
4106 else
4107 # The command line is too long to link in one step, link piecewise.
4108 $echo "creating reloadable object files..."
4109
4110 # Save the value of $output and $libobjs because we want to
4111 # use them later. If we have whole_archive_flag_spec, we
4112 # want to use save_libobjs as it was before
4113 # whole_archive_flag_spec was expanded, because we can't
4114 # assume the linker understands whole_archive_flag_spec.
4115 # This may have to be revisited, in case too many
4116 # convenience libraries get linked in and end up exceeding
4117 # the spec.
4118 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4119 save_libobjs=$libobjs
4120 fi
4121 save_output=$output
4122 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4123
4124 # Clear the reloadable object creation command queue and
4125 # initialize k to one.
4126 test_cmds=
4127 concat_cmds=
4128 objlist=
4129 delfiles=
4130 last_robj=
4131 k=1
4132 output=$output_objdir/$output_la-${k}.$objext
4133 # Loop over the list of objects to be linked.
4134 for obj in $save_libobjs
4135 do
4136 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4137 if test "X$objlist" = X ||
4138 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4139 test "$len" -le "$max_cmd_len"; }; then
4140 objlist="$objlist $obj"
4141 else
4142 # The command $test_cmds is almost too long, add a
4143 # command to the queue.
4144 if test "$k" -eq 1 ; then
4145 # The first file doesn't have a previous command to add.
4146 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4147 else
4148 # All subsequent reloadable object files will link in
4149 # the last one created.
4150 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4151 fi
4152 last_robj=$output_objdir/$output_la-${k}.$objext
4153 k=`expr $k + 1`
4154 output=$output_objdir/$output_la-${k}.$objext
4155 objlist=$obj
4156 len=1
4157 fi
4158 done
4159 # Handle the remaining objects by creating one last
4160 # reloadable object file. All subsequent reloadable object
4161 # files will link in the last one created.
4162 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4163 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4164
4165 if ${skipped_export-false}; then
4166 $show "generating symbol list for \`$libname.la'"
4167 export_symbols="$output_objdir/$libname.exp"
4168 $run $rm $export_symbols
4169 libobjs=$output
4170 # Append the command to create the export file.
4171 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4172 fi
4173
4174 # Set up a command to remove the reloadable object files
4175 # after they are used.
4176 i=0
4177 while test "$i" -lt "$k"
4178 do
4179 i=`expr $i + 1`
4180 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4181 done
4182
4183 $echo "creating a temporary reloadable object file: $output"
4184
4185 # Loop through the commands generated above and execute them.
4186 save_ifs="$IFS"; IFS='~'
4187 for cmd in $concat_cmds; do
4188 IFS="$save_ifs"
4189 $show "$cmd"
4190 $run eval "$cmd" || exit $?
4191 done
4192 IFS="$save_ifs"
4193
4194 libobjs=$output
4195 # Restore the value of output.
4196 output=$save_output
4197
4198 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4199 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4200 fi
4201 # Expand the library linking commands again to reset the
4202 # value of $libobjs for piecewise linking.
4203
4204 # Do each of the archive commands.
4205 if test "$module" = yes && test -n "$module_cmds" ; then
4206 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4207 cmds=$module_expsym_cmds
4208 else
4209 cmds=$module_cmds
4210 fi
4211 else
4212 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4213 cmds=$archive_expsym_cmds
4214 else
4215 cmds=$archive_cmds
4216 fi
4217 fi
4218
4219 # Append the command to remove the reloadable object files
4220 # to the just-reset $cmds.
4221 eval cmds=\"\$cmds~\$rm $delfiles\"
4222 fi
4223 save_ifs="$IFS"; IFS='~'
4224 for cmd in $cmds; do
4225 IFS="$save_ifs"
4226 eval cmd=\"$cmd\"
4227 $show "$cmd"
4228 $run eval "$cmd" || {
4229 lt_exit=$?
4230
4231 # Restore the uninstalled library and exit
4232 if test "$mode" = relink; then
4233 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4234 fi
4235
4236 exit $lt_exit
4237 }
4238 done
4239 IFS="$save_ifs"
4240
4241 # Restore the uninstalled library and exit
4242 if test "$mode" = relink; then
4243 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4244
4245 if test -n "$convenience"; then
4246 if test -z "$whole_archive_flag_spec"; then
4247 $show "${rm}r $gentop"
4248 $run ${rm}r "$gentop"
4249 fi
4250 fi
4251
4252 exit $EXIT_SUCCESS
4253 fi
4254
4255 # Create links to the real library.
4256 for linkname in $linknames; do
4257 if test "$realname" != "$linkname"; then
4258 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4259 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4260 fi
4261 done
4262
4263 # If -module or -export-dynamic was specified, set the dlname.
4264 if test "$module" = yes || test "$export_dynamic" = yes; then
4265 # On all known operating systems, these are identical.
4266 dlname="$soname"
4267 fi
4268 fi
4269 ;;
4270
4271 obj)
4272 case " $deplibs" in
4273 *\ -l* | *\ -L*)
4274 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4275 esac
4276
4277 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4278 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4279 fi
4280
4281 if test -n "$rpath"; then
4282 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4283 fi
4284
4285 if test -n "$xrpath"; then
4286 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4287 fi
4288
4289 if test -n "$vinfo"; then
4290 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4291 fi
4292
4293 if test -n "$release"; then
4294 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4295 fi
4296
4297 case $output in
4298 *.lo)
4299 if test -n "$objs$old_deplibs"; then
4300 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4301 exit $EXIT_FAILURE
4302 fi
4303 libobj="$output"
4304 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4305 ;;
4306 *)
4307 libobj=
4308 obj="$output"
4309 ;;
4310 esac
4311
4312 # Delete the old objects.
4313 $run $rm $obj $libobj
4314
4315 # Objects from convenience libraries. This assumes
4316 # single-version convenience libraries. Whenever we create
4317 # different ones for PIC/non-PIC, this we'll have to duplicate
4318 # the extraction.
4319 reload_conv_objs=
4320 gentop=
4321 # reload_cmds runs $LD directly, so let us get rid of
4322 # -Wl from whole_archive_flag_spec and hope we can get by with
4323 # turning comma into space..
4324 wl=
4325
4326 if test -n "$convenience"; then
4327 if test -n "$whole_archive_flag_spec"; then
4328 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4329 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4330 else
4331 gentop="$output_objdir/${obj}x"
4332 generated="$generated $gentop"
4333
4334 func_extract_archives $gentop $convenience
4335 reload_conv_objs="$reload_objs $func_extract_archives_result"
4336 fi
4337 fi
4338
4339 # Create the old-style object.
4340 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
4341
4342 output="$obj"
4343 cmds=$reload_cmds
4344 save_ifs="$IFS"; IFS='~'
4345 for cmd in $cmds; do
4346 IFS="$save_ifs"
4347 eval cmd=\"$cmd\"
4348 $show "$cmd"
4349 $run eval "$cmd" || exit $?
4350 done
4351 IFS="$save_ifs"
4352
4353 # Exit if we aren't doing a library object file.
4354 if test -z "$libobj"; then
4355 if test -n "$gentop"; then
4356 $show "${rm}r $gentop"
4357 $run ${rm}r $gentop
4358 fi
4359
4360 exit $EXIT_SUCCESS
4361 fi
4362
4363 if test "$build_libtool_libs" != yes; then
4364 if test -n "$gentop"; then
4365 $show "${rm}r $gentop"
4366 $run ${rm}r $gentop
4367 fi
4368
4369 # Create an invalid libtool object if no PIC, so that we don't
4370 # accidentally link it into a program.
4371 # $show "echo timestamp > $libobj"
4372 # $run eval "echo timestamp > $libobj" || exit $?
4373 exit $EXIT_SUCCESS
4374 fi
4375
4376 if test -n "$pic_flag" || test "$pic_mode" != default; then
4377 # Only do commands if we really have different PIC objects.
4378 reload_objs="$libobjs $reload_conv_objs"
4379 output="$libobj"
4380 cmds=$reload_cmds
4381 save_ifs="$IFS"; IFS='~'
4382 for cmd in $cmds; do
4383 IFS="$save_ifs"
4384 eval cmd=\"$cmd\"
4385 $show "$cmd"
4386 $run eval "$cmd" || exit $?
4387 done
4388 IFS="$save_ifs"
4389 fi
4390
4391 if test -n "$gentop"; then
4392 $show "${rm}r $gentop"
4393 $run ${rm}r $gentop
4394 fi
4395
4396 exit $EXIT_SUCCESS
4397 ;;
4398
4399 prog)
4400 case $host in
4401 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4402 esac
4403 if test -n "$vinfo"; then
4404 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4405 fi
4406
4407 if test -n "$release"; then
4408 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4409 fi
4410
4411 if test "$preload" = yes; then
4412 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4413 test "$dlopen_self_static" = unknown; then
4414 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4415 fi
4416 fi
4417
4418 case $host in
4419 *-*-rhapsody* | *-*-darwin1.[012])
4420 # On Rhapsody replace the C library is the System framework
4421 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4422 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4423 ;;
4424 esac
4425
4426 case $host in
4427 *darwin*)
4428 # Don't allow lazy linking, it breaks C++ global constructors
4429 if test "$tagname" = CXX ; then
4430 compile_command="$compile_command ${wl}-bind_at_load"
4431 finalize_command="$finalize_command ${wl}-bind_at_load"
4432 fi
4433 ;;
4434 esac
4435
4436
4437 # move library search paths that coincide with paths to not yet
4438 # installed libraries to the beginning of the library search list
4439 new_libs=
4440 for path in $notinst_path; do
4441 case " $new_libs " in
4442 *" -L$path/$objdir "*) ;;
4443 *)
4444 case " $compile_deplibs " in
4445 *" -L$path/$objdir "*)
4446 new_libs="$new_libs -L$path/$objdir" ;;
4447 esac
4448 ;;
4449 esac
4450 done
4451 for deplib in $compile_deplibs; do
4452 case $deplib in
4453 -L*)
4454 case " $new_libs " in
4455 *" $deplib "*) ;;
4456 *) new_libs="$new_libs $deplib" ;;
4457 esac
4458 ;;
4459 *) new_libs="$new_libs $deplib" ;;
4460 esac
4461 done
4462 compile_deplibs="$new_libs"
4463
4464
4465 compile_command="$compile_command $compile_deplibs"
4466 finalize_command="$finalize_command $finalize_deplibs"
4467
4468 if test -n "$rpath$xrpath"; then
4469 # If the user specified any rpath flags, then add them.
4470 for libdir in $rpath $xrpath; do
4471 # This is the magic to use -rpath.
4472 case "$finalize_rpath " in
4473 *" $libdir "*) ;;
4474 *) finalize_rpath="$finalize_rpath $libdir" ;;
4475 esac
4476 done
4477 fi
4478
4479 # Now hardcode the library paths
4480 rpath=
4481 hardcode_libdirs=
4482 for libdir in $compile_rpath $finalize_rpath; do
4483 if test -n "$hardcode_libdir_flag_spec"; then
4484 if test -n "$hardcode_libdir_separator"; then
4485 if test -z "$hardcode_libdirs"; then
4486 hardcode_libdirs="$libdir"
4487 else
4488 # Just accumulate the unique libdirs.
4489 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4490 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4491 ;;
4492 *)
4493 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4494 ;;
4495 esac
4496 fi
4497 else
4498 eval flag=\"$hardcode_libdir_flag_spec\"
4499 rpath="$rpath $flag"
4500 fi
4501 elif test -n "$runpath_var"; then
4502 case "$perm_rpath " in
4503 *" $libdir "*) ;;
4504 *) perm_rpath="$perm_rpath $libdir" ;;
4505 esac
4506 fi
4507 case $host in
4508 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4509 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4510 case :$dllsearchpath: in
4511 *":$libdir:"*) ;;
4512 *) dllsearchpath="$dllsearchpath:$libdir";;
4513 esac
4514 case :$dllsearchpath: in
4515 *":$testbindir:"*) ;;
4516 *) dllsearchpath="$dllsearchpath:$testbindir";;
4517 esac
4518 ;;
4519 esac
4520 done
4521 # Substitute the hardcoded libdirs into the rpath.
4522 if test -n "$hardcode_libdir_separator" &&
4523 test -n "$hardcode_libdirs"; then
4524 libdir="$hardcode_libdirs"
4525 eval rpath=\" $hardcode_libdir_flag_spec\"
4526 fi
4527 compile_rpath="$rpath"
4528
4529 rpath=
4530 hardcode_libdirs=
4531 for libdir in $finalize_rpath; do
4532 if test -n "$hardcode_libdir_flag_spec"; then
4533 if test -n "$hardcode_libdir_separator"; then
4534 if test -z "$hardcode_libdirs"; then
4535 hardcode_libdirs="$libdir"
4536 else
4537 # Just accumulate the unique libdirs.
4538 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4539 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4540 ;;
4541 *)
4542 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4543 ;;
4544 esac
4545 fi
4546 else
4547 eval flag=\"$hardcode_libdir_flag_spec\"
4548 rpath="$rpath $flag"
4549 fi
4550 elif test -n "$runpath_var"; then
4551 case "$finalize_perm_rpath " in
4552 *" $libdir "*) ;;
4553 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4554 esac
4555 fi
4556 done
4557 # Substitute the hardcoded libdirs into the rpath.
4558 if test -n "$hardcode_libdir_separator" &&
4559 test -n "$hardcode_libdirs"; then
4560 libdir="$hardcode_libdirs"
4561 eval rpath=\" $hardcode_libdir_flag_spec\"
4562 fi
4563 finalize_rpath="$rpath"
4564
4565 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4566 # Transform all the library objects into standard objects.
4567 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4568 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4569 fi
4570
4571 dlsyms=
4572 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4573 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4574 dlsyms="${outputname}S.c"
4575 else
4576 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4577 fi
4578 fi
4579
4580 if test -n "$dlsyms"; then
4581 case $dlsyms in
4582 "") ;;
4583 *.c)
4584 # Discover the nlist of each of the dlfiles.
4585 nlist="$output_objdir/${outputname}.nm"
4586
4587 $show "$rm $nlist ${nlist}S ${nlist}T"
4588 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4589
4590 # Parse the name list into a source file.
4591 $show "creating $output_objdir/$dlsyms"
4592
4593 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4594 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4595 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4596
4597 #ifdef __cplusplus
4598 extern \"C\" {
4599 #endif
4600
4601 /* Prevent the only kind of declaration conflicts we can make. */
4602 #define lt_preloaded_symbols some_other_symbol
4603
4604 /* External symbol declarations for the compiler. */\
4605 "
4606
4607 if test "$dlself" = yes; then
4608 $show "generating symbol list for \`$output'"
4609
4610 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4611
4612 # Add our own program objects to the symbol list.
4613 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4614 for arg in $progfiles; do
4615 $show "extracting global C symbols from \`$arg'"
4616 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4617 done
4618
4619 if test -n "$exclude_expsyms"; then
4620 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4621 $run eval '$mv "$nlist"T "$nlist"'
4622 fi
4623
4624 if test -n "$export_symbols_regex"; then
4625 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4626 $run eval '$mv "$nlist"T "$nlist"'
4627 fi
4628
4629 # Prepare the list of exported symbols
4630 if test -z "$export_symbols"; then
4631 export_symbols="$output_objdir/$outputname.exp"
4632 $run $rm $export_symbols
4633 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4634 case $host in
4635 *cygwin* | *mingw* )
4636 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4637 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4638 ;;
4639 esac
4640 else
4641 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4642 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4643 $run eval 'mv "$nlist"T "$nlist"'
4644 case $host in
4645 *cygwin* | *mingw* )
4646 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4647 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4648 ;;
4649 esac
4650 fi
4651 fi
4652
4653 for arg in $dlprefiles; do
4654 $show "extracting global C symbols from \`$arg'"
4655 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4656 $run eval '$echo ": $name " >> "$nlist"'
4657 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4658 done
4659
4660 if test -z "$run"; then
4661 # Make sure we have at least an empty file.
4662 test -f "$nlist" || : > "$nlist"
4663
4664 if test -n "$exclude_expsyms"; then
4665 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4666 $mv "$nlist"T "$nlist"
4667 fi
4668
4669 # Try sorting and uniquifying the output.
4670 if grep -v "^: " < "$nlist" |
4671 if sort -k 3 </dev/null >/dev/null 2>&1; then
4672 sort -k 3
4673 else
4674 sort +2
4675 fi |
4676 uniq > "$nlist"S; then
4677 :
4678 else
4679 grep -v "^: " < "$nlist" > "$nlist"S
4680 fi
4681
4682 if test -f "$nlist"S; then
4683 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4684 else
4685 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4686 fi
4687
4688 $echo >> "$output_objdir/$dlsyms" "\
4689
4690 #undef lt_preloaded_symbols
4691
4692 #if defined (__STDC__) && __STDC__
4693 # define lt_ptr void *
4694 #else
4695 # define lt_ptr char *
4696 # define const
4697 #endif
4698
4699 /* The mapping between symbol names and symbols. */
4700 "
4701
4702 case $host in
4703 *cygwin* | *mingw* )
4704 $echo >> "$output_objdir/$dlsyms" "\
4705 /* DATA imports from DLLs on WIN32 can't be const, because
4706 runtime relocations are performed -- see ld's documentation
4707 on pseudo-relocs */
4708 struct {
4709 "
4710 ;;
4711 * )
4712 $echo >> "$output_objdir/$dlsyms" "\
4713 const struct {
4714 "
4715 ;;
4716 esac
4717
4718
4719 $echo >> "$output_objdir/$dlsyms" "\
4720 const char *name;
4721 lt_ptr address;
4722 }
4723 lt_preloaded_symbols[] =
4724 {\
4725 "
4726
4727 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4728
4729 $echo >> "$output_objdir/$dlsyms" "\
4730 {0, (lt_ptr) 0}
4731 };
4732
4733 /* This works around a problem in FreeBSD linker */
4734 #ifdef FREEBSD_WORKAROUND
4735 static const void *lt_preloaded_setup() {
4736 return lt_preloaded_symbols;
4737 }
4738 #endif
4739
4740 #ifdef __cplusplus
4741 }
4742 #endif\
4743 "
4744 fi
4745
4746 pic_flag_for_symtable=
4747 case $host in
4748 # compiling the symbol table file with pic_flag works around
4749 # a FreeBSD bug that causes programs to crash when -lm is
4750 # linked before any other PIC object. But we must not use
4751 # pic_flag when linking with -static. The problem exists in
4752 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4753 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4754 case "$compile_command " in
4755 *" -static "*) ;;
4756 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4757 esac;;
4758 *-*-hpux*)
4759 case "$compile_command " in
4760 *" -static "*) ;;
4761 *) pic_flag_for_symtable=" $pic_flag";;
4762 esac
4763 esac
4764
4765 # Now compile the dynamic symbol file.
4766 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4767 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4768
4769 # Clean up the generated files.
4770 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4771 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4772
4773 # Transform the symbol file into the correct name.
4774 case $host in
4775 *cygwin* | *mingw* )
4776 if test -f "$output_objdir/${outputname}.def" ; then
4777 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4778 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4779 else
4780 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4781 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4782 fi
4783 ;;
4784 * )
4785 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4786 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4787 ;;
4788 esac
4789 ;;
4790 *)
4791 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4792 exit $EXIT_FAILURE
4793 ;;
4794 esac
4795 else
4796 # We keep going just in case the user didn't refer to
4797 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4798 # really was required.
4799
4800 # Nullify the symbol file.
4801 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4802 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4803 fi
4804
4805 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4806 # Replace the output file specification.
4807 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4808 link_command="$compile_command$compile_rpath"
4809
4810 # We have no uninstalled library dependencies, so finalize right now.
4811 $show "$link_command"
4812 $run eval "$link_command"
4813 exit_status=$?
4814
4815 # Delete the generated files.
4816 if test -n "$dlsyms"; then
4817 $show "$rm $output_objdir/${outputname}S.${objext}"
4818 $run $rm "$output_objdir/${outputname}S.${objext}"
4819 fi
4820
4821 exit $exit_status
4822 fi
4823
4824 if test -n "$shlibpath_var"; then
4825 # We should set the shlibpath_var
4826 rpath=
4827 for dir in $temp_rpath; do
4828 case $dir in
4829 [\\/]* | [A-Za-z]:[\\/]*)
4830 # Absolute path.
4831 rpath="$rpath$dir:"
4832 ;;
4833 *)
4834 # Relative path: add a thisdir entry.
4835 rpath="$rpath\$thisdir/$dir:"
4836 ;;
4837 esac
4838 done
4839 temp_rpath="$rpath"
4840 fi
4841
4842 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4843 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4844 fi
4845 if test -n "$finalize_shlibpath"; then
4846 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4847 fi
4848
4849 compile_var=
4850 finalize_var=
4851 if test -n "$runpath_var"; then
4852 if test -n "$perm_rpath"; then
4853 # We should set the runpath_var.
4854 rpath=
4855 for dir in $perm_rpath; do
4856 rpath="$rpath$dir:"
4857 done
4858 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4859 fi
4860 if test -n "$finalize_perm_rpath"; then
4861 # We should set the runpath_var.
4862 rpath=
4863 for dir in $finalize_perm_rpath; do
4864 rpath="$rpath$dir:"
4865 done
4866 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4867 fi
4868 fi
4869
4870 if test "$no_install" = yes; then
4871 # We don't need to create a wrapper script.
4872 link_command="$compile_var$compile_command$compile_rpath"
4873 # Replace the output file specification.
4874 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4875 # Delete the old output file.
4876 $run $rm $output
4877 # Link the executable and exit
4878 $show "$link_command"
4879 $run eval "$link_command" || exit $?
4880 exit $EXIT_SUCCESS
4881 fi
4882
4883 if test "$hardcode_action" = relink; then
4884 # Fast installation is not supported
4885 link_command="$compile_var$compile_command$compile_rpath"
4886 relink_command="$finalize_var$finalize_command$finalize_rpath"
4887
4888 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4889 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4890 else
4891 if test "$fast_install" != no; then
4892 link_command="$finalize_var$compile_command$finalize_rpath"
4893 if test "$fast_install" = yes; then
4894 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4895 else
4896 # fast_install is set to needless
4897 relink_command=
4898 fi
4899 else
4900 link_command="$compile_var$compile_command$compile_rpath"
4901 relink_command="$finalize_var$finalize_command$finalize_rpath"
4902 fi
4903 fi
4904
4905 # Replace the output file specification.
4906 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4907
4908 # Delete the old output files.
4909 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4910
4911 $show "$link_command"
4912 $run eval "$link_command" || exit $?
4913
4914 # Now create the wrapper script.
4915 $show "creating $output"
4916
4917 # Quote the relink command for shipping.
4918 if test -n "$relink_command"; then
4919 # Preserve any variables that may affect compiler behavior
4920 for var in $variables_saved_for_relink; do
4921 if eval test -z \"\${$var+set}\"; then
4922 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4923 elif eval var_value=\$$var; test -z "$var_value"; then
4924 relink_command="$var=; export $var; $relink_command"
4925 else
4926 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4927 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4928 fi
4929 done
4930 relink_command="(cd `pwd`; $relink_command)"
4931 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4932 fi
4933
4934 # Quote $echo for shipping.
4935 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4936 case $progpath in
4937 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4938 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4939 esac
4940 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4941 else
4942 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4943 fi
4944
4945 # Only actually do things if our run command is non-null.
4946 if test -z "$run"; then
4947 # win32 will think the script is a binary if it has
4948 # a .exe suffix, so we strip it off here.
4949 case $output in
4950 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4951 esac
4952 # test for cygwin because mv fails w/o .exe extensions
4953 case $host in
4954 *cygwin*)
4955 exeext=.exe
4956 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4957 *) exeext= ;;
4958 esac
4959 case $host in
4960 *cygwin* | *mingw* )
4961 output_name=`basename $output`
4962 output_path=`dirname $output`
4963 cwrappersource="$output_path/$objdir/lt-$output_name.c"
4964 cwrapper="$output_path/$output_name.exe"
4965 $rm $cwrappersource $cwrapper
4966 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4967
4968 cat > $cwrappersource <<EOF
4969
4970 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4971 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4972
4973 The $output program cannot be directly executed until all the libtool
4974 libraries that it depends on are installed.
4975
4976 This wrapper executable should never be moved out of the build directory.
4977 If it is, it will not operate correctly.
4978
4979 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4980 but could eventually absorb all of the scripts functionality and
4981 exec $objdir/$outputname directly.
4982 */
4983 EOF
4984 cat >> $cwrappersource<<"EOF"
4985 #include <stdio.h>
4986 #include <stdlib.h>
4987 #include <unistd.h>
4988 #include <malloc.h>
4989 #include <stdarg.h>
4990 #include <assert.h>
4991 #include <string.h>
4992 #include <ctype.h>
4993 #include <sys/stat.h>
4994
4995 #if defined(PATH_MAX)
4996 # define LT_PATHMAX PATH_MAX
4997 #elif defined(MAXPATHLEN)
4998 # define LT_PATHMAX MAXPATHLEN
4999 #else
5000 # define LT_PATHMAX 1024
5001 #endif
5002
5003 #ifndef DIR_SEPARATOR
5004 # define DIR_SEPARATOR '/'
5005 # define PATH_SEPARATOR ':'
5006 #endif
5007
5008 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5009 defined (__OS2__)
5010 # define HAVE_DOS_BASED_FILE_SYSTEM
5011 # ifndef DIR_SEPARATOR_2
5012 # define DIR_SEPARATOR_2 '\\'
5013 # endif
5014 # ifndef PATH_SEPARATOR_2
5015 # define PATH_SEPARATOR_2 ';'
5016 # endif
5017 #endif
5018
5019 #ifndef DIR_SEPARATOR_2
5020 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5021 #else /* DIR_SEPARATOR_2 */
5022 # define IS_DIR_SEPARATOR(ch) \
5023 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5024 #endif /* DIR_SEPARATOR_2 */
5025
5026 #ifndef PATH_SEPARATOR_2
5027 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5028 #else /* PATH_SEPARATOR_2 */
5029 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5030 #endif /* PATH_SEPARATOR_2 */
5031
5032 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5033 #define XFREE(stale) do { \
5034 if (stale) { free ((void *) stale); stale = 0; } \
5035 } while (0)
5036
5037 /* -DDEBUG is fairly common in CFLAGS. */
5038 #undef DEBUG
5039 #if defined DEBUGWRAPPER
5040 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5041 #else
5042 # define DEBUG(format, ...)
5043 #endif
5044
5045 const char *program_name = NULL;
5046
5047 void * xmalloc (size_t num);
5048 char * xstrdup (const char *string);
5049 const char * base_name (const char *name);
5050 char * find_executable(const char *wrapper);
5051 int check_executable(const char *path);
5052 char * strendzap(char *str, const char *pat);
5053 void lt_fatal (const char *message, ...);
5054
5055 int
5056 main (int argc, char *argv[])
5057 {
5058 char **newargz;
5059 int i;
5060
5061 program_name = (char *) xstrdup (base_name (argv[0]));
5062 DEBUG("(main) argv[0] : %s\n",argv[0]);
5063 DEBUG("(main) program_name : %s\n",program_name);
5064 newargz = XMALLOC(char *, argc+2);
5065 EOF
5066
5067 cat >> $cwrappersource <<EOF
5068 newargz[0] = (char *) xstrdup("$SHELL");
5069 EOF
5070
5071 cat >> $cwrappersource <<"EOF"
5072 newargz[1] = find_executable(argv[0]);
5073 if (newargz[1] == NULL)
5074 lt_fatal("Couldn't find %s", argv[0]);
5075 DEBUG("(main) found exe at : %s\n",newargz[1]);
5076 /* we know the script has the same name, without the .exe */
5077 /* so make sure newargz[1] doesn't end in .exe */
5078 strendzap(newargz[1],".exe");
5079 for (i = 1; i < argc; i++)
5080 newargz[i+1] = xstrdup(argv[i]);
5081 newargz[argc+1] = NULL;
5082
5083 for (i=0; i<argc+1; i++)
5084 {
5085 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5086 ;
5087 }
5088
5089 EOF
5090
5091 case $host_os in
5092 mingw*)
5093 cat >> $cwrappersource <<EOF
5094 execv("$SHELL",(char const **)newargz);
5095 EOF
5096 ;;
5097 *)
5098 cat >> $cwrappersource <<EOF
5099 execv("$SHELL",newargz);
5100 EOF
5101 ;;
5102 esac
5103
5104 cat >> $cwrappersource <<"EOF"
5105 return 127;
5106 }
5107
5108 void *
5109 xmalloc (size_t num)
5110 {
5111 void * p = (void *) malloc (num);
5112 if (!p)
5113 lt_fatal ("Memory exhausted");
5114
5115 return p;
5116 }
5117
5118 char *
5119 xstrdup (const char *string)
5120 {
5121 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5122 ;
5123 }
5124
5125 const char *
5126 base_name (const char *name)
5127 {
5128 const char *base;
5129
5130 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5131 /* Skip over the disk name in MSDOS pathnames. */
5132 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5133 name += 2;
5134 #endif
5135
5136 for (base = name; *name; name++)
5137 if (IS_DIR_SEPARATOR (*name))
5138 base = name + 1;
5139 return base;
5140 }
5141
5142 int
5143 check_executable(const char * path)
5144 {
5145 struct stat st;
5146
5147 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5148 if ((!path) || (!*path))
5149 return 0;
5150
5151 if ((stat (path, &st) >= 0) &&
5152 (
5153 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5154 #if defined (S_IXOTH)
5155 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5156 #endif
5157 #if defined (S_IXGRP)
5158 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5159 #endif
5160 ((st.st_mode & S_IXUSR) == S_IXUSR))
5161 )
5162 return 1;
5163 else
5164 return 0;
5165 }
5166
5167 /* Searches for the full path of the wrapper. Returns
5168 newly allocated full path name if found, NULL otherwise */
5169 char *
5170 find_executable (const char* wrapper)
5171 {
5172 int has_slash = 0;
5173 const char* p;
5174 const char* p_next;
5175 /* static buffer for getcwd */
5176 char tmp[LT_PATHMAX + 1];
5177 int tmp_len;
5178 char* concat_name;
5179
5180 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5181
5182 if ((wrapper == NULL) || (*wrapper == '\0'))
5183 return NULL;
5184
5185 /* Absolute path? */
5186 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5187 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5188 {
5189 concat_name = xstrdup (wrapper);
5190 if (check_executable(concat_name))
5191 return concat_name;
5192 XFREE(concat_name);
5193 }
5194 else
5195 {
5196 #endif
5197 if (IS_DIR_SEPARATOR (wrapper[0]))
5198 {
5199 concat_name = xstrdup (wrapper);
5200 if (check_executable(concat_name))
5201 return concat_name;
5202 XFREE(concat_name);
5203 }
5204 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5205 }
5206 #endif
5207
5208 for (p = wrapper; *p; p++)
5209 if (*p == '/')
5210 {
5211 has_slash = 1;
5212 break;
5213 }
5214 if (!has_slash)
5215 {
5216 /* no slashes; search PATH */
5217 const char* path = getenv ("PATH");
5218 if (path != NULL)
5219 {
5220 for (p = path; *p; p = p_next)
5221 {
5222 const char* q;
5223 size_t p_len;
5224 for (q = p; *q; q++)
5225 if (IS_PATH_SEPARATOR(*q))
5226 break;
5227 p_len = q - p;
5228 p_next = (*q == '\0' ? q : q + 1);
5229 if (p_len == 0)
5230 {
5231 /* empty path: current directory */
5232 if (getcwd (tmp, LT_PATHMAX) == NULL)
5233 lt_fatal ("getcwd failed");
5234 tmp_len = strlen(tmp);
5235 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5236 memcpy (concat_name, tmp, tmp_len);
5237 concat_name[tmp_len] = '/';
5238 strcpy (concat_name + tmp_len + 1, wrapper);
5239 }
5240 else
5241 {
5242 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5243 memcpy (concat_name, p, p_len);
5244 concat_name[p_len] = '/';
5245 strcpy (concat_name + p_len + 1, wrapper);
5246 }
5247 if (check_executable(concat_name))
5248 return concat_name;
5249 XFREE(concat_name);
5250 }
5251 }
5252 /* not found in PATH; assume curdir */
5253 }
5254 /* Relative path | not found in path: prepend cwd */
5255 if (getcwd (tmp, LT_PATHMAX) == NULL)
5256 lt_fatal ("getcwd failed");
5257 tmp_len = strlen(tmp);
5258 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5259 memcpy (concat_name, tmp, tmp_len);
5260 concat_name[tmp_len] = '/';
5261 strcpy (concat_name + tmp_len + 1, wrapper);
5262
5263 if (check_executable(concat_name))
5264 return concat_name;
5265 XFREE(concat_name);
5266 return NULL;
5267 }
5268
5269 char *
5270 strendzap(char *str, const char *pat)
5271 {
5272 size_t len, patlen;
5273
5274 assert(str != NULL);
5275 assert(pat != NULL);
5276
5277 len = strlen(str);
5278 patlen = strlen(pat);
5279
5280 if (patlen <= len)
5281 {
5282 str += len - patlen;
5283 if (strcmp(str, pat) == 0)
5284 *str = '\0';
5285 }
5286 return str;
5287 }
5288
5289 static void
5290 lt_error_core (int exit_status, const char * mode,
5291 const char * message, va_list ap)
5292 {
5293 fprintf (stderr, "%s: %s: ", program_name, mode);
5294 vfprintf (stderr, message, ap);
5295 fprintf (stderr, ".\n");
5296
5297 if (exit_status >= 0)
5298 exit (exit_status);
5299 }
5300
5301 void
5302 lt_fatal (const char *message, ...)
5303 {
5304 va_list ap;
5305 va_start (ap, message);
5306 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5307 va_end (ap);
5308 }
5309 EOF
5310 # we should really use a build-platform specific compiler
5311 # here, but OTOH, the wrappers (shell script and this C one)
5312 # are only useful if you want to execute the "real" binary.
5313 # Since the "real" binary is built for $host, then this
5314 # wrapper might as well be built for $host, too.
5315 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5316 ;;
5317 esac
5318 $rm $output
5319 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5320
5321 $echo > $output "\
5322 #! $SHELL
5323
5324 # $output - temporary wrapper script for $objdir/$outputname
5325 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5326 #
5327 # The $output program cannot be directly executed until all the libtool
5328 # libraries that it depends on are installed.
5329 #
5330 # This wrapper script should never be moved out of the build directory.
5331 # If it is, it will not operate correctly.
5332
5333 # Sed substitution that helps us do robust quoting. It backslashifies
5334 # metacharacters that are still active within double-quoted strings.
5335 Xsed='${SED} -e 1s/^X//'
5336 sed_quote_subst='$sed_quote_subst'
5337
5338 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5339 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5340 emulate sh
5341 NULLCMD=:
5342 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5343 # is contrary to our usage. Disable this feature.
5344 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5345 setopt NO_GLOB_SUBST
5346 else
5347 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5348 fi
5349 BIN_SH=xpg4; export BIN_SH # for Tru64
5350 DUALCASE=1; export DUALCASE # for MKS sh
5351
5352 # The HP-UX ksh and POSIX shell print the target directory to stdout
5353 # if CDPATH is set.
5354 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5355
5356 relink_command=\"$relink_command\"
5357
5358 # This environment variable determines our operation mode.
5359 if test \"\$libtool_install_magic\" = \"$magic\"; then
5360 # install mode needs the following variable:
5361 notinst_deplibs='$notinst_deplibs'
5362 else
5363 # When we are sourced in execute mode, \$file and \$echo are already set.
5364 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5365 echo=\"$qecho\"
5366 file=\"\$0\"
5367 # Make sure echo works.
5368 if test \"X\$1\" = X--no-reexec; then
5369 # Discard the --no-reexec flag, and continue.
5370 shift
5371 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5372 # Yippee, \$echo works!
5373 :
5374 else
5375 # Restart under the correct shell, and then maybe \$echo will work.
5376 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5377 fi
5378 fi\
5379 "
5380 $echo >> $output "\
5381
5382 # Find the directory that this script lives in.
5383 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5384 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5385
5386 # Follow symbolic links until we get to the real thisdir.
5387 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5388 while test -n \"\$file\"; do
5389 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5390
5391 # If there was a directory component, then change thisdir.
5392 if test \"x\$destdir\" != \"x\$file\"; then
5393 case \"\$destdir\" in
5394 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5395 *) thisdir=\"\$thisdir/\$destdir\" ;;
5396 esac
5397 fi
5398
5399 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5400 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5401 done
5402
5403 # Try to get the absolute directory name.
5404 absdir=\`cd \"\$thisdir\" && pwd\`
5405 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5406 "
5407
5408 if test "$fast_install" = yes; then
5409 $echo >> $output "\
5410 program=lt-'$outputname'$exeext
5411 progdir=\"\$thisdir/$objdir\"
5412
5413 if test ! -f \"\$progdir/\$program\" || \\
5414 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5415 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5416
5417 file=\"\$\$-\$program\"
5418
5419 if test ! -d \"\$progdir\"; then
5420 $mkdir \"\$progdir\"
5421 else
5422 $rm \"\$progdir/\$file\"
5423 fi"
5424
5425 $echo >> $output "\
5426
5427 # relink executable if necessary
5428 if test -n \"\$relink_command\"; then
5429 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5430 else
5431 $echo \"\$relink_command_output\" >&2
5432 $rm \"\$progdir/\$file\"
5433 exit $EXIT_FAILURE
5434 fi
5435 fi
5436
5437 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5438 { $rm \"\$progdir/\$program\";
5439 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5440 $rm \"\$progdir/\$file\"
5441 fi"
5442 else
5443 $echo >> $output "\
5444 program='$outputname'
5445 progdir=\"\$thisdir/$objdir\"
5446 "
5447 fi
5448
5449 $echo >> $output "\
5450
5451 if test -f \"\$progdir/\$program\"; then"
5452
5453 # Export our shlibpath_var if we have one.
5454 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5455 $echo >> $output "\
5456 # Add our own library path to $shlibpath_var
5457 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5458
5459 # Some systems cannot cope with colon-terminated $shlibpath_var
5460 # The second colon is a workaround for a bug in BeOS R4 sed
5461 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5462
5463 export $shlibpath_var
5464 "
5465 fi
5466
5467 # fixup the dll searchpath if we need to.
5468 if test -n "$dllsearchpath"; then
5469 $echo >> $output "\
5470 # Add the dll search path components to the executable PATH
5471 PATH=$dllsearchpath:\$PATH
5472 "
5473 fi
5474
5475 $echo >> $output "\
5476 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5477 # Run the actual program with our arguments.
5478 "
5479 case $host in
5480 # Backslashes separate directories on plain windows
5481 *-*-mingw | *-*-os2*)
5482 $echo >> $output "\
5483 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5484 "
5485 ;;
5486
5487 *)
5488 $echo >> $output "\
5489 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5490 "
5491 ;;
5492 esac
5493 $echo >> $output "\
5494 \$echo \"\$0: cannot exec \$program \$*\"
5495 exit $EXIT_FAILURE
5496 fi
5497 else
5498 # The program doesn't exist.
5499 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5500 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5501 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5502 exit $EXIT_FAILURE
5503 fi
5504 fi\
5505 "
5506 chmod +x $output
5507 fi
5508 exit $EXIT_SUCCESS
5509 ;;
5510 esac
5511
5512 # See if we need to build an old-fashioned archive.
5513 for oldlib in $oldlibs; do
5514
5515 if test "$build_libtool_libs" = convenience; then
5516 oldobjs="$libobjs_save"
5517 addlibs="$convenience"
5518 build_libtool_libs=no
5519 else
5520 if test "$build_libtool_libs" = module; then
5521 oldobjs="$libobjs_save"
5522 build_libtool_libs=no
5523 else
5524 oldobjs="$old_deplibs $non_pic_objects"
5525 fi
5526 addlibs="$old_convenience"
5527 fi
5528
5529 if test -n "$addlibs"; then
5530 gentop="$output_objdir/${outputname}x"
5531 generated="$generated $gentop"
5532
5533 func_extract_archives $gentop $addlibs
5534 oldobjs="$oldobjs $func_extract_archives_result"
5535 fi
5536
5537 # Do each command in the archive commands.
5538 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5539 cmds=$old_archive_from_new_cmds
5540 else
5541 # POSIX demands no paths to be encoded in archives. We have
5542 # to avoid creating archives with duplicate basenames if we
5543 # might have to extract them afterwards, e.g., when creating a
5544 # static archive out of a convenience library, or when linking
5545 # the entirety of a libtool archive into another (currently
5546 # not supported by libtool).
5547 if (for obj in $oldobjs
5548 do
5549 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5550 done | sort | sort -uc >/dev/null 2>&1); then
5551 :
5552 else
5553 $echo "copying selected object files to avoid basename conflicts..."
5554
5555 if test -z "$gentop"; then
5556 gentop="$output_objdir/${outputname}x"
5557 generated="$generated $gentop"
5558
5559 $show "${rm}r $gentop"
5560 $run ${rm}r "$gentop"
5561 $show "$mkdir $gentop"
5562 $run $mkdir "$gentop"
5563 exit_status=$?
5564 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5565 exit $exit_status
5566 fi
5567 fi
5568
5569 save_oldobjs=$oldobjs
5570 oldobjs=
5571 counter=1
5572 for obj in $save_oldobjs
5573 do
5574 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5575 case " $oldobjs " in
5576 " ") oldobjs=$obj ;;
5577 *[\ /]"$objbase "*)
5578 while :; do
5579 # Make sure we don't pick an alternate name that also
5580 # overlaps.
5581 newobj=lt$counter-$objbase
5582 counter=`expr $counter + 1`
5583 case " $oldobjs " in
5584 *[\ /]"$newobj "*) ;;
5585 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5586 esac
5587 done
5588 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5589 $run ln "$obj" "$gentop/$newobj" ||
5590 $run cp "$obj" "$gentop/$newobj"
5591 oldobjs="$oldobjs $gentop/$newobj"
5592 ;;
5593 *) oldobjs="$oldobjs $obj" ;;
5594 esac
5595 done
5596 fi
5597
5598 eval cmds=\"$old_archive_cmds\"
5599
5600 if len=`expr "X$cmds" : ".*"` &&
5601 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5602 cmds=$old_archive_cmds
5603 else
5604 # the command line is too long to link in one step, link in parts
5605 $echo "using piecewise archive linking..."
5606 save_RANLIB=$RANLIB
5607 RANLIB=:
5608 objlist=
5609 concat_cmds=
5610 save_oldobjs=$oldobjs
5611
5612 # Is there a better way of finding the last object in the list?
5613 for obj in $save_oldobjs
5614 do
5615 last_oldobj=$obj
5616 done
5617 for obj in $save_oldobjs
5618 do
5619 oldobjs="$objlist $obj"
5620 objlist="$objlist $obj"
5621 eval test_cmds=\"$old_archive_cmds\"
5622 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5623 test "$len" -le "$max_cmd_len"; then
5624 :
5625 else
5626 # the above command should be used before it gets too long
5627 oldobjs=$objlist
5628 if test "$obj" = "$last_oldobj" ; then
5629 RANLIB=$save_RANLIB
5630 fi
5631 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5632 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5633 objlist=
5634 fi
5635 done
5636 RANLIB=$save_RANLIB
5637 oldobjs=$objlist
5638 if test "X$oldobjs" = "X" ; then
5639 eval cmds=\"\$concat_cmds\"
5640 else
5641 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5642 fi
5643 fi
5644 fi
5645 save_ifs="$IFS"; IFS='~'
5646 for cmd in $cmds; do
5647 eval cmd=\"$cmd\"
5648 IFS="$save_ifs"
5649 $show "$cmd"
5650 $run eval "$cmd" || exit $?
5651 done
5652 IFS="$save_ifs"
5653 done
5654
5655 if test -n "$generated"; then
5656 $show "${rm}r$generated"
5657 $run ${rm}r$generated
5658 fi
5659
5660 # Now create the libtool archive.
5661 case $output in
5662 *.la)
5663 old_library=
5664 test "$build_old_libs" = yes && old_library="$libname.$libext"
5665 $show "creating $output"
5666
5667 # Preserve any variables that may affect compiler behavior
5668 for var in $variables_saved_for_relink; do
5669 if eval test -z \"\${$var+set}\"; then
5670 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5671 elif eval var_value=\$$var; test -z "$var_value"; then
5672 relink_command="$var=; export $var; $relink_command"
5673 else
5674 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5675 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5676 fi
5677 done
5678 # Quote the link command for shipping.
5679 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5680 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5681 if test "$hardcode_automatic" = yes ; then
5682 relink_command=
5683 fi
5684
5685
5686 # Only create the output if not a dry run.
5687 if test -z "$run"; then
5688 for installed in no yes; do
5689 if test "$installed" = yes; then
5690 if test -z "$install_libdir"; then
5691 break
5692 fi
5693 output="$output_objdir/$outputname"i
5694 # Replace all uninstalled libtool libraries with the installed ones
5695 newdependency_libs=
5696 for deplib in $dependency_libs; do
5697 case $deplib in
5698 *.la)
5699 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5700 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5701 if test -z "$libdir"; then
5702 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5703 exit $EXIT_FAILURE
5704 fi
5705 newdependency_libs="$newdependency_libs $libdir/$name"
5706 ;;
5707 *) newdependency_libs="$newdependency_libs $deplib" ;;
5708 esac
5709 done
5710 dependency_libs="$newdependency_libs"
5711 newdlfiles=
5712 for lib in $dlfiles; do
5713 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5714 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5715 if test -z "$libdir"; then
5716 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5717 exit $EXIT_FAILURE
5718 fi
5719 newdlfiles="$newdlfiles $libdir/$name"
5720 done
5721 dlfiles="$newdlfiles"
5722 newdlprefiles=
5723 for lib in $dlprefiles; do
5724 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5725 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5726 if test -z "$libdir"; then
5727 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5728 exit $EXIT_FAILURE
5729 fi
5730 newdlprefiles="$newdlprefiles $libdir/$name"
5731 done
5732 dlprefiles="$newdlprefiles"
5733 else
5734 newdlfiles=
5735 for lib in $dlfiles; do
5736 case $lib in
5737 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5738 *) abs=`pwd`"/$lib" ;;
5739 esac
5740 newdlfiles="$newdlfiles $abs"
5741 done
5742 dlfiles="$newdlfiles"
5743 newdlprefiles=
5744 for lib in $dlprefiles; do
5745 case $lib in
5746 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5747 *) abs=`pwd`"/$lib" ;;
5748 esac
5749 newdlprefiles="$newdlprefiles $abs"
5750 done
5751 dlprefiles="$newdlprefiles"
5752 fi
5753 $rm $output
5754 # place dlname in correct position for cygwin
5755 tdlname=$dlname
5756 case $host,$output,$installed,$module,$dlname in
5757 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5758 esac
5759 $echo > $output "\
5760 # $outputname - a libtool library file
5761 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5762 #
5763 # Please DO NOT delete this file!
5764 # It is necessary for linking the library.
5765
5766 # The name that we can dlopen(3).
5767 dlname='$tdlname'
5768
5769 # Names of this library.
5770 library_names='$library_names'
5771
5772 # The name of the static archive.
5773 old_library='$old_library'
5774
5775 # Libraries that this one depends upon.
5776 dependency_libs='$dependency_libs'
5777
5778 # Version information for $libname.
5779 current=$current
5780 age=$age
5781 revision=$revision
5782
5783 # Is this an already installed library?
5784 installed=$installed
5785
5786 # Should we warn about portability when linking against -modules?
5787 shouldnotlink=$module
5788
5789 # Files to dlopen/dlpreopen
5790 dlopen='$dlfiles'
5791 dlpreopen='$dlprefiles'
5792
5793 # Directory that this library needs to be installed in:
5794 libdir='$install_libdir'"
5795 if test "$installed" = no && test "$need_relink" = yes; then
5796 $echo >> $output "\
5797 relink_command=\"$relink_command\""
5798 fi
5799 done
5800 fi
5801
5802 # Do a symbolic link so that the libtool archive can be found in
5803 # LD_LIBRARY_PATH before the program is installed.
5804 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5805 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5806 ;;
5807 esac
5808 exit $EXIT_SUCCESS
5809 ;;
5810
5811 # libtool install mode
5812 install)
5813 modename="$modename: install"
5814
5815 # There may be an optional sh(1) argument at the beginning of
5816 # install_prog (especially on Windows NT).
5817 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5818 # Allow the use of GNU shtool's install command.
5819 $echo "X$nonopt" | grep shtool > /dev/null; then
5820 # Aesthetically quote it.
5821 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5822 case $arg in
5823 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5824 arg="\"$arg\""
5825 ;;
5826 esac
5827 install_prog="$arg "
5828 arg="$1"
5829 shift
5830 else
5831 install_prog=
5832 arg=$nonopt
5833 fi
5834
5835 # The real first argument should be the name of the installation program.
5836 # Aesthetically quote it.
5837 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5838 case $arg in
5839 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5840 arg="\"$arg\""
5841 ;;
5842 esac
5843 install_prog="$install_prog$arg"
5844
5845 # We need to accept at least all the BSD install flags.
5846 dest=
5847 files=
5848 opts=
5849 prev=
5850 install_type=
5851 isdir=no
5852 stripme=
5853 for arg
5854 do
5855 if test -n "$dest"; then
5856 files="$files $dest"
5857 dest=$arg
5858 continue
5859 fi
5860
5861 case $arg in
5862 -d) isdir=yes ;;
5863 -f)
5864 case " $install_prog " in
5865 *[\\\ /]cp\ *) ;;
5866 *) prev=$arg ;;
5867 esac
5868 ;;
5869 -g | -m | -o) prev=$arg ;;
5870 -s)
5871 stripme=" -s"
5872 continue
5873 ;;
5874 -*)
5875 ;;
5876 *)
5877 # If the previous option needed an argument, then skip it.
5878 if test -n "$prev"; then
5879 prev=
5880 else
5881 dest=$arg
5882 continue
5883 fi
5884 ;;
5885 esac
5886
5887 # Aesthetically quote the argument.
5888 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5889 case $arg in
5890 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5891 arg="\"$arg\""
5892 ;;
5893 esac
5894 install_prog="$install_prog $arg"
5895 done
5896
5897 if test -z "$install_prog"; then
5898 $echo "$modename: you must specify an install program" 1>&2
5899 $echo "$help" 1>&2
5900 exit $EXIT_FAILURE
5901 fi
5902
5903 if test -n "$prev"; then
5904 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5905 $echo "$help" 1>&2
5906 exit $EXIT_FAILURE
5907 fi
5908
5909 if test -z "$files"; then
5910 if test -z "$dest"; then
5911 $echo "$modename: no file or destination specified" 1>&2
5912 else
5913 $echo "$modename: you must specify a destination" 1>&2
5914 fi
5915 $echo "$help" 1>&2
5916 exit $EXIT_FAILURE
5917 fi
5918
5919 # Strip any trailing slash from the destination.
5920 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5921
5922 # Check to see that the destination is a directory.
5923 test -d "$dest" && isdir=yes
5924 if test "$isdir" = yes; then
5925 destdir="$dest"
5926 destname=
5927 else
5928 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5929 test "X$destdir" = "X$dest" && destdir=.
5930 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5931
5932 # Not a directory, so check to see that there is only one file specified.
5933 set dummy $files
5934 if test "$#" -gt 2; then
5935 $echo "$modename: \`$dest' is not a directory" 1>&2
5936 $echo "$help" 1>&2
5937 exit $EXIT_FAILURE
5938 fi
5939 fi
5940 case $destdir in
5941 [\\/]* | [A-Za-z]:[\\/]*) ;;
5942 *)
5943 for file in $files; do
5944 case $file in
5945 *.lo) ;;
5946 *)
5947 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5948 $echo "$help" 1>&2
5949 exit $EXIT_FAILURE
5950 ;;
5951 esac
5952 done
5953 ;;
5954 esac
5955
5956 # This variable tells wrapper scripts just to set variables rather
5957 # than running their programs.
5958 libtool_install_magic="$magic"
5959
5960 staticlibs=
5961 future_libdirs=
5962 current_libdirs=
5963 for file in $files; do
5964
5965 # Do each installation.
5966 case $file in
5967 *.$libext)
5968 # Do the static libraries later.
5969 staticlibs="$staticlibs $file"
5970 ;;
5971
5972 *.la)
5973 # Check to see that this really is a libtool archive.
5974 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5975 else
5976 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5977 $echo "$help" 1>&2
5978 exit $EXIT_FAILURE
5979 fi
5980
5981 library_names=
5982 old_library=
5983 relink_command=
5984 # If there is no directory component, then add one.
5985 case $file in
5986 */* | *\\*) . $file ;;
5987 *) . ./$file ;;
5988 esac
5989
5990 # Add the libdir to current_libdirs if it is the destination.
5991 if test "X$destdir" = "X$libdir"; then
5992 case "$current_libdirs " in
5993 *" $libdir "*) ;;
5994 *) current_libdirs="$current_libdirs $libdir" ;;
5995 esac
5996 else
5997 # Note the libdir as a future libdir.
5998 case "$future_libdirs " in
5999 *" $libdir "*) ;;
6000 *) future_libdirs="$future_libdirs $libdir" ;;
6001 esac
6002 fi
6003
6004 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6005 test "X$dir" = "X$file/" && dir=
6006 dir="$dir$objdir"
6007
6008 if test -n "$relink_command"; then
6009 # Determine the prefix the user has applied to our future dir.
6010 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6011
6012 # Don't allow the user to place us outside of our expected
6013 # location b/c this prevents finding dependent libraries that
6014 # are installed to the same prefix.
6015 # At present, this check doesn't affect windows .dll's that
6016 # are installed into $libdir/../bin (currently, that works fine)
6017 # but it's something to keep an eye on.
6018 if test "$inst_prefix_dir" = "$destdir"; then
6019 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6020 exit $EXIT_FAILURE
6021 fi
6022
6023 if test -n "$inst_prefix_dir"; then
6024 # Stick the inst_prefix_dir data into the link command.
6025 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6026 else
6027 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6028 fi
6029
6030 $echo "$modename: warning: relinking \`$file'" 1>&2
6031 $show "$relink_command"
6032 if $run eval "$relink_command"; then :
6033 else
6034 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6035 exit $EXIT_FAILURE
6036 fi
6037 fi
6038
6039 # See the names of the shared library.
6040 set dummy $library_names
6041 if test -n "$2"; then
6042 realname="$2"
6043 shift
6044 shift
6045
6046 srcname="$realname"
6047 test -n "$relink_command" && srcname="$realname"T
6048
6049 # Install the shared library and build the symlinks.
6050 $show "$install_prog $dir/$srcname $destdir/$realname"
6051 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6052 if test -n "$stripme" && test -n "$striplib"; then
6053 $show "$striplib $destdir/$realname"
6054 $run eval "$striplib $destdir/$realname" || exit $?
6055 fi
6056
6057 if test "$#" -gt 0; then
6058 # Delete the old symlinks, and create new ones.
6059 # Try `ln -sf' first, because the `ln' binary might depend on
6060 # the symlink we replace! Solaris /bin/ln does not understand -f,
6061 # so we also need to try rm && ln -s.
6062 for linkname
6063 do
6064 if test "$linkname" != "$realname"; then
6065 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6066 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6067 fi
6068 done
6069 fi
6070
6071 # Do each command in the postinstall commands.
6072 lib="$destdir/$realname"
6073 cmds=$postinstall_cmds
6074 save_ifs="$IFS"; IFS='~'
6075 for cmd in $cmds; do
6076 IFS="$save_ifs"
6077 eval cmd=\"$cmd\"
6078 $show "$cmd"
6079 $run eval "$cmd" || {
6080 lt_exit=$?
6081
6082 # Restore the uninstalled library and exit
6083 if test "$mode" = relink; then
6084 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6085 fi
6086
6087 exit $lt_exit
6088 }
6089 done
6090 IFS="$save_ifs"
6091 fi
6092
6093 # Install the pseudo-library for information purposes.
6094 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6095 instname="$dir/$name"i
6096 $show "$install_prog $instname $destdir/$name"
6097 $run eval "$install_prog $instname $destdir/$name" || exit $?
6098
6099 # Maybe install the static library, too.
6100 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6101 ;;
6102
6103 *.lo)
6104 # Install (i.e. copy) a libtool object.
6105
6106 # Figure out destination file name, if it wasn't already specified.
6107 if test -n "$destname"; then
6108 destfile="$destdir/$destname"
6109 else
6110 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6111 destfile="$destdir/$destfile"
6112 fi
6113
6114 # Deduce the name of the destination old-style object file.
6115 case $destfile in
6116 *.lo)
6117 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6118 ;;
6119 *.$objext)
6120 staticdest="$destfile"
6121 destfile=
6122 ;;
6123 *)
6124 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6125 $echo "$help" 1>&2
6126 exit $EXIT_FAILURE
6127 ;;
6128 esac
6129
6130 # Install the libtool object if requested.
6131 if test -n "$destfile"; then
6132 $show "$install_prog $file $destfile"
6133 $run eval "$install_prog $file $destfile" || exit $?
6134 fi
6135
6136 # Install the old object if enabled.
6137 if test "$build_old_libs" = yes; then
6138 # Deduce the name of the old-style object file.
6139 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6140
6141 $show "$install_prog $staticobj $staticdest"
6142 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6143 fi
6144 exit $EXIT_SUCCESS
6145 ;;
6146
6147 *)
6148 # Figure out destination file name, if it wasn't already specified.
6149 if test -n "$destname"; then
6150 destfile="$destdir/$destname"
6151 else
6152 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6153 destfile="$destdir/$destfile"
6154 fi
6155
6156 # If the file is missing, and there is a .exe on the end, strip it
6157 # because it is most likely a libtool script we actually want to
6158 # install
6159 stripped_ext=""
6160 case $file in
6161 *.exe)
6162 if test ! -f "$file"; then
6163 file=`$echo $file|${SED} 's,.exe$,,'`
6164 stripped_ext=".exe"
6165 fi
6166 ;;
6167 esac
6168
6169 # Do a test to see if this is really a libtool program.
6170 case $host in
6171 *cygwin*|*mingw*)
6172 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6173 ;;
6174 *)
6175 wrapper=$file
6176 ;;
6177 esac
6178 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6179 notinst_deplibs=
6180 relink_command=
6181
6182 # Note that it is not necessary on cygwin/mingw to append a dot to
6183 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6184 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6185 # `FILE.' does not work on cygwin managed mounts.
6186 #
6187 # If there is no directory component, then add one.
6188 case $wrapper in
6189 */* | *\\*) . ${wrapper} ;;
6190 *) . ./${wrapper} ;;
6191 esac
6192
6193 # Check the variables that should have been set.
6194 if test -z "$notinst_deplibs"; then
6195 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6196 exit $EXIT_FAILURE
6197 fi
6198
6199 finalize=yes
6200 for lib in $notinst_deplibs; do
6201 # Check to see that each library is installed.
6202 libdir=
6203 if test -f "$lib"; then
6204 # If there is no directory component, then add one.
6205 case $lib in
6206 */* | *\\*) . $lib ;;
6207 *) . ./$lib ;;
6208 esac
6209 fi
6210 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6211 if test -n "$libdir" && test ! -f "$libfile"; then
6212 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6213 finalize=no
6214 fi
6215 done
6216
6217 relink_command=
6218 # Note that it is not necessary on cygwin/mingw to append a dot to
6219 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6220 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6221 # `FILE.' does not work on cygwin managed mounts.
6222 #
6223 # If there is no directory component, then add one.
6224 case $wrapper in
6225 */* | *\\*) . ${wrapper} ;;
6226 *) . ./${wrapper} ;;
6227 esac
6228
6229 outputname=
6230 if test "$fast_install" = no && test -n "$relink_command"; then
6231 if test "$finalize" = yes && test -z "$run"; then
6232 tmpdir=`func_mktempdir`
6233 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6234 outputname="$tmpdir/$file"
6235 # Replace the output file specification.
6236 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6237
6238 $show "$relink_command"
6239 if $run eval "$relink_command"; then :
6240 else
6241 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6242 ${rm}r "$tmpdir"
6243 continue
6244 fi
6245 file="$outputname"
6246 else
6247 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6248 fi
6249 else
6250 # Install the binary that we compiled earlier.
6251 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6252 fi
6253 fi
6254
6255 # remove .exe since cygwin /usr/bin/install will append another
6256 # one anyway
6257 case $install_prog,$host in
6258 */usr/bin/install*,*cygwin*)
6259 case $file:$destfile in
6260 *.exe:*.exe)
6261 # this is ok
6262 ;;
6263 *.exe:*)
6264 destfile=$destfile.exe
6265 ;;
6266 *:*.exe)
6267 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6268 ;;
6269 esac
6270 ;;
6271 esac
6272 $show "$install_prog$stripme $file $destfile"
6273 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6274 test -n "$outputname" && ${rm}r "$tmpdir"
6275 ;;
6276 esac
6277 done
6278
6279 for file in $staticlibs; do
6280 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6281
6282 # Set up the ranlib parameters.
6283 oldlib="$destdir/$name"
6284
6285 $show "$install_prog $file $oldlib"
6286 $run eval "$install_prog \$file \$oldlib" || exit $?
6287
6288 if test -n "$stripme" && test -n "$old_striplib"; then
6289 $show "$old_striplib $oldlib"
6290 $run eval "$old_striplib $oldlib" || exit $?
6291 fi
6292
6293 # Do each command in the postinstall commands.
6294 cmds=$old_postinstall_cmds
6295 save_ifs="$IFS"; IFS='~'
6296 for cmd in $cmds; do
6297 IFS="$save_ifs"
6298 eval cmd=\"$cmd\"
6299 $show "$cmd"
6300 $run eval "$cmd" || exit $?
6301 done
6302 IFS="$save_ifs"
6303 done
6304
6305 if test -n "$future_libdirs"; then
6306 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6307 fi
6308
6309 if test -n "$current_libdirs"; then
6310 # Maybe just do a dry run.
6311 test -n "$run" && current_libdirs=" -n$current_libdirs"
6312 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6313 else
6314 exit $EXIT_SUCCESS
6315 fi
6316 ;;
6317
6318 # libtool finish mode
6319 finish)
6320 modename="$modename: finish"
6321 libdirs="$nonopt"
6322 admincmds=
6323
6324 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6325 for dir
6326 do
6327 libdirs="$libdirs $dir"
6328 done
6329
6330 for libdir in $libdirs; do
6331 if test -n "$finish_cmds"; then
6332 # Do each command in the finish commands.
6333 cmds=$finish_cmds
6334 save_ifs="$IFS"; IFS='~'
6335 for cmd in $cmds; do
6336 IFS="$save_ifs"
6337 eval cmd=\"$cmd\"
6338 $show "$cmd"
6339 $run eval "$cmd" || admincmds="$admincmds
6340 $cmd"
6341 done
6342 IFS="$save_ifs"
6343 fi
6344 if test -n "$finish_eval"; then
6345 # Do the single finish_eval.
6346 eval cmds=\"$finish_eval\"
6347 $run eval "$cmds" || admincmds="$admincmds
6348 $cmds"
6349 fi
6350 done
6351 fi
6352
6353 # Exit here if they wanted silent mode.
6354 test "$show" = : && exit $EXIT_SUCCESS
6355
6356 $echo "X----------------------------------------------------------------------" | $Xsed
6357 $echo "Libraries have been installed in:"
6358 for libdir in $libdirs; do
6359 $echo " $libdir"
6360 done
6361 $echo
6362 $echo "If you ever happen to want to link against installed libraries"
6363 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6364 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6365 $echo "flag during linking and do at least one of the following:"
6366 if test -n "$shlibpath_var"; then
6367 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6368 $echo " during execution"
6369 fi
6370 if test -n "$runpath_var"; then
6371 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6372 $echo " during linking"
6373 fi
6374 if test -n "$hardcode_libdir_flag_spec"; then
6375 libdir=LIBDIR
6376 eval flag=\"$hardcode_libdir_flag_spec\"
6377
6378 $echo " - use the \`$flag' linker flag"
6379 fi
6380 if test -n "$admincmds"; then
6381 $echo " - have your system administrator run these commands:$admincmds"
6382 fi
6383 if test -f /etc/ld.so.conf; then
6384 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6385 fi
6386 $echo
6387 $echo "See any operating system documentation about shared libraries for"
6388 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6389 $echo "X----------------------------------------------------------------------" | $Xsed
6390 exit $EXIT_SUCCESS
6391 ;;
6392
6393 # libtool execute mode
6394 execute)
6395 modename="$modename: execute"
6396
6397 # The first argument is the command name.
6398 cmd="$nonopt"
6399 if test -z "$cmd"; then
6400 $echo "$modename: you must specify a COMMAND" 1>&2
6401 $echo "$help"
6402 exit $EXIT_FAILURE
6403 fi
6404
6405 # Handle -dlopen flags immediately.
6406 for file in $execute_dlfiles; do
6407 if test ! -f "$file"; then
6408 $echo "$modename: \`$file' is not a file" 1>&2
6409 $echo "$help" 1>&2
6410 exit $EXIT_FAILURE
6411 fi
6412
6413 dir=
6414 case $file in
6415 *.la)
6416 # Check to see that this really is a libtool archive.
6417 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6418 else
6419 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6420 $echo "$help" 1>&2
6421 exit $EXIT_FAILURE
6422 fi
6423
6424 # Read the libtool library.
6425 dlname=
6426 library_names=
6427
6428 # If there is no directory component, then add one.
6429 case $file in
6430 */* | *\\*) . $file ;;
6431 *) . ./$file ;;
6432 esac
6433
6434 # Skip this library if it cannot be dlopened.
6435 if test -z "$dlname"; then
6436 # Warn if it was a shared library.
6437 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6438 continue
6439 fi
6440
6441 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6442 test "X$dir" = "X$file" && dir=.
6443
6444 if test -f "$dir/$objdir/$dlname"; then
6445 dir="$dir/$objdir"
6446 else
6447 if test ! -f "$dir/$dlname"; then
6448 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6449 exit $EXIT_FAILURE
6450 fi
6451 fi
6452 ;;
6453
6454 *.lo)
6455 # Just add the directory containing the .lo file.
6456 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6457 test "X$dir" = "X$file" && dir=.
6458 ;;
6459
6460 *)
6461 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6462 continue
6463 ;;
6464 esac
6465
6466 # Get the absolute pathname.
6467 absdir=`cd "$dir" && pwd`
6468 test -n "$absdir" && dir="$absdir"
6469
6470 # Now add the directory to shlibpath_var.
6471 if eval "test -z \"\$$shlibpath_var\""; then
6472 eval "$shlibpath_var=\"\$dir\""
6473 else
6474 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6475 fi
6476 done
6477
6478 # This variable tells wrapper scripts just to set shlibpath_var
6479 # rather than running their programs.
6480 libtool_execute_magic="$magic"
6481
6482 # Check if any of the arguments is a wrapper script.
6483 args=
6484 for file
6485 do
6486 case $file in
6487 -*) ;;
6488 *)
6489 # Do a test to see if this is really a libtool program.
6490 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6491 # If there is no directory component, then add one.
6492 case $file in
6493 */* | *\\*) . $file ;;
6494 *) . ./$file ;;
6495 esac
6496
6497 # Transform arg to wrapped name.
6498 file="$progdir/$program"
6499 fi
6500 ;;
6501 esac
6502 # Quote arguments (to preserve shell metacharacters).
6503 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6504 args="$args \"$file\""
6505 done
6506
6507 if test -z "$run"; then
6508 if test -n "$shlibpath_var"; then
6509 # Export the shlibpath_var.
6510 eval "export $shlibpath_var"
6511 fi
6512
6513 # Restore saved environment variables
6514 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6515 do
6516 eval "if test \"\${save_$lt_var+set}\" = set; then
6517 $lt_var=\$save_$lt_var; export $lt_var
6518 fi"
6519 done
6520
6521 # Now prepare to actually exec the command.
6522 exec_cmd="\$cmd$args"
6523 else
6524 # Display what would be done.
6525 if test -n "$shlibpath_var"; then
6526 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6527 $echo "export $shlibpath_var"
6528 fi
6529 $echo "$cmd$args"
6530 exit $EXIT_SUCCESS
6531 fi
6532 ;;
6533
6534 # libtool clean and uninstall mode
6535 clean | uninstall)
6536 modename="$modename: $mode"
6537 rm="$nonopt"
6538 files=
6539 rmforce=
6540 exit_status=0
6541
6542 # This variable tells wrapper scripts just to set variables rather
6543 # than running their programs.
6544 libtool_install_magic="$magic"
6545
6546 for arg
6547 do
6548 case $arg in
6549 -f) rm="$rm $arg"; rmforce=yes ;;
6550 -*) rm="$rm $arg" ;;
6551 *) files="$files $arg" ;;
6552 esac
6553 done
6554
6555 if test -z "$rm"; then
6556 $echo "$modename: you must specify an RM program" 1>&2
6557 $echo "$help" 1>&2
6558 exit $EXIT_FAILURE
6559 fi
6560
6561 rmdirs=
6562
6563 origobjdir="$objdir"
6564 for file in $files; do
6565 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6566 if test "X$dir" = "X$file"; then
6567 dir=.
6568 objdir="$origobjdir"
6569 else
6570 objdir="$dir/$origobjdir"
6571 fi
6572 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6573 test "$mode" = uninstall && objdir="$dir"
6574
6575 # Remember objdir for removal later, being careful to avoid duplicates
6576 if test "$mode" = clean; then
6577 case " $rmdirs " in
6578 *" $objdir "*) ;;
6579 *) rmdirs="$rmdirs $objdir" ;;
6580 esac
6581 fi
6582
6583 # Don't error if the file doesn't exist and rm -f was used.
6584 if (test -L "$file") >/dev/null 2>&1 \
6585 || (test -h "$file") >/dev/null 2>&1 \
6586 || test -f "$file"; then
6587 :
6588 elif test -d "$file"; then
6589 exit_status=1
6590 continue
6591 elif test "$rmforce" = yes; then
6592 continue
6593 fi
6594
6595 rmfiles="$file"
6596
6597 case $name in
6598 *.la)
6599 # Possibly a libtool archive, so verify it.
6600 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6601 . $dir/$name
6602
6603 # Delete the libtool libraries and symlinks.
6604 for n in $library_names; do
6605 rmfiles="$rmfiles $objdir/$n"
6606 done
6607 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6608
6609 case "$mode" in
6610 clean)
6611 case " $library_names " in
6612 # " " in the beginning catches empty $dlname
6613 *" $dlname "*) ;;
6614 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6615 esac
6616 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6617 ;;
6618 uninstall)
6619 if test -n "$library_names"; then
6620 # Do each command in the postuninstall commands.
6621 cmds=$postuninstall_cmds
6622 save_ifs="$IFS"; IFS='~'
6623 for cmd in $cmds; do
6624 IFS="$save_ifs"
6625 eval cmd=\"$cmd\"
6626 $show "$cmd"
6627 $run eval "$cmd"
6628 if test "$?" -ne 0 && test "$rmforce" != yes; then
6629 exit_status=1
6630 fi
6631 done
6632 IFS="$save_ifs"
6633 fi
6634
6635 if test -n "$old_library"; then
6636 # Do each command in the old_postuninstall commands.
6637 cmds=$old_postuninstall_cmds
6638 save_ifs="$IFS"; IFS='~'
6639 for cmd in $cmds; do
6640 IFS="$save_ifs"
6641 eval cmd=\"$cmd\"
6642 $show "$cmd"
6643 $run eval "$cmd"
6644 if test "$?" -ne 0 && test "$rmforce" != yes; then
6645 exit_status=1
6646 fi
6647 done
6648 IFS="$save_ifs"
6649 fi
6650 # FIXME: should reinstall the best remaining shared library.
6651 ;;
6652 esac
6653 fi
6654 ;;
6655
6656 *.lo)
6657 # Possibly a libtool object, so verify it.
6658 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6659
6660 # Read the .lo file
6661 . $dir/$name
6662
6663 # Add PIC object to the list of files to remove.
6664 if test -n "$pic_object" \
6665 && test "$pic_object" != none; then
6666 rmfiles="$rmfiles $dir/$pic_object"
6667 fi
6668
6669 # Add non-PIC object to the list of files to remove.
6670 if test -n "$non_pic_object" \
6671 && test "$non_pic_object" != none; then
6672 rmfiles="$rmfiles $dir/$non_pic_object"
6673 fi
6674 fi
6675 ;;
6676
6677 *)
6678 if test "$mode" = clean ; then
6679 noexename=$name
6680 case $file in
6681 *.exe)
6682 file=`$echo $file|${SED} 's,.exe$,,'`
6683 noexename=`$echo $name|${SED} 's,.exe$,,'`
6684 # $file with .exe has already been added to rmfiles,
6685 # add $file without .exe
6686 rmfiles="$rmfiles $file"
6687 ;;
6688 esac
6689 # Do a test to see if this is a libtool program.
6690 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6691 relink_command=
6692 . $dir/$noexename
6693
6694 # note $name still contains .exe if it was in $file originally
6695 # as does the version of $file that was added into $rmfiles
6696 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6697 if test "$fast_install" = yes && test -n "$relink_command"; then
6698 rmfiles="$rmfiles $objdir/lt-$name"
6699 fi
6700 if test "X$noexename" != "X$name" ; then
6701 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6702 fi
6703 fi
6704 fi
6705 ;;
6706 esac
6707 $show "$rm $rmfiles"
6708 $run $rm $rmfiles || exit_status=1
6709 done
6710 objdir="$origobjdir"
6711
6712 # Try to remove the ${objdir}s in the directories where we deleted files
6713 for dir in $rmdirs; do
6714 if test -d "$dir"; then
6715 $show "rmdir $dir"
6716 $run rmdir $dir >/dev/null 2>&1
6717 fi
6718 done
6719
6720 exit $exit_status
6721 ;;
6722
6723 "")
6724 $echo "$modename: you must specify a MODE" 1>&2
6725 $echo "$generic_help" 1>&2
6726 exit $EXIT_FAILURE
6727 ;;
6728 esac
6729
6730 if test -z "$exec_cmd"; then
6731 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6732 $echo "$generic_help" 1>&2
6733 exit $EXIT_FAILURE
6734 fi
6735 fi # test -z "$show_help"
6736
6737 if test -n "$exec_cmd"; then
6738 eval exec $exec_cmd
6739 exit $EXIT_FAILURE
6740 fi
6741
6742 # We need to display help for each of the modes.
6743 case $mode in
6744 "") $echo \
6745 "Usage: $modename [OPTION]... [MODE-ARG]...
6746
6747 Provide generalized library-building support services.
6748
6749 --config show all configuration variables
6750 --debug enable verbose shell tracing
6751 -n, --dry-run display commands without modifying any files
6752 --features display basic configuration information and exit
6753 --finish same as \`--mode=finish'
6754 --help display this help message and exit
6755 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6756 --quiet same as \`--silent'
6757 --silent don't print informational messages
6758 --tag=TAG use configuration variables from tag TAG
6759 --version print version information
6760
6761 MODE must be one of the following:
6762
6763 clean remove files from the build directory
6764 compile compile a source file into a libtool object
6765 execute automatically set library path, then run a program
6766 finish complete the installation of libtool libraries
6767 install install libraries or executables
6768 link create a library or an executable
6769 uninstall remove libraries from an installed directory
6770
6771 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6772 a more detailed description of MODE.
6773
6774 Report bugs to <bug-libtool@gnu.org>."
6775 exit $EXIT_SUCCESS
6776 ;;
6777
6778 clean)
6779 $echo \
6780 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6781
6782 Remove files from the build directory.
6783
6784 RM is the name of the program to use to delete files associated with each FILE
6785 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6786 to RM.
6787
6788 If FILE is a libtool library, object or program, all the files associated
6789 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6790 ;;
6791
6792 compile)
6793 $echo \
6794 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6795
6796 Compile a source file into a libtool library object.
6797
6798 This mode accepts the following additional options:
6799
6800 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6801 -prefer-pic try to building PIC objects only
6802 -prefer-non-pic try to building non-PIC objects only
6803 -static always build a \`.o' file suitable for static linking
6804
6805 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6806 from the given SOURCEFILE.
6807
6808 The output file name is determined by removing the directory component from
6809 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6810 library object suffix, \`.lo'."
6811 ;;
6812
6813 execute)
6814 $echo \
6815 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6816
6817 Automatically set library path, then run a program.
6818
6819 This mode accepts the following additional options:
6820
6821 -dlopen FILE add the directory containing FILE to the library path
6822
6823 This mode sets the library path environment variable according to \`-dlopen'
6824 flags.
6825
6826 If any of the ARGS are libtool executable wrappers, then they are translated
6827 into their corresponding uninstalled binary, and any of their required library
6828 directories are added to the library path.
6829
6830 Then, COMMAND is executed, with ARGS as arguments."
6831 ;;
6832
6833 finish)
6834 $echo \
6835 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6836
6837 Complete the installation of libtool libraries.
6838
6839 Each LIBDIR is a directory that contains libtool libraries.
6840
6841 The commands that this mode executes may require superuser privileges. Use
6842 the \`--dry-run' option if you just want to see what would be executed."
6843 ;;
6844
6845 install)
6846 $echo \
6847 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6848
6849 Install executables or libraries.
6850
6851 INSTALL-COMMAND is the installation command. The first component should be
6852 either the \`install' or \`cp' program.
6853
6854 The rest of the components are interpreted as arguments to that command (only
6855 BSD-compatible install options are recognized)."
6856 ;;
6857
6858 link)
6859 $echo \
6860 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6861
6862 Link object files or libraries together to form another library, or to
6863 create an executable program.
6864
6865 LINK-COMMAND is a command using the C compiler that you would use to create
6866 a program from several object files.
6867
6868 The following components of LINK-COMMAND are treated specially:
6869
6870 -all-static do not do any dynamic linking at all
6871 -avoid-version do not add a version suffix if possible
6872 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6873 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6874 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6875 -export-symbols SYMFILE
6876 try to export only the symbols listed in SYMFILE
6877 -export-symbols-regex REGEX
6878 try to export only the symbols matching REGEX
6879 -LLIBDIR search LIBDIR for required installed libraries
6880 -lNAME OUTPUT-FILE requires the installed library libNAME
6881 -module build a library that can dlopened
6882 -no-fast-install disable the fast-install mode
6883 -no-install link a not-installable executable
6884 -no-undefined declare that a library does not refer to external symbols
6885 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6886 -objectlist FILE Use a list of object files found in FILE to specify objects
6887 -precious-files-regex REGEX
6888 don't remove output files matching REGEX
6889 -release RELEASE specify package release information
6890 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6891 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6892 -static do not do any dynamic linking of uninstalled libtool libraries
6893 -static-libtool-libs
6894 do not do any dynamic linking of libtool libraries
6895 -version-info CURRENT[:REVISION[:AGE]]
6896 specify library version info [each variable defaults to 0]
6897
6898 All other options (arguments beginning with \`-') are ignored.
6899
6900 Every other argument is treated as a filename. Files ending in \`.la' are
6901 treated as uninstalled libtool libraries, other files are standard or library
6902 object files.
6903
6904 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6905 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6906 required, except when creating a convenience library.
6907
6908 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6909 using \`ar' and \`ranlib', or on Windows using \`lib'.
6910
6911 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6912 is created, otherwise an executable program is created."
6913 ;;
6914
6915 uninstall)
6916 $echo \
6917 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6918
6919 Remove libraries from an installation directory.
6920
6921 RM is the name of the program to use to delete files associated with each FILE
6922 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6923 to RM.
6924
6925 If FILE is a libtool library, all the files associated with it are deleted.
6926 Otherwise, only FILE itself is deleted using RM."
6927 ;;
6928
6929 *)
6930 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6931 $echo "$help" 1>&2
6932 exit $EXIT_FAILURE
6933 ;;
6934 esac
6935
6936 $echo
6937 $echo "Try \`$modename --help' for more information about other modes."
6938
6939 exit $?
6940
6941 # The TAGs below are defined such that we never get into a situation
6942 # in which we disable both kinds of libraries. Given conflicting
6943 # choices, we go for a static library, that is the most portable,
6944 # since we can't tell whether shared libraries were disabled because
6945 # the user asked for that or because the platform doesn't support
6946 # them. This is particularly important on AIX, because we don't
6947 # support having both static and shared libraries enabled at the same
6948 # time on that platform, so we default to a shared-only configuration.
6949 # If a disable-shared tag is given, we'll fallback to a static-only
6950 # configuration. But we'll never go from static-only to shared-only.
6951
6952 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6953 disable_libs=shared
6954 # ### END LIBTOOL TAG CONFIG: disable-shared
6955
6956 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6957 disable_libs=static
6958 # ### END LIBTOOL TAG CONFIG: disable-static
6959
6960 # Local Variables:
6961 # mode:shell-script
6962 # sh-indentation:2
6963 # End:
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2006-05-10.23
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
6 # Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
28
29 if test $# -eq 0; then
30 echo 1>&2 "Try \`$0 --help' for more information"
31 exit 1
32 fi
33
34 run=:
35 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
36 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
37
38 # In the cases where this matters, `missing' is being run in the
39 # srcdir already.
40 if test -f configure.ac; then
41 configure_ac=configure.ac
42 else
43 configure_ac=configure.in
44 fi
45
46 msg="missing on your system"
47
48 case $1 in
49 --run)
50 # Try to run requested program, and just exit if it succeeds.
51 run=
52 shift
53 "$@" && exit 0
54 # Exit code 63 means version mismatch. This often happens
55 # when the user try to use an ancient version of a tool on
56 # a file that requires a minimum version. In this case we
57 # we should proceed has if the program had been absent, or
58 # if --run hadn't been passed.
59 if test $? = 63; then
60 run=:
61 msg="probably too old"
62 fi
63 ;;
64
65 -h|--h|--he|--hel|--help)
66 echo "\
67 $0 [OPTION]... PROGRAM [ARGUMENT]...
68
69 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
70 error status if there is no known handling for PROGRAM.
71
72 Options:
73 -h, --help display this help and exit
74 -v, --version output version information and exit
75 --run try to run the given command, and emulate it if it fails
76
77 Supported PROGRAM values:
78 aclocal touch file \`aclocal.m4'
79 autoconf touch file \`configure'
80 autoheader touch file \`config.h.in'
81 autom4te touch the output file, or create a stub one
82 automake touch all \`Makefile.in' files
83 bison create \`y.tab.[ch]', if possible, from existing .[ch]
84 flex create \`lex.yy.c', if possible, from existing .c
85 help2man touch the output file
86 lex create \`lex.yy.c', if possible, from existing .c
87 makeinfo touch the output file
88 tar try tar, gnutar, gtar, then tar without non-portable flags
89 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
90
91 Send bug reports to <bug-automake@gnu.org>."
92 exit $?
93 ;;
94
95 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
96 echo "missing $scriptversion (GNU Automake)"
97 exit $?
98 ;;
99
100 -*)
101 echo 1>&2 "$0: Unknown \`$1' option"
102 echo 1>&2 "Try \`$0 --help' for more information"
103 exit 1
104 ;;
105
106 esac
107
108 # Now exit if we have it, but it failed. Also exit now if we
109 # don't have it and --version was passed (most likely to detect
110 # the program).
111 case $1 in
112 lex|yacc)
113 # Not GNU programs, they don't have --version.
114 ;;
115
116 tar)
117 if test -n "$run"; then
118 echo 1>&2 "ERROR: \`tar' requires --run"
119 exit 1
120 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
121 exit 1
122 fi
123 ;;
124
125 *)
126 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
127 # We have it, but it failed.
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 # Could not run --version or --help. This is probably someone
131 # running `$TOOL --version' or `$TOOL --help' to check whether
132 # $TOOL exists and not knowing $TOOL uses missing.
133 exit 1
134 fi
135 ;;
136 esac
137
138 # If it does not exist, or fails to run (possibly an outdated version),
139 # try to emulate it.
140 case $1 in
141 aclocal*)
142 echo 1>&2 "\
143 WARNING: \`$1' is $msg. You should only need it if
144 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
145 to install the \`Automake' and \`Perl' packages. Grab them from
146 any GNU archive site."
147 touch aclocal.m4
148 ;;
149
150 autoconf)
151 echo 1>&2 "\
152 WARNING: \`$1' is $msg. You should only need it if
153 you modified \`${configure_ac}'. You might want to install the
154 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
155 archive site."
156 touch configure
157 ;;
158
159 autoheader)
160 echo 1>&2 "\
161 WARNING: \`$1' is $msg. You should only need it if
162 you modified \`acconfig.h' or \`${configure_ac}'. You might want
163 to install the \`Autoconf' and \`GNU m4' packages. Grab them
164 from any GNU archive site."
165 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
166 test -z "$files" && files="config.h"
167 touch_files=
168 for f in $files; do
169 case $f in
170 *:*) touch_files="$touch_files "`echo "$f" |
171 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
172 *) touch_files="$touch_files $f.in";;
173 esac
174 done
175 touch $touch_files
176 ;;
177
178 automake*)
179 echo 1>&2 "\
180 WARNING: \`$1' is $msg. You should only need it if
181 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
182 You might want to install the \`Automake' and \`Perl' packages.
183 Grab them from any GNU archive site."
184 find . -type f -name Makefile.am -print |
185 sed 's/\.am$/.in/' |
186 while read f; do touch "$f"; done
187 ;;
188
189 autom4te)
190 echo 1>&2 "\
191 WARNING: \`$1' is needed, but is $msg.
192 You might have modified some files without having the
193 proper tools for further handling them.
194 You can get \`$1' as part of \`Autoconf' from any GNU
195 archive site."
196
197 file=`echo "$*" | sed -n "$sed_output"`
198 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
199 if test -f "$file"; then
200 touch $file
201 else
202 test -z "$file" || exec >$file
203 echo "#! /bin/sh"
204 echo "# Created by GNU Automake missing as a replacement of"
205 echo "# $ $@"
206 echo "exit 0"
207 chmod +x $file
208 exit 1
209 fi
210 ;;
211
212 bison|yacc)
213 echo 1>&2 "\
214 WARNING: \`$1' $msg. You should only need it if
215 you modified a \`.y' file. You may need the \`Bison' package
216 in order for those modifications to take effect. You can get
217 \`Bison' from any GNU archive site."
218 rm -f y.tab.c y.tab.h
219 if test $# -ne 1; then
220 eval LASTARG="\${$#}"
221 case $LASTARG in
222 *.y)
223 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
224 if test -f "$SRCFILE"; then
225 cp "$SRCFILE" y.tab.c
226 fi
227 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
228 if test -f "$SRCFILE"; then
229 cp "$SRCFILE" y.tab.h
230 fi
231 ;;
232 esac
233 fi
234 if test ! -f y.tab.h; then
235 echo >y.tab.h
236 fi
237 if test ! -f y.tab.c; then
238 echo 'main() { return 0; }' >y.tab.c
239 fi
240 ;;
241
242 lex|flex)
243 echo 1>&2 "\
244 WARNING: \`$1' is $msg. You should only need it if
245 you modified a \`.l' file. You may need the \`Flex' package
246 in order for those modifications to take effect. You can get
247 \`Flex' from any GNU archive site."
248 rm -f lex.yy.c
249 if test $# -ne 1; then
250 eval LASTARG="\${$#}"
251 case $LASTARG in
252 *.l)
253 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
254 if test -f "$SRCFILE"; then
255 cp "$SRCFILE" lex.yy.c
256 fi
257 ;;
258 esac
259 fi
260 if test ! -f lex.yy.c; then
261 echo 'main() { return 0; }' >lex.yy.c
262 fi
263 ;;
264
265 help2man)
266 echo 1>&2 "\
267 WARNING: \`$1' is $msg. You should only need it if
268 you modified a dependency of a manual page. You may need the
269 \`Help2man' package in order for those modifications to take
270 effect. You can get \`Help2man' from any GNU archive site."
271
272 file=`echo "$*" | sed -n "$sed_output"`
273 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
274 if test -f "$file"; then
275 touch $file
276 else
277 test -z "$file" || exec >$file
278 echo ".ab help2man is required to generate this page"
279 exit 1
280 fi
281 ;;
282
283 makeinfo)
284 echo 1>&2 "\
285 WARNING: \`$1' is $msg. You should only need it if
286 you modified a \`.texi' or \`.texinfo' file, or any other file
287 indirectly affecting the aspect of the manual. The spurious
288 call might also be the consequence of using a buggy \`make' (AIX,
289 DU, IRIX). You might want to install the \`Texinfo' package or
290 the \`GNU make' package. Grab either from any GNU archive site."
291 # The file to touch is that specified with -o ...
292 file=`echo "$*" | sed -n "$sed_output"`
293 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
294 if test -z "$file"; then
295 # ... or it is the one specified with @setfilename ...
296 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
297 file=`sed -n '
298 /^@setfilename/{
299 s/.* \([^ ]*\) *$/\1/
300 p
301 q
302 }' $infile`
303 # ... or it is derived from the source name (dir/f.texi becomes f.info)
304 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
305 fi
306 # If the file does not exist, the user really needs makeinfo;
307 # let's fail without touching anything.
308 test -f $file || exit 1
309 touch $file
310 ;;
311
312 tar)
313 shift
314
315 # We have already tried tar in the generic part.
316 # Look for gnutar/gtar before invocation to avoid ugly error
317 # messages.
318 if (gnutar --version > /dev/null 2>&1); then
319 gnutar "$@" && exit 0
320 fi
321 if (gtar --version > /dev/null 2>&1); then
322 gtar "$@" && exit 0
323 fi
324 firstarg="$1"
325 if shift; then
326 case $firstarg in
327 *o*)
328 firstarg=`echo "$firstarg" | sed s/o//`
329 tar "$firstarg" "$@" && exit 0
330 ;;
331 esac
332 case $firstarg in
333 *h*)
334 firstarg=`echo "$firstarg" | sed s/h//`
335 tar "$firstarg" "$@" && exit 0
336 ;;
337 esac
338 fi
339
340 echo 1>&2 "\
341 WARNING: I can't seem to be able to run \`tar' with the given arguments.
342 You may want to install GNU tar or Free paxutils, or check the
343 command line arguments."
344 exit 1
345 ;;
346
347 *)
348 echo 1>&2 "\
349 WARNING: \`$1' is needed, and is $msg.
350 You might have modified some files without having the
351 proper tools for further handling them. Check the \`README' file,
352 it often tells you about the needed prerequisites for installing
353 this package. You may also peek at any GNU archive site, in case
354 some other package would contain this missing \`$1' program."
355 exit 1
356 ;;
357 esac
358
359 exit 0
360
361 # Local variables:
362 # eval: (add-hook 'write-file-hooks 'time-stamp)
363 # time-stamp-start: "scriptversion="
364 # time-stamp-format: "%:y-%02m-%02d.%02H"
365 # time-stamp-end: "$"
366 # End:
5050 mpc2sv8_DEPENDENCIES = $(top_builddir)/libmpcdec/libmpcdec.la \
5151 $(top_builddir)/libmpcenc/libmpcenc.a
5252 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
53 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
53 depcomp = $(SHELL) $(top_srcdir)/depcomp
5454 am__depfiles_maybe = depfiles
5555 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5656 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
5252 $(top_builddir)/libmpcenc/libmpcenc.a \
5353 /home/nico/src/cuetools-1.3.1/src/lib/libcuefile.a
5454 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
55 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
55 depcomp = $(SHELL) $(top_srcdir)/depcomp
5656 am__depfiles_maybe = depfiles
5757 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5858 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
150150 cdtext = track_get_cdtext(track);
151151
152152 // position du chapitre
153 mpc_int64_t chap_pos = si->sample_freq * track_get_start (track) / 75;
153 mpc_int64_t chap_pos = (mpc_int64_t) si->sample_freq * track_get_start (track) / 75;
154154
155155 if (chap_pos > si->samples - si->beg_silence)
156156 fprintf(stderr, "warning : chapter %i starts @ %lli after the end of the stream (%lli)\n", i, chap_pos, si->samples - si->beg_silence);
5050 mpccut_DEPENDENCIES = $(top_builddir)/libmpcenc/libmpcenc.a \
5151 $(top_builddir)/libmpcdec/libmpcdec.la
5252 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
53 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
53 depcomp = $(SHELL) $(top_srcdir)/depcomp
5454 am__depfiles_maybe = depfiles
5555 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5656 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
4949 mpcdec_DEPENDENCIES = $(top_builddir)/libmpcdec/libmpcdec.la \
5050 $(top_builddir)/libwavformat/libwavformat.a
5151 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
52 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
52 depcomp = $(SHELL) $(top_srcdir)/depcomp
5353 am__depfiles_maybe = depfiles
5454 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5555 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
5656 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mpcenc_LDFLAGS) \
5757 $(LDFLAGS) -o $@
5858 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
59 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
59 depcomp = $(SHELL) $(top_srcdir)/depcomp
6060 am__depfiles_maybe = depfiles
6161 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
6262 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
4848 mpcgain_OBJECTS = $(am_mpcgain_OBJECTS)
4949 mpcgain_DEPENDENCIES = $(top_builddir)/libmpcdec/libmpcdec.la
5050 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
51 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
51 depcomp = $(SHELL) $(top_srcdir)/depcomp
5252 am__depfiles_maybe = depfiles
5353 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5454 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
9494 if(!demux) return !MPC_STATUS_OK;
9595 mpc_demux_get_info(demux, &si);
9696
97 if (j == 1) InitGainAnalysis ( si.sample_freq );
97 if (j == 1) gain_init_analysis ( si.sample_freq );
9898
9999 while(1) {
100100 mpc_frame_info frame;
111111 title_max = maxf(title_max, sample_buffer[2 * i + 1]);
112112 }
113113
114 AnalyzeSamples(left_samples, right_samples, frame.samples, si.channels);
114 gain_analyze_samples(left_samples, right_samples, frame.samples, si.channels);
115115 }
116116
117 title_gain[j-1] = (mpc_uint16_t) (GetTitleGain() * 256);
117 title_gain[j-1] = (mpc_uint16_t) (gain_get_title() * 256);
118118 title_peak[j-1] = (mpc_uint16_t) (log10(title_max * (1 << 15)) * 20 * 256);
119119 header_pos[j-1] = si.header_position + 4;
120120
124124 mpc_reader_exit_stdio(&reader);
125125 }
126126
127 album_gain = (mpc_uint16_t) (GetAlbumGain() * 256);
127 album_gain = (mpc_uint16_t) (gain_get_album() * 256);
128128 album_peak = (mpc_uint16_t) (log10(album_max * (1 << 15)) * 20 * 256);
129129
130130 for( j = 0; j < argc - 1; j++) {
4848 wavcmp_OBJECTS = $(am_wavcmp_OBJECTS)
4949 wavcmp_DEPENDENCIES = $(top_builddir)/libwavformat/libwavformat.a
5050 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
51 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
51 depcomp = $(SHELL) $(top_srcdir)/depcomp
5252 am__depfiles_maybe = depfiles
5353 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
5454 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)