Commit a9fe3cb26746f79d809a776253db9c7c86b6ce42

Authored by knodlseder
1 parent 27459f32

Add configuration script

config.guess 0 → 100755
  1 +#! /bin/sh
  2 +# Attempt to guess a canonical system name.
  3 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
  4 +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
  5 +
  6 +timestamp='2003-01-10'
  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21 +#
  22 +# As a special exception to the GNU General Public License, if you
  23 +# distribute this file as part of a program that contains a
  24 +# configuration script generated by Autoconf, you may include it under
  25 +# the same distribution terms that you use for the rest of that program.
  26 +
  27 +# Originally written by Per Bothner <per@bothner.com>.
  28 +# Please send patches to <config-patches@gnu.org>. Submit a context
  29 +# diff and a properly formatted ChangeLog entry.
  30 +#
  31 +# This script attempts to guess a canonical system name similar to
  32 +# config.sub. If it succeeds, it prints the system name on stdout, and
  33 +# exits with 0. Otherwise, it exits with 1.
  34 +#
  35 +# The plan is that this can be called by configure scripts if you
  36 +# don't specify an explicit build system type.
  37 +
  38 +me=`echo "$0" | sed -e 's,.*/,,'`
  39 +
  40 +usage="\
  41 +Usage: $0 [OPTION]
  42 +
  43 +Output the configuration name of the system \`$me' is run on.
  44 +
  45 +Operation modes:
  46 + -h, --help print this help, then exit
  47 + -t, --time-stamp print date of last modification, then exit
  48 + -v, --version print version number, then exit
  49 +
  50 +Report bugs and patches to <config-patches@gnu.org>."
  51 +
  52 +version="\
  53 +GNU config.guess ($timestamp)
  54 +
  55 +Originally written by Per Bothner.
  56 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
  57 +Free Software Foundation, Inc.
  58 +
  59 +This is free software; see the source for copying conditions. There is NO
  60 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  61 +
  62 +help="
  63 +Try \`$me --help' for more information."
  64 +
  65 +# Parse command line
  66 +while test $# -gt 0 ; do
  67 + case $1 in
  68 + --time-stamp | --time* | -t )
  69 + echo "$timestamp" ; exit 0 ;;
  70 + --version | -v )
  71 + echo "$version" ; exit 0 ;;
  72 + --help | --h* | -h )
  73 + echo "$usage"; exit 0 ;;
  74 + -- ) # Stop option processing
  75 + shift; break ;;
  76 + - ) # Use stdin as input.
  77 + break ;;
  78 + -* )
  79 + echo "$me: invalid option $1$help" >&2
  80 + exit 1 ;;
  81 + * )
  82 + break ;;
  83 + esac
  84 +done
  85 +
  86 +if test $# != 0; then
  87 + echo "$me: too many arguments$help" >&2
  88 + exit 1
  89 +fi
  90 +
  91 +trap 'exit 1' 1 2 15
  92 +
  93 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
  94 +# compiler to aid in system detection is discouraged as it requires
  95 +# temporary files to be created and, as you can see below, it is a
  96 +# headache to deal with in a portable fashion.
  97 +
  98 +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
  99 +# use `HOST_CC' if defined, but it is deprecated.
  100 +
  101 +# Portable tmp directory creation inspired by the Autoconf team.
  102 +
  103 +set_cc_for_build='
  104 +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
  105 +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
  106 +: ${TMPDIR=/tmp} ;
  107 + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  108 + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  109 + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
  110 +dummy=$tmp/dummy ;
  111 +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
  112 +case $CC_FOR_BUILD,$HOST_CC,$CC in
  113 + ,,) echo "int x;" > $dummy.c ;
  114 + for c in cc gcc c89 c99 ; do
  115 + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
  116 + CC_FOR_BUILD="$c"; break ;
  117 + fi ;
  118 + done ;
  119 + if test x"$CC_FOR_BUILD" = x ; then
  120 + CC_FOR_BUILD=no_compiler_found ;
  121 + fi
  122 + ;;
  123 + ,,*) CC_FOR_BUILD=$CC ;;
  124 + ,*,*) CC_FOR_BUILD=$HOST_CC ;;
  125 +esac ;'
  126 +
  127 +# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  128 +# (ghazi@noc.rutgers.edu 1994-08-24)
  129 +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  130 + PATH=$PATH:/.attbin ; export PATH
  131 +fi
  132 +
  133 +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  134 +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  135 +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  136 +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  137 +
  138 +# Note: order is significant - the case branches are not exclusive.
  139 +
  140 +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  141 + *:NetBSD:*:*)
  142 + # NetBSD (nbsd) targets should (where applicable) match one or
  143 + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
  144 + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
  145 + # switched to ELF, *-*-netbsd* would select the old
  146 + # object file format. This provides both forward
  147 + # compatibility and a consistent mechanism for selecting the
  148 + # object file format.
  149 + #
  150 + # Note: NetBSD doesn't particularly care about the vendor
  151 + # portion of the name. We always set it to "unknown".
  152 + sysctl="sysctl -n hw.machine_arch"
  153 + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
  154 + /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
  155 + case "${UNAME_MACHINE_ARCH}" in
  156 + armeb) machine=armeb-unknown ;;
  157 + arm*) machine=arm-unknown ;;
  158 + sh3el) machine=shl-unknown ;;
  159 + sh3eb) machine=sh-unknown ;;
  160 + *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
  161 + esac
  162 + # The Operating System including object format, if it has switched
  163 + # to ELF recently, or will in the future.
  164 + case "${UNAME_MACHINE_ARCH}" in
  165 + arm*|i386|m68k|ns32k|sh3*|sparc|vax)
  166 + eval $set_cc_for_build
  167 + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  168 + | grep __ELF__ >/dev/null
  169 + then
  170 + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  171 + # Return netbsd for either. FIX?
  172 + os=netbsd
  173 + else
  174 + os=netbsdelf
  175 + fi
  176 + ;;
  177 + *)
  178 + os=netbsd
  179 + ;;
  180 + esac
  181 + # The OS release
  182 + # Debian GNU/NetBSD machines have a different userland, and
  183 + # thus, need a distinct triplet. However, they do not need
  184 + # kernel version information, so it can be replaced with a
  185 + # suitable tag, in the style of linux-gnu.
  186 + case "${UNAME_VERSION}" in
  187 + Debian*)
  188 + release='-gnu'
  189 + ;;
  190 + *)
  191 + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  192 + ;;
  193 + esac
  194 + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  195 + # contains redundant information, the shorter form:
  196 + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  197 + echo "${machine}-${os}${release}"
  198 + exit 0 ;;
  199 + amiga:OpenBSD:*:*)
  200 + echo m68k-unknown-openbsd${UNAME_RELEASE}
  201 + exit 0 ;;
  202 + arc:OpenBSD:*:*)
  203 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
  204 + exit 0 ;;
  205 + hp300:OpenBSD:*:*)
  206 + echo m68k-unknown-openbsd${UNAME_RELEASE}
  207 + exit 0 ;;
  208 + mac68k:OpenBSD:*:*)
  209 + echo m68k-unknown-openbsd${UNAME_RELEASE}
  210 + exit 0 ;;
  211 + macppc:OpenBSD:*:*)
  212 + echo powerpc-unknown-openbsd${UNAME_RELEASE}
  213 + exit 0 ;;
  214 + mvme68k:OpenBSD:*:*)
  215 + echo m68k-unknown-openbsd${UNAME_RELEASE}
  216 + exit 0 ;;
  217 + mvme88k:OpenBSD:*:*)
  218 + echo m88k-unknown-openbsd${UNAME_RELEASE}
  219 + exit 0 ;;
  220 + mvmeppc:OpenBSD:*:*)
  221 + echo powerpc-unknown-openbsd${UNAME_RELEASE}
  222 + exit 0 ;;
  223 + pmax:OpenBSD:*:*)
  224 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
  225 + exit 0 ;;
  226 + sgi:OpenBSD:*:*)
  227 + echo mipseb-unknown-openbsd${UNAME_RELEASE}
  228 + exit 0 ;;
  229 + sun3:OpenBSD:*:*)
  230 + echo m68k-unknown-openbsd${UNAME_RELEASE}
  231 + exit 0 ;;
  232 + wgrisc:OpenBSD:*:*)
  233 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
  234 + exit 0 ;;
  235 + *:OpenBSD:*:*)
  236 + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
  237 + exit 0 ;;
  238 + *:MicroBSD:*:*)
  239 + echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
  240 + exit 0 ;;
  241 + alpha:OSF1:*:*)
  242 + if test $UNAME_RELEASE = "V4.0"; then
  243 + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  244 + fi
  245 + # A Vn.n version is a released version.
  246 + # A Tn.n version is a released field test version.
  247 + # A Xn.n version is an unreleased experimental baselevel.
  248 + # 1.2 uses "1.2" for uname -r.
  249 + eval $set_cc_for_build
  250 + cat <<EOF >$dummy.s
  251 + .data
  252 +\$Lformat:
  253 + .byte 37,100,45,37,120,10,0 # "%d-%x\n"
  254 +
  255 + .text
  256 + .globl main
  257 + .align 4
  258 + .ent main
  259 +main:
  260 + .frame \$30,16,\$26,0
  261 + ldgp \$29,0(\$27)
  262 + .prologue 1
  263 + .long 0x47e03d80 # implver \$0
  264 + lda \$2,-1
  265 + .long 0x47e20c21 # amask \$2,\$1
  266 + lda \$16,\$Lformat
  267 + mov \$0,\$17
  268 + not \$1,\$18
  269 + jsr \$26,printf
  270 + ldgp \$29,0(\$26)
  271 + mov 0,\$16
  272 + jsr \$26,exit
  273 + .end main
  274 +EOF
  275 + $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
  276 + if test "$?" = 0 ; then
  277 + case `$dummy` in
  278 + 0-0)
  279 + UNAME_MACHINE="alpha"
  280 + ;;
  281 + 1-0)
  282 + UNAME_MACHINE="alphaev5"
  283 + ;;
  284 + 1-1)
  285 + UNAME_MACHINE="alphaev56"
  286 + ;;
  287 + 1-101)
  288 + UNAME_MACHINE="alphapca56"
  289 + ;;
  290 + 2-303)
  291 + UNAME_MACHINE="alphaev6"
  292 + ;;
  293 + 2-307)
  294 + UNAME_MACHINE="alphaev67"
  295 + ;;
  296 + 2-1307)
  297 + UNAME_MACHINE="alphaev68"
  298 + ;;
  299 + 3-1307)
  300 + UNAME_MACHINE="alphaev7"
  301 + ;;
  302 + esac
  303 + fi
  304 + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  305 + exit 0 ;;
  306 + Alpha\ *:Windows_NT*:*)
  307 + # How do we know it's Interix rather than the generic POSIX subsystem?
  308 + # Should we change UNAME_MACHINE based on the output of uname instead
  309 + # of the specific Alpha model?
  310 + echo alpha-pc-interix
  311 + exit 0 ;;
  312 + 21064:Windows_NT:50:3)
  313 + echo alpha-dec-winnt3.5
  314 + exit 0 ;;
  315 + Amiga*:UNIX_System_V:4.0:*)
  316 + echo m68k-unknown-sysv4
  317 + exit 0;;
  318 + *:[Aa]miga[Oo][Ss]:*:*)
  319 + echo ${UNAME_MACHINE}-unknown-amigaos
  320 + exit 0 ;;
  321 + *:[Mm]orph[Oo][Ss]:*:*)
  322 + echo ${UNAME_MACHINE}-unknown-morphos
  323 + exit 0 ;;
  324 + *:OS/390:*:*)
  325 + echo i370-ibm-openedition
  326 + exit 0 ;;
  327 + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  328 + echo arm-acorn-riscix${UNAME_RELEASE}
  329 + exit 0;;
  330 + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  331 + echo hppa1.1-hitachi-hiuxmpp
  332 + exit 0;;
  333 + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  334 + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  335 + if test "`(/bin/universe) 2>/dev/null`" = att ; then
  336 + echo pyramid-pyramid-sysv3
  337 + else
  338 + echo pyramid-pyramid-bsd
  339 + fi
  340 + exit 0 ;;
  341 + NILE*:*:*:dcosx)
  342 + echo pyramid-pyramid-svr4
  343 + exit 0 ;;
  344 + DRS?6000:UNIX_SV:4.2*:7*)
  345 + case `/usr/bin/uname -p` in
  346 + sparc) echo sparc-icl-nx7 && exit 0 ;;
  347 + esac ;;
  348 + sun4H:SunOS:5.*:*)
  349 + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  350 + exit 0 ;;
  351 + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  352 + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  353 + exit 0 ;;
  354 + i86pc:SunOS:5.*:*)
  355 + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  356 + exit 0 ;;
  357 + sun4*:SunOS:6*:*)
  358 + # According to config.sub, this is the proper way to canonicalize
  359 + # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  360 + # it's likely to be more like Solaris than SunOS4.
  361 + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  362 + exit 0 ;;
  363 + sun4*:SunOS:*:*)
  364 + case "`/usr/bin/arch -k`" in
  365 + Series*|S4*)
  366 + UNAME_RELEASE=`uname -v`
  367 + ;;
  368 + esac
  369 + # Japanese Language versions have a version number like `4.1.3-JL'.
  370 + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  371 + exit 0 ;;
  372 + sun3*:SunOS:*:*)
  373 + echo m68k-sun-sunos${UNAME_RELEASE}
  374 + exit 0 ;;
  375 + sun*:*:4.2BSD:*)
  376 + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  377 + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
  378 + case "`/bin/arch`" in
  379 + sun3)
  380 + echo m68k-sun-sunos${UNAME_RELEASE}
  381 + ;;
  382 + sun4)
  383 + echo sparc-sun-sunos${UNAME_RELEASE}
  384 + ;;
  385 + esac
  386 + exit 0 ;;
  387 + aushp:SunOS:*:*)
  388 + echo sparc-auspex-sunos${UNAME_RELEASE}
  389 + exit 0 ;;
  390 + # The situation for MiNT is a little confusing. The machine name
  391 + # can be virtually everything (everything which is not
  392 + # "atarist" or "atariste" at least should have a processor
  393 + # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
  394 + # to the lowercase version "mint" (or "freemint"). Finally
  395 + # the system name "TOS" denotes a system which is actually not
  396 + # MiNT. But MiNT is downward compatible to TOS, so this should
  397 + # be no problem.
  398 + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  399 + echo m68k-atari-mint${UNAME_RELEASE}
  400 + exit 0 ;;
  401 + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  402 + echo m68k-atari-mint${UNAME_RELEASE}
  403 + exit 0 ;;
  404 + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  405 + echo m68k-atari-mint${UNAME_RELEASE}
  406 + exit 0 ;;
  407 + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  408 + echo m68k-milan-mint${UNAME_RELEASE}
  409 + exit 0 ;;
  410 + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  411 + echo m68k-hades-mint${UNAME_RELEASE}
  412 + exit 0 ;;
  413 + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  414 + echo m68k-unknown-mint${UNAME_RELEASE}
  415 + exit 0 ;;
  416 + powerpc:machten:*:*)
  417 + echo powerpc-apple-machten${UNAME_RELEASE}
  418 + exit 0 ;;
  419 + RISC*:Mach:*:*)
  420 + echo mips-dec-mach_bsd4.3
  421 + exit 0 ;;
  422 + RISC*:ULTRIX:*:*)
  423 + echo mips-dec-ultrix${UNAME_RELEASE}
  424 + exit 0 ;;
  425 + VAX*:ULTRIX*:*:*)
  426 + echo vax-dec-ultrix${UNAME_RELEASE}
  427 + exit 0 ;;
  428 + 2020:CLIX:*:* | 2430:CLIX:*:*)
  429 + echo clipper-intergraph-clix${UNAME_RELEASE}
  430 + exit 0 ;;
  431 + mips:*:*:UMIPS | mips:*:*:RISCos)
  432 + eval $set_cc_for_build
  433 + sed 's/^ //' << EOF >$dummy.c
  434 +#ifdef __cplusplus
  435 +#include <stdio.h> /* for printf() prototype */
  436 + int main (int argc, char *argv[]) {
  437 +#else
  438 + int main (argc, argv) int argc; char *argv[]; {
  439 +#endif
  440 + #if defined (host_mips) && defined (MIPSEB)
  441 + #if defined (SYSTYPE_SYSV)
  442 + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  443 + #endif
  444 + #if defined (SYSTYPE_SVR4)
  445 + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  446 + #endif
  447 + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  448 + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  449 + #endif
  450 + #endif
  451 + exit (-1);
  452 + }
  453 +EOF
  454 + $CC_FOR_BUILD -o $dummy $dummy.c \
  455 + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
  456 + && exit 0
  457 + echo mips-mips-riscos${UNAME_RELEASE}
  458 + exit 0 ;;
  459 + Motorola:PowerMAX_OS:*:*)
  460 + echo powerpc-motorola-powermax
  461 + exit 0 ;;
  462 + Motorola:*:4.3:PL8-*)
  463 + echo powerpc-harris-powermax
  464 + exit 0 ;;
  465 + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
  466 + echo powerpc-harris-powermax
  467 + exit 0 ;;
  468 + Night_Hawk:Power_UNIX:*:*)
  469 + echo powerpc-harris-powerunix
  470 + exit 0 ;;
  471 + m88k:CX/UX:7*:*)
  472 + echo m88k-harris-cxux7
  473 + exit 0 ;;
  474 + m88k:*:4*:R4*)
  475 + echo m88k-motorola-sysv4
  476 + exit 0 ;;
  477 + m88k:*:3*:R3*)
  478 + echo m88k-motorola-sysv3
  479 + exit 0 ;;
  480 + AViiON:dgux:*:*)
  481 + # DG/UX returns AViiON for all architectures
  482 + UNAME_PROCESSOR=`/usr/bin/uname -p`
  483 + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
  484 + then
  485 + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
  486 + [ ${TARGET_BINARY_INTERFACE}x = x ]
  487 + then
  488 + echo m88k-dg-dgux${UNAME_RELEASE}
  489 + else
  490 + echo m88k-dg-dguxbcs${UNAME_RELEASE}
  491 + fi
  492 + else
  493 + echo i586-dg-dgux${UNAME_RELEASE}
  494 + fi
  495 + exit 0 ;;
  496 + M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  497 + echo m88k-dolphin-sysv3
  498 + exit 0 ;;
  499 + M88*:*:R3*:*)
  500 + # Delta 88k system running SVR3
  501 + echo m88k-motorola-sysv3
  502 + exit 0 ;;
  503 + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  504 + echo m88k-tektronix-sysv3
  505 + exit 0 ;;
  506 + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  507 + echo m68k-tektronix-bsd
  508 + exit 0 ;;
  509 + *:IRIX*:*:*)
  510 + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  511 + exit 0 ;;
  512 + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  513 + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  514 + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  515 + i*86:AIX:*:*)
  516 + echo i386-ibm-aix
  517 + exit 0 ;;
  518 + ia64:AIX:*:*)
  519 + if [ -x /usr/bin/oslevel ] ; then
  520 + IBM_REV=`/usr/bin/oslevel`
  521 + else
  522 + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  523 + fi
  524 + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
  525 + exit 0 ;;
  526 + *:AIX:2:3)
  527 + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  528 + eval $set_cc_for_build
  529 + sed 's/^ //' << EOF >$dummy.c
  530 + #include <sys/systemcfg.h>
  531 +
  532 + main()
  533 + {
  534 + if (!__power_pc())
  535 + exit(1);
  536 + puts("powerpc-ibm-aix3.2.5");
  537 + exit(0);
  538 + }
  539 +EOF
  540 + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
  541 + echo rs6000-ibm-aix3.2.5
  542 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  543 + echo rs6000-ibm-aix3.2.4
  544 + else
  545 + echo rs6000-ibm-aix3.2
  546 + fi
  547 + exit 0 ;;
  548 + *:AIX:*:[45])
  549 + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  550 + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  551 + IBM_ARCH=rs6000
  552 + else
  553 + IBM_ARCH=powerpc
  554 + fi
  555 + if [ -x /usr/bin/oslevel ] ; then
  556 + IBM_REV=`/usr/bin/oslevel`
  557 + else
  558 + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  559 + fi
  560 + echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  561 + exit 0 ;;
  562 + *:AIX:*:*)
  563 + echo rs6000-ibm-aix
  564 + exit 0 ;;
  565 + ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  566 + echo romp-ibm-bsd4.4
  567 + exit 0 ;;
  568 + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  569 + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
  570 + exit 0 ;; # report: romp-ibm BSD 4.3
  571 + *:BOSX:*:*)
  572 + echo rs6000-bull-bosx
  573 + exit 0 ;;
  574 + DPX/2?00:B.O.S.:*:*)
  575 + echo m68k-bull-sysv3
  576 + exit 0 ;;
  577 + 9000/[34]??:4.3bsd:1.*:*)
  578 + echo m68k-hp-bsd
  579 + exit 0 ;;
  580 + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  581 + echo m68k-hp-bsd4.4
  582 + exit 0 ;;
  583 + 9000/[34678]??:HP-UX:*:*)
  584 + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  585 + case "${UNAME_MACHINE}" in
  586 + 9000/31? ) HP_ARCH=m68000 ;;
  587 + 9000/[34]?? ) HP_ARCH=m68k ;;
  588 + 9000/[678][0-9][0-9])
  589 + if [ -x /usr/bin/getconf ]; then
  590 + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  591 + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  592 + case "${sc_cpu_version}" in
  593 + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
  594 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
  595 + 532) # CPU_PA_RISC2_0
  596 + case "${sc_kernel_bits}" in
  597 + 32) HP_ARCH="hppa2.0n" ;;
  598 + 64) HP_ARCH="hppa2.0w" ;;
  599 + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
  600 + esac ;;
  601 + esac
  602 + fi
  603 + if [ "${HP_ARCH}" = "" ]; then
  604 + eval $set_cc_for_build
  605 + sed 's/^ //' << EOF >$dummy.c
  606 +
  607 + #define _HPUX_SOURCE
  608 + #include <stdlib.h>
  609 + #include <unistd.h>
  610 +
  611 + int main ()
  612 + {
  613 + #if defined(_SC_KERNEL_BITS)
  614 + long bits = sysconf(_SC_KERNEL_BITS);
  615 + #endif
  616 + long cpu = sysconf (_SC_CPU_VERSION);
  617 +
  618 + switch (cpu)
  619 + {
  620 + case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  621 + case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  622 + case CPU_PA_RISC2_0:
  623 + #if defined(_SC_KERNEL_BITS)
  624 + switch (bits)
  625 + {
  626 + case 64: puts ("hppa2.0w"); break;
  627 + case 32: puts ("hppa2.0n"); break;
  628 + default: puts ("hppa2.0"); break;
  629 + } break;
  630 + #else /* !defined(_SC_KERNEL_BITS) */
  631 + puts ("hppa2.0"); break;
  632 + #endif
  633 + default: puts ("hppa1.0"); break;
  634 + }
  635 + exit (0);
  636 + }
  637 +EOF
  638 + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
  639 + test -z "$HP_ARCH" && HP_ARCH=hppa
  640 + fi ;;
  641 + esac
  642 + if [ ${HP_ARCH} = "hppa2.0w" ]
  643 + then
  644 + # avoid double evaluation of $set_cc_for_build
  645 + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
  646 + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
  647 + then
  648 + HP_ARCH="hppa2.0w"
  649 + else
  650 + HP_ARCH="hppa64"
  651 + fi
  652 + fi
  653 + echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  654 + exit 0 ;;
  655 + ia64:HP-UX:*:*)
  656 + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  657 + echo ia64-hp-hpux${HPUX_REV}
  658 + exit 0 ;;
  659 + 3050*:HI-UX:*:*)
  660 + eval $set_cc_for_build
  661 + sed 's/^ //' << EOF >$dummy.c
  662 + #include <unistd.h>
  663 + int
  664 + main ()
  665 + {
  666 + long cpu = sysconf (_SC_CPU_VERSION);
  667 + /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  668 + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  669 + results, however. */
  670 + if (CPU_IS_PA_RISC (cpu))
  671 + {
  672 + switch (cpu)
  673 + {
  674 + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  675 + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  676 + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  677 + default: puts ("hppa-hitachi-hiuxwe2"); break;
  678 + }
  679 + }
  680 + else if (CPU_IS_HP_MC68K (cpu))
  681 + puts ("m68k-hitachi-hiuxwe2");
  682 + else puts ("unknown-hitachi-hiuxwe2");
  683 + exit (0);
  684 + }
  685 +EOF
  686 + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
  687 + echo unknown-hitachi-hiuxwe2
  688 + exit 0 ;;
  689 + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  690 + echo hppa1.1-hp-bsd
  691 + exit 0 ;;
  692 + 9000/8??:4.3bsd:*:*)
  693 + echo hppa1.0-hp-bsd
  694 + exit 0 ;;
  695 + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  696 + echo hppa1.0-hp-mpeix
  697 + exit 0 ;;
  698 + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  699 + echo hppa1.1-hp-osf
  700 + exit 0 ;;
  701 + hp8??:OSF1:*:*)
  702 + echo hppa1.0-hp-osf
  703 + exit 0 ;;
  704 + i*86:OSF1:*:*)
  705 + if [ -x /usr/sbin/sysversion ] ; then
  706 + echo ${UNAME_MACHINE}-unknown-osf1mk
  707 + else
  708 + echo ${UNAME_MACHINE}-unknown-osf1
  709 + fi
  710 + exit 0 ;;
  711 + parisc*:Lites*:*:*)
  712 + echo hppa1.1-hp-lites
  713 + exit 0 ;;
  714 + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  715 + echo c1-convex-bsd
  716 + exit 0 ;;
  717 + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  718 + if getsysinfo -f scalar_acc
  719 + then echo c32-convex-bsd
  720 + else echo c2-convex-bsd
  721 + fi
  722 + exit 0 ;;
  723 + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  724 + echo c34-convex-bsd
  725 + exit 0 ;;
  726 + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  727 + echo c38-convex-bsd
  728 + exit 0 ;;
  729 + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  730 + echo c4-convex-bsd
  731 + exit 0 ;;
  732 + CRAY*Y-MP:*:*:*)
  733 + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  734 + exit 0 ;;
  735 + CRAY*[A-Z]90:*:*:*)
  736 + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  737 + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  738 + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  739 + -e 's/\.[^.]*$/.X/'
  740 + exit 0 ;;
  741 + CRAY*TS:*:*:*)
  742 + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  743 + exit 0 ;;
  744 + CRAY*T3E:*:*:*)
  745 + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  746 + exit 0 ;;
  747 + CRAY*SV1:*:*:*)
  748 + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  749 + exit 0 ;;
  750 + *:UNICOS/mp:*:*)
  751 + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  752 + exit 0 ;;
  753 + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  754 + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  755 + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  756 + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  757 + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  758 + exit 0 ;;
  759 + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  760 + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  761 + exit 0 ;;
  762 + sparc*:BSD/OS:*:*)
  763 + echo sparc-unknown-bsdi${UNAME_RELEASE}
  764 + exit 0 ;;
  765 + *:BSD/OS:*:*)
  766 + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  767 + exit 0 ;;
  768 + *:FreeBSD:*:*)
  769 + # Determine whether the default compiler uses glibc.
  770 + eval $set_cc_for_build
  771 + sed 's/^ //' << EOF >$dummy.c
  772 + #include <features.h>
  773 + #if __GLIBC__ >= 2
  774 + LIBC=gnu
  775 + #else
  776 + LIBC=
  777 + #endif
  778 +EOF
  779 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  780 + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
  781 + exit 0 ;;
  782 + i*:CYGWIN*:*)
  783 + echo ${UNAME_MACHINE}-pc-cygwin
  784 + exit 0 ;;
  785 + i*:MINGW*:*)
  786 + echo ${UNAME_MACHINE}-pc-mingw32
  787 + exit 0 ;;
  788 + i*:PW*:*)
  789 + echo ${UNAME_MACHINE}-pc-pw32
  790 + exit 0 ;;
  791 + x86:Interix*:3*)
  792 + echo i586-pc-interix3
  793 + exit 0 ;;
  794 + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
  795 + echo i${UNAME_MACHINE}-pc-mks
  796 + exit 0 ;;
  797 + i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  798 + # How do we know it's Interix rather than the generic POSIX subsystem?
  799 + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  800 + # UNAME_MACHINE based on the output of uname instead of i386?
  801 + echo i586-pc-interix
  802 + exit 0 ;;
  803 + i*:UWIN*:*)
  804 + echo ${UNAME_MACHINE}-pc-uwin
  805 + exit 0 ;;
  806 + p*:CYGWIN*:*)
  807 + echo powerpcle-unknown-cygwin
  808 + exit 0 ;;
  809 + prep*:SunOS:5.*:*)
  810 + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  811 + exit 0 ;;
  812 + *:GNU:*:*)
  813 + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  814 + exit 0 ;;
  815 + i*86:Minix:*:*)
  816 + echo ${UNAME_MACHINE}-pc-minix
  817 + exit 0 ;;
  818 + arm*:Linux:*:*)
  819 + echo ${UNAME_MACHINE}-unknown-linux-gnu
  820 + exit 0 ;;
  821 + ia64:Linux:*:*)
  822 + echo ${UNAME_MACHINE}-unknown-linux-gnu
  823 + exit 0 ;;
  824 + m68*:Linux:*:*)
  825 + echo ${UNAME_MACHINE}-unknown-linux-gnu
  826 + exit 0 ;;
  827 + mips:Linux:*:*)
  828 + eval $set_cc_for_build
  829 + sed 's/^ //' << EOF >$dummy.c
  830 + #undef CPU
  831 + #undef mips
  832 + #undef mipsel
  833 + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  834 + CPU=mipsel
  835 + #else
  836 + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  837 + CPU=mips
  838 + #else
  839 + CPU=
  840 + #endif
  841 + #endif
  842 +EOF
  843 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  844 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
  845 + ;;
  846 + mips64:Linux:*:*)
  847 + eval $set_cc_for_build
  848 + sed 's/^ //' << EOF >$dummy.c
  849 + #undef CPU
  850 + #undef mips64
  851 + #undef mips64el
  852 + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  853 + CPU=mips64el
  854 + #else
  855 + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  856 + CPU=mips64
  857 + #else
  858 + CPU=
  859 + #endif
  860 + #endif
  861 +EOF
  862 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  863 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
  864 + ;;
  865 + ppc:Linux:*:*)
  866 + echo powerpc-unknown-linux-gnu
  867 + exit 0 ;;
  868 + ppc64:Linux:*:*)
  869 + echo powerpc64-unknown-linux-gnu
  870 + exit 0 ;;
  871 + alpha:Linux:*:*)
  872 + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  873 + EV5) UNAME_MACHINE=alphaev5 ;;
  874 + EV56) UNAME_MACHINE=alphaev56 ;;
  875 + PCA56) UNAME_MACHINE=alphapca56 ;;
  876 + PCA57) UNAME_MACHINE=alphapca56 ;;
  877 + EV6) UNAME_MACHINE=alphaev6 ;;
  878 + EV67) UNAME_MACHINE=alphaev67 ;;
  879 + EV68*) UNAME_MACHINE=alphaev68 ;;
  880 + esac
  881 + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
  882 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
  883 + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
  884 + exit 0 ;;
  885 + parisc:Linux:*:* | hppa:Linux:*:*)
  886 + # Look for CPU level
  887 + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  888 + PA7*) echo hppa1.1-unknown-linux-gnu ;;
  889 + PA8*) echo hppa2.0-unknown-linux-gnu ;;
  890 + *) echo hppa-unknown-linux-gnu ;;
  891 + esac
  892 + exit 0 ;;
  893 + parisc64:Linux:*:* | hppa64:Linux:*:*)
  894 + echo hppa64-unknown-linux-gnu
  895 + exit 0 ;;
  896 + s390:Linux:*:* | s390x:Linux:*:*)
  897 + echo ${UNAME_MACHINE}-ibm-linux
  898 + exit 0 ;;
  899 + sh*:Linux:*:*)
  900 + echo ${UNAME_MACHINE}-unknown-linux-gnu
  901 + exit 0 ;;
  902 + sparc:Linux:*:* | sparc64:Linux:*:*)
  903 + echo ${UNAME_MACHINE}-unknown-linux-gnu
  904 + exit 0 ;;
  905 + x86_64:Linux:*:*)
  906 + echo x86_64-unknown-linux-gnu
  907 + exit 0 ;;
  908 + i*86:Linux:*:*)
  909 + # The BFD linker knows what the default object file format is, so
  910 + # first see if it will tell us. cd to the root directory to prevent
  911 + # problems with other programs or directories called `ld' in the path.
  912 + # Set LC_ALL=C to ensure ld outputs messages in English.
  913 + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
  914 + | sed -ne '/supported targets:/!d
  915 + s/[ ][ ]*/ /g
  916 + s/.*supported targets: *//
  917 + s/ .*//
  918 + p'`
  919 + case "$ld_supported_targets" in
  920 + elf32-i386)
  921 + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
  922 + ;;
  923 + a.out-i386-linux)
  924 + echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  925 + exit 0 ;;
  926 + coff-i386)
  927 + echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  928 + exit 0 ;;
  929 + "")
  930 + # Either a pre-BFD a.out linker (linux-gnuoldld) or
  931 + # one that does not give us useful --help.
  932 + echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
  933 + exit 0 ;;
  934 + esac
  935 + # Determine whether the default compiler is a.out or elf
  936 + eval $set_cc_for_build
  937 + sed 's/^ //' << EOF >$dummy.c
  938 + #include <features.h>
  939 + #ifdef __ELF__
  940 + # ifdef __GLIBC__
  941 + # if __GLIBC__ >= 2
  942 + LIBC=gnu
  943 + # else
  944 + LIBC=gnulibc1
  945 + # endif
  946 + # else
  947 + LIBC=gnulibc1
  948 + # endif
  949 + #else
  950 + #ifdef __INTEL_COMPILER
  951 + LIBC=gnu
  952 + #else
  953 + LIBC=gnuaout
  954 + #endif
  955 + #endif
  956 +EOF
  957 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  958 + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
  959 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
  960 + ;;
  961 + i*86:DYNIX/ptx:4*:*)
  962 + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  963 + # earlier versions are messed up and put the nodename in both
  964 + # sysname and nodename.
  965 + echo i386-sequent-sysv4
  966 + exit 0 ;;
  967 + i*86:UNIX_SV:4.2MP:2.*)
  968 + # Unixware is an offshoot of SVR4, but it has its own version
  969 + # number series starting with 2...
  970 + # I am not positive that other SVR4 systems won't match this,
  971 + # I just have to hope. -- rms.
  972 + # Use sysv4.2uw... so that sysv4* matches it.
  973 + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  974 + exit 0 ;;
  975 + i*86:OS/2:*:*)
  976 + # If we were able to find `uname', then EMX Unix compatibility
  977 + # is probably installed.
  978 + echo ${UNAME_MACHINE}-pc-os2-emx
  979 + exit 0 ;;
  980 + i*86:XTS-300:*:STOP)
  981 + echo ${UNAME_MACHINE}-unknown-stop
  982 + exit 0 ;;
  983 + i*86:atheos:*:*)
  984 + echo ${UNAME_MACHINE}-unknown-atheos
  985 + exit 0 ;;
  986 + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
  987 + echo i386-unknown-lynxos${UNAME_RELEASE}
  988 + exit 0 ;;
  989 + i*86:*DOS:*:*)
  990 + echo ${UNAME_MACHINE}-pc-msdosdjgpp
  991 + exit 0 ;;
  992 + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  993 + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  994 + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  995 + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  996 + else
  997 + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  998 + fi
  999 + exit 0 ;;
  1000 + i*86:*:5:[78]*)
  1001 + case `/bin/uname -X | grep "^Machine"` in
  1002 + *486*) UNAME_MACHINE=i486 ;;
  1003 + *Pentium) UNAME_MACHINE=i586 ;;
  1004 + *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1005 + esac
  1006 + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  1007 + exit 0 ;;
  1008 + i*86:*:3.2:*)
  1009 + if test -f /usr/options/cb.name; then
  1010 + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1011 + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  1012 + elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1013 + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1014 + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1015 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1016 + && UNAME_MACHINE=i586
  1017 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1018 + && UNAME_MACHINE=i686
  1019 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1020 + && UNAME_MACHINE=i686
  1021 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  1022 + else
  1023 + echo ${UNAME_MACHINE}-pc-sysv32
  1024 + fi
  1025 + exit 0 ;;
  1026 + pc:*:*:*)
  1027 + # Left here for compatibility:
  1028 + # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1029 + # the processor, so we play safe by assuming i386.
  1030 + echo i386-pc-msdosdjgpp
  1031 + exit 0 ;;
  1032 + Intel:Mach:3*:*)
  1033 + echo i386-pc-mach3
  1034 + exit 0 ;;
  1035 + paragon:*:*:*)
  1036 + echo i860-intel-osf1
  1037 + exit 0 ;;
  1038 + i860:*:4.*:*) # i860-SVR4
  1039 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  1040 + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  1041 + else # Add other i860-SVR4 vendors below as they are discovered.
  1042 + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
  1043 + fi
  1044 + exit 0 ;;
  1045 + mini*:CTIX:SYS*5:*)
  1046 + # "miniframe"
  1047 + echo m68010-convergent-sysv
  1048 + exit 0 ;;
  1049 + mc68k:UNIX:SYSTEM5:3.51m)
  1050 + echo m68k-convergent-sysv
  1051 + exit 0 ;;
  1052 + M680?0:D-NIX:5.3:*)
  1053 + echo m68k-diab-dnix
  1054 + exit 0 ;;
  1055 + M68*:*:R3V[567]*:*)
  1056 + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  1057 + 3[34]??:*: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)
  1058 + OS_REL=''
  1059 + test -r /etc/.relid \
  1060 + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1061 + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1062 + && echo i486-ncr-sysv4.3${OS_REL} && exit 0
  1063 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1064 + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
  1065 + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1066 + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1067 + && echo i486-ncr-sysv4 && exit 0 ;;
  1068 + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1069 + echo m68k-unknown-lynxos${UNAME_RELEASE}
  1070 + exit 0 ;;
  1071 + mc68030:UNIX_System_V:4.*:*)
  1072 + echo m68k-atari-sysv4
  1073 + exit 0 ;;
  1074 + TSUNAMI:LynxOS:2.*:*)
  1075 + echo sparc-unknown-lynxos${UNAME_RELEASE}
  1076 + exit 0 ;;
  1077 + rs6000:LynxOS:2.*:*)
  1078 + echo rs6000-unknown-lynxos${UNAME_RELEASE}
  1079 + exit 0 ;;
  1080 + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
  1081 + echo powerpc-unknown-lynxos${UNAME_RELEASE}
  1082 + exit 0 ;;
  1083 + SM[BE]S:UNIX_SV:*:*)
  1084 + echo mips-dde-sysv${UNAME_RELEASE}
  1085 + exit 0 ;;
  1086 + RM*:ReliantUNIX-*:*:*)
  1087 + echo mips-sni-sysv4
  1088 + exit 0 ;;
  1089 + RM*:SINIX-*:*:*)
  1090 + echo mips-sni-sysv4
  1091 + exit 0 ;;
  1092 + *:SINIX-*:*:*)
  1093 + if uname -p 2>/dev/null >/dev/null ; then
  1094 + UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1095 + echo ${UNAME_MACHINE}-sni-sysv4
  1096 + else
  1097 + echo ns32k-sni-sysv
  1098 + fi
  1099 + exit 0 ;;
  1100 + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1101 + # says <Richard.M.Bartel@ccMail.Census.GOV>
  1102 + echo i586-unisys-sysv4
  1103 + exit 0 ;;
  1104 + *:UNIX_System_V:4*:FTX*)
  1105 + # From Gerald Hewes <hewes@openmarket.com>.
  1106 + # How about differentiating between stratus architectures? -djm
  1107 + echo hppa1.1-stratus-sysv4
  1108 + exit 0 ;;
  1109 + *:*:*:FTX*)
  1110 + # From seanf@swdc.stratus.com.
  1111 + echo i860-stratus-sysv4
  1112 + exit 0 ;;
  1113 + *:VOS:*:*)
  1114 + # From Paul.Green@stratus.com.
  1115 + echo hppa1.1-stratus-vos
  1116 + exit 0 ;;
  1117 + mc68*:A/UX:*:*)
  1118 + echo m68k-apple-aux${UNAME_RELEASE}
  1119 + exit 0 ;;
  1120 + news*:NEWS-OS:6*:*)
  1121 + echo mips-sony-newsos6
  1122 + exit 0 ;;
  1123 + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1124 + if [ -d /usr/nec ]; then
  1125 + echo mips-nec-sysv${UNAME_RELEASE}
  1126 + else
  1127 + echo mips-unknown-sysv${UNAME_RELEASE}
  1128 + fi
  1129 + exit 0 ;;
  1130 + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1131 + echo powerpc-be-beos
  1132 + exit 0 ;;
  1133 + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1134 + echo powerpc-apple-beos
  1135 + exit 0 ;;
  1136 + BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1137 + echo i586-pc-beos
  1138 + exit 0 ;;
  1139 + SX-4:SUPER-UX:*:*)
  1140 + echo sx4-nec-superux${UNAME_RELEASE}
  1141 + exit 0 ;;
  1142 + SX-5:SUPER-UX:*:*)
  1143 + echo sx5-nec-superux${UNAME_RELEASE}
  1144 + exit 0 ;;
  1145 + SX-6:SUPER-UX:*:*)
  1146 + echo sx6-nec-superux${UNAME_RELEASE}
  1147 + exit 0 ;;
  1148 + Power*:Rhapsody:*:*)
  1149 + echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1150 + exit 0 ;;
  1151 + *:Rhapsody:*:*)
  1152 + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1153 + exit 0 ;;
  1154 + *:Darwin:*:*)
  1155 + case `uname -p` in
  1156 + *86) UNAME_PROCESSOR=i686 ;;
  1157 + powerpc) UNAME_PROCESSOR=powerpc ;;
  1158 + esac
  1159 + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1160 + exit 0 ;;
  1161 + *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1162 + UNAME_PROCESSOR=`uname -p`
  1163 + if test "$UNAME_PROCESSOR" = "x86"; then
  1164 + UNAME_PROCESSOR=i386
  1165 + UNAME_MACHINE=pc
  1166 + fi
  1167 + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
  1168 + exit 0 ;;
  1169 + *:QNX:*:4*)
  1170 + echo i386-pc-qnx
  1171 + exit 0 ;;
  1172 + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
  1173 + echo nsr-tandem-nsk${UNAME_RELEASE}
  1174 + exit 0 ;;
  1175 + *:NonStop-UX:*:*)
  1176 + echo mips-compaq-nonstopux
  1177 + exit 0 ;;
  1178 + BS2000:POSIX*:*:*)
  1179 + echo bs2000-siemens-sysv
  1180 + exit 0 ;;
  1181 + DS/*:UNIX_System_V:*:*)
  1182 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
  1183 + exit 0 ;;
  1184 + *:Plan9:*:*)
  1185 + # "uname -m" is not consistent, so use $cputype instead. 386
  1186 + # is converted to i386 for consistency with other x86
  1187 + # operating systems.
  1188 + if test "$cputype" = "386"; then
  1189 + UNAME_MACHINE=i386
  1190 + else
  1191 + UNAME_MACHINE="$cputype"
  1192 + fi
  1193 + echo ${UNAME_MACHINE}-unknown-plan9
  1194 + exit 0 ;;
  1195 + *:TOPS-10:*:*)
  1196 + echo pdp10-unknown-tops10
  1197 + exit 0 ;;
  1198 + *:TENEX:*:*)
  1199 + echo pdp10-unknown-tenex
  1200 + exit 0 ;;
  1201 + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  1202 + echo pdp10-dec-tops20
  1203 + exit 0 ;;
  1204 + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  1205 + echo pdp10-xkl-tops20
  1206 + exit 0 ;;
  1207 + *:TOPS-20:*:*)
  1208 + echo pdp10-unknown-tops20
  1209 + exit 0 ;;
  1210 + *:ITS:*:*)
  1211 + echo pdp10-unknown-its
  1212 + exit 0 ;;
  1213 +esac
  1214 +
  1215 +#echo '(No uname command or uname output not recognized.)' 1>&2
  1216 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1217 +
  1218 +eval $set_cc_for_build
  1219 +cat >$dummy.c <<EOF
  1220 +#ifdef _SEQUENT_
  1221 +# include <sys/types.h>
  1222 +# include <sys/utsname.h>
  1223 +#endif
  1224 +main ()
  1225 +{
  1226 +#if defined (sony)
  1227 +#if defined (MIPSEB)
  1228 + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1229 + I don't know.... */
  1230 + printf ("mips-sony-bsd\n"); exit (0);
  1231 +#else
  1232 +#include <sys/param.h>
  1233 + printf ("m68k-sony-newsos%s\n",
  1234 +#ifdef NEWSOS4
  1235 + "4"
  1236 +#else
  1237 + ""
  1238 +#endif
  1239 + ); exit (0);
  1240 +#endif
  1241 +#endif
  1242 +
  1243 +#if defined (__arm) && defined (__acorn) && defined (__unix)
  1244 + printf ("arm-acorn-riscix"); exit (0);
  1245 +#endif
  1246 +
  1247 +#if defined (hp300) && !defined (hpux)
  1248 + printf ("m68k-hp-bsd\n"); exit (0);
  1249 +#endif
  1250 +
  1251 +#if defined (NeXT)
  1252 +#if !defined (__ARCHITECTURE__)
  1253 +#define __ARCHITECTURE__ "m68k"
  1254 +#endif
  1255 + int version;
  1256 + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1257 + if (version < 4)
  1258 + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1259 + else
  1260 + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1261 + exit (0);
  1262 +#endif
  1263 +
  1264 +#if defined (MULTIMAX) || defined (n16)
  1265 +#if defined (UMAXV)
  1266 + printf ("ns32k-encore-sysv\n"); exit (0);
  1267 +#else
  1268 +#if defined (CMU)
  1269 + printf ("ns32k-encore-mach\n"); exit (0);
  1270 +#else
  1271 + printf ("ns32k-encore-bsd\n"); exit (0);
  1272 +#endif
  1273 +#endif
  1274 +#endif
  1275 +
  1276 +#if defined (__386BSD__)
  1277 + printf ("i386-pc-bsd\n"); exit (0);
  1278 +#endif
  1279 +
  1280 +#if defined (sequent)
  1281 +#if defined (i386)
  1282 + printf ("i386-sequent-dynix\n"); exit (0);
  1283 +#endif
  1284 +#if defined (ns32000)
  1285 + printf ("ns32k-sequent-dynix\n"); exit (0);
  1286 +#endif
  1287 +#endif
  1288 +
  1289 +#if defined (_SEQUENT_)
  1290 + struct utsname un;
  1291 +
  1292 + uname(&un);
  1293 +
  1294 + if (strncmp(un.version, "V2", 2) == 0) {
  1295 + printf ("i386-sequent-ptx2\n"); exit (0);
  1296 + }
  1297 + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1298 + printf ("i386-sequent-ptx1\n"); exit (0);
  1299 + }
  1300 + printf ("i386-sequent-ptx\n"); exit (0);
  1301 +
  1302 +#endif
  1303 +
  1304 +#if defined (vax)
  1305 +# if !defined (ultrix)
  1306 +# include <sys/param.h>
  1307 +# if defined (BSD)
  1308 +# if BSD == 43
  1309 + printf ("vax-dec-bsd4.3\n"); exit (0);
  1310 +# else
  1311 +# if BSD == 199006
  1312 + printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1313 +# else
  1314 + printf ("vax-dec-bsd\n"); exit (0);
  1315 +# endif
  1316 +# endif
  1317 +# else
  1318 + printf ("vax-dec-bsd\n"); exit (0);
  1319 +# endif
  1320 +# else
  1321 + printf ("vax-dec-ultrix\n"); exit (0);
  1322 +# endif
  1323 +#endif
  1324 +
  1325 +#if defined (alliant) && defined (i860)
  1326 + printf ("i860-alliant-bsd\n"); exit (0);
  1327 +#endif
  1328 +
  1329 + exit (1);
  1330 +}
  1331 +EOF
  1332 +
  1333 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
  1334 +
  1335 +# Apollos put the system type in the environment.
  1336 +
  1337 +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  1338 +
  1339 +# Convex versions that predate uname can use getsysinfo(1)
  1340 +
  1341 +if [ -x /usr/convex/getsysinfo ]
  1342 +then
  1343 + case `getsysinfo -f cpu_type` in
  1344 + c1*)
  1345 + echo c1-convex-bsd
  1346 + exit 0 ;;
  1347 + c2*)
  1348 + if getsysinfo -f scalar_acc
  1349 + then echo c32-convex-bsd
  1350 + else echo c2-convex-bsd
  1351 + fi
  1352 + exit 0 ;;
  1353 + c34*)
  1354 + echo c34-convex-bsd
  1355 + exit 0 ;;
  1356 + c38*)
  1357 + echo c38-convex-bsd
  1358 + exit 0 ;;
  1359 + c4*)
  1360 + echo c4-convex-bsd
  1361 + exit 0 ;;
  1362 + esac
  1363 +fi
  1364 +
  1365 +cat >&2 <<EOF
  1366 +$0: unable to guess system type
  1367 +
  1368 +This script, last modified $timestamp, has failed to recognize
  1369 +the operating system you are using. It is advised that you
  1370 +download the most up to date version of the config scripts from
  1371 +
  1372 + ftp://ftp.gnu.org/pub/gnu/config/
  1373 +
  1374 +If the version you run ($0) is already up to date, please
  1375 +send the following data and any information you think might be
  1376 +pertinent to <config-patches@gnu.org> in order to provide the needed
  1377 +information to handle your system.
  1378 +
  1379 +config.guess timestamp = $timestamp
  1380 +
  1381 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1382 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1383 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1384 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1385 +
  1386 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1387 +/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1388 +
  1389 +hostinfo = `(hostinfo) 2>/dev/null`
  1390 +/bin/universe = `(/bin/universe) 2>/dev/null`
  1391 +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1392 +/bin/arch = `(/bin/arch) 2>/dev/null`
  1393 +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1394 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1395 +
  1396 +UNAME_MACHINE = ${UNAME_MACHINE}
  1397 +UNAME_RELEASE = ${UNAME_RELEASE}
  1398 +UNAME_SYSTEM = ${UNAME_SYSTEM}
  1399 +UNAME_VERSION = ${UNAME_VERSION}
  1400 +EOF
  1401 +
  1402 +exit 1
  1403 +
  1404 +# Local variables:
  1405 +# eval: (add-hook 'write-file-hooks 'time-stamp)
  1406 +# time-stamp-start: "timestamp='"
  1407 +# time-stamp-format: "%:y-%02m-%02d"
  1408 +# time-stamp-end: "'"
  1409 +# End:
... ...
config.sub 0 → 100755
  1 +#! /bin/sh
  2 +# Configuration validation subroutine script.
  3 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
  4 +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
  5 +
  6 +timestamp='2003-01-03'
  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., 59 Temple Place - Suite 330,
  25 +# Boston, MA 02111-1307, 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 +# Please send patches to <config-patches@gnu.org>. Submit a context
  33 +# diff and a properly formatted ChangeLog entry.
  34 +#
  35 +# Configuration subroutine to validate and canonicalize a configuration type.
  36 +# Supply the specified configuration type as an argument.
  37 +# If it is invalid, we print an error message on stderr and exit with code 1.
  38 +# Otherwise, we print the canonical config type on stdout and succeed.
  39 +
  40 +# This file is supposed to be the same for all GNU packages
  41 +# and recognize all the CPU types, system types and aliases
  42 +# that are meaningful with *any* GNU software.
  43 +# Each package is responsible for reporting which valid configurations
  44 +# it does not support. The user should be able to distinguish
  45 +# a failure to support a valid configuration from a meaningless
  46 +# configuration.
  47 +
  48 +# The goal of this file is to map all the various variations of a given
  49 +# machine specification into a single specification in the form:
  50 +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  51 +# or in some cases, the newer four-part form:
  52 +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  53 +# It is wrong to echo any other type of specification.
  54 +
  55 +me=`echo "$0" | sed -e 's,.*/,,'`
  56 +
  57 +usage="\
  58 +Usage: $0 [OPTION] CPU-MFR-OPSYS
  59 + $0 [OPTION] ALIAS
  60 +
  61 +Canonicalize a configuration name.
  62 +
  63 +Operation modes:
  64 + -h, --help print this help, then exit
  65 + -t, --time-stamp print date of last modification, then exit
  66 + -v, --version print version number, then exit
  67 +
  68 +Report bugs and patches to <config-patches@gnu.org>."
  69 +
  70 +version="\
  71 +GNU config.sub ($timestamp)
  72 +
  73 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
  74 +Free Software Foundation, Inc.
  75 +
  76 +This is free software; see the source for copying conditions. There is NO
  77 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  78 +
  79 +help="
  80 +Try \`$me --help' for more information."
  81 +
  82 +# Parse command line
  83 +while test $# -gt 0 ; do
  84 + case $1 in
  85 + --time-stamp | --time* | -t )
  86 + echo "$timestamp" ; exit 0 ;;
  87 + --version | -v )
  88 + echo "$version" ; exit 0 ;;
  89 + --help | --h* | -h )
  90 + echo "$usage"; exit 0 ;;
  91 + -- ) # Stop option processing
  92 + shift; break ;;
  93 + - ) # Use stdin as input.
  94 + break ;;
  95 + -* )
  96 + echo "$me: invalid option $1$help"
  97 + exit 1 ;;
  98 +
  99 + *local*)
  100 + # First pass through any local machine types.
  101 + echo $1
  102 + exit 0;;
  103 +
  104 + * )
  105 + break ;;
  106 + esac
  107 +done
  108 +
  109 +case $# in
  110 + 0) echo "$me: missing argument$help" >&2
  111 + exit 1;;
  112 + 1) ;;
  113 + *) echo "$me: too many arguments$help" >&2
  114 + exit 1;;
  115 +esac
  116 +
  117 +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  118 +# Here we must recognize all the valid KERNEL-OS combinations.
  119 +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  120 +case $maybe_os in
  121 + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
  122 + os=-$maybe_os
  123 + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  124 + ;;
  125 + *)
  126 + basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  127 + if [ $basic_machine != $1 ]
  128 + then os=`echo $1 | sed 's/.*-/-/'`
  129 + else os=; fi
  130 + ;;
  131 +esac
  132 +
  133 +### Let's recognize common machines as not being operating systems so
  134 +### that things like config.sub decstation-3100 work. We also
  135 +### recognize some manufacturers as not being operating systems, so we
  136 +### can provide default operating systems below.
  137 +case $os in
  138 + -sun*os*)
  139 + # Prevent following clause from handling this invalid input.
  140 + ;;
  141 + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  142 + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  143 + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  144 + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  145 + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  146 + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  147 + -apple | -axis)
  148 + os=
  149 + basic_machine=$1
  150 + ;;
  151 + -sim | -cisco | -oki | -wec | -winbond)
  152 + os=
  153 + basic_machine=$1
  154 + ;;
  155 + -scout)
  156 + ;;
  157 + -wrs)
  158 + os=-vxworks
  159 + basic_machine=$1
  160 + ;;
  161 + -chorusos*)
  162 + os=-chorusos
  163 + basic_machine=$1
  164 + ;;
  165 + -chorusrdb)
  166 + os=-chorusrdb
  167 + basic_machine=$1
  168 + ;;
  169 + -hiux*)
  170 + os=-hiuxwe2
  171 + ;;
  172 + -sco5)
  173 + os=-sco3.2v5
  174 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  175 + ;;
  176 + -sco4)
  177 + os=-sco3.2v4
  178 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  179 + ;;
  180 + -sco3.2.[4-9]*)
  181 + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  182 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  183 + ;;
  184 + -sco3.2v[4-9]*)
  185 + # Don't forget version if it is 3.2v4 or newer.
  186 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  187 + ;;
  188 + -sco*)
  189 + os=-sco3.2v2
  190 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  191 + ;;
  192 + -udk*)
  193 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  194 + ;;
  195 + -isc)
  196 + os=-isc2.2
  197 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  198 + ;;
  199 + -clix*)
  200 + basic_machine=clipper-intergraph
  201 + ;;
  202 + -isc*)
  203 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  204 + ;;
  205 + -lynx*)
  206 + os=-lynxos
  207 + ;;
  208 + -ptx*)
  209 + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  210 + ;;
  211 + -windowsnt*)
  212 + os=`echo $os | sed -e 's/windowsnt/winnt/'`
  213 + ;;
  214 + -psos*)
  215 + os=-psos
  216 + ;;
  217 + -mint | -mint[0-9]*)
  218 + basic_machine=m68k-atari
  219 + os=-mint
  220 + ;;
  221 +esac
  222 +
  223 +# Decode aliases for certain CPU-COMPANY combinations.
  224 +case $basic_machine in
  225 + # Recognize the basic CPU types without company name.
  226 + # Some are omitted here because they have special meanings below.
  227 + 1750a | 580 \
  228 + | a29k \
  229 + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
  230 + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
  231 + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
  232 + | clipper \
  233 + | d10v | d30v | dlx | dsp16xx \
  234 + | fr30 | frv \
  235 + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
  236 + | i370 | i860 | i960 | ia64 \
  237 + | ip2k \
  238 + | m32r | m68000 | m68k | m88k | mcore \
  239 + | mips | mipsbe | mipseb | mipsel | mipsle \
  240 + | mips16 \
  241 + | mips64 | mips64el \
  242 + | mips64vr | mips64vrel \
  243 + | mips64orion | mips64orionel \
  244 + | mips64vr4100 | mips64vr4100el \
  245 + | mips64vr4300 | mips64vr4300el \
  246 + | mips64vr5000 | mips64vr5000el \
  247 + | mipsisa32 | mipsisa32el \
  248 + | mipsisa32r2 | mipsisa32r2el \
  249 + | mipsisa64 | mipsisa64el \
  250 + | mipsisa64sb1 | mipsisa64sb1el \
  251 + | mipsisa64sr71k | mipsisa64sr71kel \
  252 + | mipstx39 | mipstx39el \
  253 + | mn10200 | mn10300 \
  254 + | msp430 \
  255 + | ns16k | ns32k \
  256 + | openrisc | or32 \
  257 + | pdp10 | pdp11 | pj | pjl \
  258 + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
  259 + | pyramid \
  260 + | s390 | s390x \
  261 + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
  262 + | sh64 | sh64le \
  263 + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
  264 + | strongarm \
  265 + | tahoe | thumb | tic80 | tron \
  266 + | v850 | v850e \
  267 + | we32k \
  268 + | x86 | xscale | xstormy16 | xtensa \
  269 + | z8k)
  270 + basic_machine=$basic_machine-unknown
  271 + ;;
  272 + m6811 | m68hc11 | m6812 | m68hc12)
  273 + # Motorola 68HC11/12.
  274 + basic_machine=$basic_machine-unknown
  275 + os=-none
  276 + ;;
  277 + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
  278 + ;;
  279 +
  280 + # We use `pc' rather than `unknown'
  281 + # because (1) that's what they normally are, and
  282 + # (2) the word "unknown" tends to confuse beginning users.
  283 + i*86 | x86_64)
  284 + basic_machine=$basic_machine-pc
  285 + ;;
  286 + # Object if more than one company name word.
  287 + *-*-*)
  288 + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  289 + exit 1
  290 + ;;
  291 + # Recognize the basic CPU types with company name.
  292 + 580-* \
  293 + | a29k-* \
  294 + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
  295 + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
  296 + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
  297 + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
  298 + | avr-* \
  299 + | bs2000-* \
  300 + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
  301 + | clipper-* | cydra-* \
  302 + | d10v-* | d30v-* | dlx-* \
  303 + | elxsi-* \
  304 + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
  305 + | h8300-* | h8500-* \
  306 + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
  307 + | i*86-* | i860-* | i960-* | ia64-* \
  308 + | ip2k-* \
  309 + | m32r-* \
  310 + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
  311 + | m88110-* | m88k-* | mcore-* \
  312 + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
  313 + | mips16-* \
  314 + | mips64-* | mips64el-* \
  315 + | mips64vr-* | mips64vrel-* \
  316 + | mips64orion-* | mips64orionel-* \
  317 + | mips64vr4100-* | mips64vr4100el-* \
  318 + | mips64vr4300-* | mips64vr4300el-* \
  319 + | mips64vr5000-* | mips64vr5000el-* \
  320 + | mipsisa32-* | mipsisa32el-* \
  321 + | mipsisa32r2-* | mipsisa32r2el-* \
  322 + | mipsisa64-* | mipsisa64el-* \
  323 + | mipsisa64sb1-* | mipsisa64sb1el-* \
  324 + | mipsisa64sr71k-* | mipsisa64sr71kel-* \
  325 + | mipstx39-* | mipstx39el-* \
  326 + | msp430-* \
  327 + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
  328 + | orion-* \
  329 + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
  330 + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
  331 + | pyramid-* \
  332 + | romp-* | rs6000-* \
  333 + | s390-* | s390x-* \
  334 + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
  335 + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
  336 + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
  337 + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
  338 + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
  339 + | v850-* | v850e-* | vax-* \
  340 + | we32k-* \
  341 + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
  342 + | xtensa-* \
  343 + | ymp-* \
  344 + | z8k-*)
  345 + ;;
  346 + # Recognize the various machine names and aliases which stand
  347 + # for a CPU type and a company and sometimes even an OS.
  348 + 386bsd)
  349 + basic_machine=i386-unknown
  350 + os=-bsd
  351 + ;;
  352 + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  353 + basic_machine=m68000-att
  354 + ;;
  355 + 3b*)
  356 + basic_machine=we32k-att
  357 + ;;
  358 + a29khif)
  359 + basic_machine=a29k-amd
  360 + os=-udi
  361 + ;;
  362 + adobe68k)
  363 + basic_machine=m68010-adobe
  364 + os=-scout
  365 + ;;
  366 + alliant | fx80)
  367 + basic_machine=fx80-alliant
  368 + ;;
  369 + altos | altos3068)
  370 + basic_machine=m68k-altos
  371 + ;;
  372 + am29k)
  373 + basic_machine=a29k-none
  374 + os=-bsd
  375 + ;;
  376 + amdahl)
  377 + basic_machine=580-amdahl
  378 + os=-sysv
  379 + ;;
  380 + amiga | amiga-*)
  381 + basic_machine=m68k-unknown
  382 + ;;
  383 + amigaos | amigados)
  384 + basic_machine=m68k-unknown
  385 + os=-amigaos
  386 + ;;
  387 + amigaunix | amix)
  388 + basic_machine=m68k-unknown
  389 + os=-sysv4
  390 + ;;
  391 + apollo68)
  392 + basic_machine=m68k-apollo
  393 + os=-sysv
  394 + ;;
  395 + apollo68bsd)
  396 + basic_machine=m68k-apollo
  397 + os=-bsd
  398 + ;;
  399 + aux)
  400 + basic_machine=m68k-apple
  401 + os=-aux
  402 + ;;
  403 + balance)
  404 + basic_machine=ns32k-sequent
  405 + os=-dynix
  406 + ;;
  407 + c90)
  408 + basic_machine=c90-cray
  409 + os=-unicos
  410 + ;;
  411 + convex-c1)
  412 + basic_machine=c1-convex
  413 + os=-bsd
  414 + ;;
  415 + convex-c2)
  416 + basic_machine=c2-convex
  417 + os=-bsd
  418 + ;;
  419 + convex-c32)
  420 + basic_machine=c32-convex
  421 + os=-bsd
  422 + ;;
  423 + convex-c34)
  424 + basic_machine=c34-convex
  425 + os=-bsd
  426 + ;;
  427 + convex-c38)
  428 + basic_machine=c38-convex
  429 + os=-bsd
  430 + ;;
  431 + cray | j90)
  432 + basic_machine=j90-cray
  433 + os=-unicos
  434 + ;;
  435 + crds | unos)
  436 + basic_machine=m68k-crds
  437 + ;;
  438 + cris | cris-* | etrax*)
  439 + basic_machine=cris-axis
  440 + ;;
  441 + da30 | da30-*)
  442 + basic_machine=m68k-da30
  443 + ;;
  444 + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  445 + basic_machine=mips-dec
  446 + ;;
  447 + decsystem10* | dec10*)
  448 + basic_machine=pdp10-dec
  449 + os=-tops10
  450 + ;;
  451 + decsystem20* | dec20*)
  452 + basic_machine=pdp10-dec
  453 + os=-tops20
  454 + ;;
  455 + delta | 3300 | motorola-3300 | motorola-delta \
  456 + | 3300-motorola | delta-motorola)
  457 + basic_machine=m68k-motorola
  458 + ;;
  459 + delta88)
  460 + basic_machine=m88k-motorola
  461 + os=-sysv3
  462 + ;;
  463 + dpx20 | dpx20-*)
  464 + basic_machine=rs6000-bull
  465 + os=-bosx
  466 + ;;
  467 + dpx2* | dpx2*-bull)
  468 + basic_machine=m68k-bull
  469 + os=-sysv3
  470 + ;;
  471 + ebmon29k)
  472 + basic_machine=a29k-amd
  473 + os=-ebmon
  474 + ;;
  475 + elxsi)
  476 + basic_machine=elxsi-elxsi
  477 + os=-bsd
  478 + ;;
  479 + encore | umax | mmax)
  480 + basic_machine=ns32k-encore
  481 + ;;
  482 + es1800 | OSE68k | ose68k | ose | OSE)
  483 + basic_machine=m68k-ericsson
  484 + os=-ose
  485 + ;;
  486 + fx2800)
  487 + basic_machine=i860-alliant
  488 + ;;
  489 + genix)
  490 + basic_machine=ns32k-ns
  491 + ;;
  492 + gmicro)
  493 + basic_machine=tron-gmicro
  494 + os=-sysv
  495 + ;;
  496 + go32)
  497 + basic_machine=i386-pc
  498 + os=-go32
  499 + ;;
  500 + h3050r* | hiux*)
  501 + basic_machine=hppa1.1-hitachi
  502 + os=-hiuxwe2
  503 + ;;
  504 + h8300hms)
  505 + basic_machine=h8300-hitachi
  506 + os=-hms
  507 + ;;
  508 + h8300xray)
  509 + basic_machine=h8300-hitachi
  510 + os=-xray
  511 + ;;
  512 + h8500hms)
  513 + basic_machine=h8500-hitachi
  514 + os=-hms
  515 + ;;
  516 + harris)
  517 + basic_machine=m88k-harris
  518 + os=-sysv3
  519 + ;;
  520 + hp300-*)
  521 + basic_machine=m68k-hp
  522 + ;;
  523 + hp300bsd)
  524 + basic_machine=m68k-hp
  525 + os=-bsd
  526 + ;;
  527 + hp300hpux)
  528 + basic_machine=m68k-hp
  529 + os=-hpux
  530 + ;;
  531 + hp3k9[0-9][0-9] | hp9[0-9][0-9])
  532 + basic_machine=hppa1.0-hp
  533 + ;;
  534 + hp9k2[0-9][0-9] | hp9k31[0-9])
  535 + basic_machine=m68000-hp
  536 + ;;
  537 + hp9k3[2-9][0-9])
  538 + basic_machine=m68k-hp
  539 + ;;
  540 + hp9k6[0-9][0-9] | hp6[0-9][0-9])
  541 + basic_machine=hppa1.0-hp
  542 + ;;
  543 + hp9k7[0-79][0-9] | hp7[0-79][0-9])
  544 + basic_machine=hppa1.1-hp
  545 + ;;
  546 + hp9k78[0-9] | hp78[0-9])
  547 + # FIXME: really hppa2.0-hp
  548 + basic_machine=hppa1.1-hp
  549 + ;;
  550 + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  551 + # FIXME: really hppa2.0-hp
  552 + basic_machine=hppa1.1-hp
  553 + ;;
  554 + hp9k8[0-9][13679] | hp8[0-9][13679])
  555 + basic_machine=hppa1.1-hp
  556 + ;;
  557 + hp9k8[0-9][0-9] | hp8[0-9][0-9])
  558 + basic_machine=hppa1.0-hp
  559 + ;;
  560 + hppa-next)
  561 + os=-nextstep3
  562 + ;;
  563 + hppaosf)
  564 + basic_machine=hppa1.1-hp
  565 + os=-osf
  566 + ;;
  567 + hppro)
  568 + basic_machine=hppa1.1-hp
  569 + os=-proelf
  570 + ;;
  571 + i370-ibm* | ibm*)
  572 + basic_machine=i370-ibm
  573 + ;;
  574 +# I'm not sure what "Sysv32" means. Should this be sysv3.2?
  575 + i*86v32)
  576 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  577 + os=-sysv32
  578 + ;;
  579 + i*86v4*)
  580 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  581 + os=-sysv4
  582 + ;;
  583 + i*86v)
  584 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  585 + os=-sysv
  586 + ;;
  587 + i*86sol2)
  588 + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  589 + os=-solaris2
  590 + ;;
  591 + i386mach)
  592 + basic_machine=i386-mach
  593 + os=-mach
  594 + ;;
  595 + i386-vsta | vsta)
  596 + basic_machine=i386-unknown
  597 + os=-vsta
  598 + ;;
  599 + iris | iris4d)
  600 + basic_machine=mips-sgi
  601 + case $os in
  602 + -irix*)
  603 + ;;
  604 + *)
  605 + os=-irix4
  606 + ;;
  607 + esac
  608 + ;;
  609 + isi68 | isi)
  610 + basic_machine=m68k-isi
  611 + os=-sysv
  612 + ;;
  613 + m88k-omron*)
  614 + basic_machine=m88k-omron
  615 + ;;
  616 + magnum | m3230)
  617 + basic_machine=mips-mips
  618 + os=-sysv
  619 + ;;
  620 + merlin)
  621 + basic_machine=ns32k-utek
  622 + os=-sysv
  623 + ;;
  624 + mingw32)
  625 + basic_machine=i386-pc
  626 + os=-mingw32
  627 + ;;
  628 + miniframe)
  629 + basic_machine=m68000-convergent
  630 + ;;
  631 + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
  632 + basic_machine=m68k-atari
  633 + os=-mint
  634 + ;;
  635 + mips3*-*)
  636 + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  637 + ;;
  638 + mips3*)
  639 + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  640 + ;;
  641 + mmix*)
  642 + basic_machine=mmix-knuth
  643 + os=-mmixware
  644 + ;;
  645 + monitor)
  646 + basic_machine=m68k-rom68k
  647 + os=-coff
  648 + ;;
  649 + morphos)
  650 + basic_machine=powerpc-unknown
  651 + os=-morphos
  652 + ;;
  653 + msdos)
  654 + basic_machine=i386-pc
  655 + os=-msdos
  656 + ;;
  657 + mvs)
  658 + basic_machine=i370-ibm
  659 + os=-mvs
  660 + ;;
  661 + ncr3000)
  662 + basic_machine=i486-ncr
  663 + os=-sysv4
  664 + ;;
  665 + netbsd386)
  666 + basic_machine=i386-unknown
  667 + os=-netbsd
  668 + ;;
  669 + netwinder)
  670 + basic_machine=armv4l-rebel
  671 + os=-linux
  672 + ;;
  673 + news | news700 | news800 | news900)
  674 + basic_machine=m68k-sony
  675 + os=-newsos
  676 + ;;
  677 + news1000)
  678 + basic_machine=m68030-sony
  679 + os=-newsos
  680 + ;;
  681 + news-3600 | risc-news)
  682 + basic_machine=mips-sony
  683 + os=-newsos
  684 + ;;
  685 + necv70)
  686 + basic_machine=v70-nec
  687 + os=-sysv
  688 + ;;
  689 + next | m*-next )
  690 + basic_machine=m68k-next
  691 + case $os in
  692 + -nextstep* )
  693 + ;;
  694 + -ns2*)
  695 + os=-nextstep2
  696 + ;;
  697 + *)
  698 + os=-nextstep3
  699 + ;;
  700 + esac
  701 + ;;
  702 + nh3000)
  703 + basic_machine=m68k-harris
  704 + os=-cxux
  705 + ;;
  706 + nh[45]000)
  707 + basic_machine=m88k-harris
  708 + os=-cxux
  709 + ;;
  710 + nindy960)
  711 + basic_machine=i960-intel
  712 + os=-nindy
  713 + ;;
  714 + mon960)
  715 + basic_machine=i960-intel
  716 + os=-mon960
  717 + ;;
  718 + nonstopux)
  719 + basic_machine=mips-compaq
  720 + os=-nonstopux
  721 + ;;
  722 + np1)
  723 + basic_machine=np1-gould
  724 + ;;
  725 + nv1)
  726 + basic_machine=nv1-cray
  727 + os=-unicosmp
  728 + ;;
  729 + nsr-tandem)
  730 + basic_machine=nsr-tandem
  731 + ;;
  732 + op50n-* | op60c-*)
  733 + basic_machine=hppa1.1-oki
  734 + os=-proelf
  735 + ;;
  736 + or32 | or32-*)
  737 + basic_machine=or32-unknown
  738 + os=-coff
  739 + ;;
  740 + OSE68000 | ose68000)
  741 + basic_machine=m68000-ericsson
  742 + os=-ose
  743 + ;;
  744 + os68k)
  745 + basic_machine=m68k-none
  746 + os=-os68k
  747 + ;;
  748 + pa-hitachi)
  749 + basic_machine=hppa1.1-hitachi
  750 + os=-hiuxwe2
  751 + ;;
  752 + paragon)
  753 + basic_machine=i860-intel
  754 + os=-osf
  755 + ;;
  756 + pbd)
  757 + basic_machine=sparc-tti
  758 + ;;
  759 + pbb)
  760 + basic_machine=m68k-tti
  761 + ;;
  762 + pc532 | pc532-*)
  763 + basic_machine=ns32k-pc532
  764 + ;;
  765 + pentium | p5 | k5 | k6 | nexgen | viac3)
  766 + basic_machine=i586-pc
  767 + ;;
  768 + pentiumpro | p6 | 6x86 | athlon | athlon_*)
  769 + basic_machine=i686-pc
  770 + ;;
  771 + pentiumii | pentium2)
  772 + basic_machine=i686-pc
  773 + ;;
  774 + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
  775 + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  776 + ;;
  777 + pentiumpro-* | p6-* | 6x86-* | athlon-*)
  778 + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  779 + ;;
  780 + pentiumii-* | pentium2-*)
  781 + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  782 + ;;
  783 + pn)
  784 + basic_machine=pn-gould
  785 + ;;
  786 + power) basic_machine=power-ibm
  787 + ;;
  788 + ppc) basic_machine=powerpc-unknown
  789 + ;;
  790 + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  791 + ;;
  792 + ppcle | powerpclittle | ppc-le | powerpc-little)
  793 + basic_machine=powerpcle-unknown
  794 + ;;
  795 + ppcle-* | powerpclittle-*)
  796 + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  797 + ;;
  798 + ppc64) basic_machine=powerpc64-unknown
  799 + ;;
  800 + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
  801 + ;;
  802 + ppc64le | powerpc64little | ppc64-le | powerpc64-little)
  803 + basic_machine=powerpc64le-unknown
  804 + ;;
  805 + ppc64le-* | powerpc64little-*)
  806 + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
  807 + ;;
  808 + ps2)
  809 + basic_machine=i386-ibm
  810 + ;;
  811 + pw32)
  812 + basic_machine=i586-unknown
  813 + os=-pw32
  814 + ;;
  815 + rom68k)
  816 + basic_machine=m68k-rom68k
  817 + os=-coff
  818 + ;;
  819 + rm[46]00)
  820 + basic_machine=mips-siemens
  821 + ;;
  822 + rtpc | rtpc-*)
  823 + basic_machine=romp-ibm
  824 + ;;
  825 + sa29200)
  826 + basic_machine=a29k-amd
  827 + os=-udi
  828 + ;;
  829 + sb1)
  830 + basic_machine=mipsisa64sb1-unknown
  831 + ;;
  832 + sb1el)
  833 + basic_machine=mipsisa64sb1el-unknown
  834 + ;;
  835 + sequent)
  836 + basic_machine=i386-sequent
  837 + ;;
  838 + sh)
  839 + basic_machine=sh-hitachi
  840 + os=-hms
  841 + ;;
  842 + sparclite-wrs | simso-wrs)
  843 + basic_machine=sparclite-wrs
  844 + os=-vxworks
  845 + ;;
  846 + sps7)
  847 + basic_machine=m68k-bull
  848 + os=-sysv2
  849 + ;;
  850 + spur)
  851 + basic_machine=spur-unknown
  852 + ;;
  853 + st2000)
  854 + basic_machine=m68k-tandem
  855 + ;;
  856 + stratus)
  857 + basic_machine=i860-stratus
  858 + os=-sysv4
  859 + ;;
  860 + sun2)
  861 + basic_machine=m68000-sun
  862 + ;;
  863 + sun2os3)
  864 + basic_machine=m68000-sun
  865 + os=-sunos3
  866 + ;;
  867 + sun2os4)
  868 + basic_machine=m68000-sun
  869 + os=-sunos4
  870 + ;;
  871 + sun3os3)
  872 + basic_machine=m68k-sun
  873 + os=-sunos3
  874 + ;;
  875 + sun3os4)
  876 + basic_machine=m68k-sun
  877 + os=-sunos4
  878 + ;;
  879 + sun4os3)
  880 + basic_machine=sparc-sun
  881 + os=-sunos3
  882 + ;;
  883 + sun4os4)
  884 + basic_machine=sparc-sun
  885 + os=-sunos4
  886 + ;;
  887 + sun4sol2)
  888 + basic_machine=sparc-sun
  889 + os=-solaris2
  890 + ;;
  891 + sun3 | sun3-*)
  892 + basic_machine=m68k-sun
  893 + ;;
  894 + sun4)
  895 + basic_machine=sparc-sun
  896 + ;;
  897 + sun386 | sun386i | roadrunner)
  898 + basic_machine=i386-sun
  899 + ;;
  900 + sv1)
  901 + basic_machine=sv1-cray
  902 + os=-unicos
  903 + ;;
  904 + symmetry)
  905 + basic_machine=i386-sequent
  906 + os=-dynix
  907 + ;;
  908 + t3e)
  909 + basic_machine=alphaev5-cray
  910 + os=-unicos
  911 + ;;
  912 + t90)
  913 + basic_machine=t90-cray
  914 + os=-unicos
  915 + ;;
  916 + tic4x | c4x*)
  917 + basic_machine=tic4x-unknown
  918 + os=-coff
  919 + ;;
  920 + tic54x | c54x*)
  921 + basic_machine=tic54x-unknown
  922 + os=-coff
  923 + ;;
  924 + tx39)
  925 + basic_machine=mipstx39-unknown
  926 + ;;
  927 + tx39el)
  928 + basic_machine=mipstx39el-unknown
  929 + ;;
  930 + toad1)
  931 + basic_machine=pdp10-xkl
  932 + os=-tops20
  933 + ;;
  934 + tower | tower-32)
  935 + basic_machine=m68k-ncr
  936 + ;;
  937 + udi29k)
  938 + basic_machine=a29k-amd
  939 + os=-udi
  940 + ;;
  941 + ultra3)
  942 + basic_machine=a29k-nyu
  943 + os=-sym1
  944 + ;;
  945 + v810 | necv810)
  946 + basic_machine=v810-nec
  947 + os=-none
  948 + ;;
  949 + vaxv)
  950 + basic_machine=vax-dec
  951 + os=-sysv
  952 + ;;
  953 + vms)
  954 + basic_machine=vax-dec
  955 + os=-vms
  956 + ;;
  957 + vpp*|vx|vx-*)
  958 + basic_machine=f301-fujitsu
  959 + ;;
  960 + vxworks960)
  961 + basic_machine=i960-wrs
  962 + os=-vxworks
  963 + ;;
  964 + vxworks68)
  965 + basic_machine=m68k-wrs
  966 + os=-vxworks
  967 + ;;
  968 + vxworks29k)
  969 + basic_machine=a29k-wrs
  970 + os=-vxworks
  971 + ;;
  972 + w65*)
  973 + basic_machine=w65-wdc
  974 + os=-none
  975 + ;;
  976 + w89k-*)
  977 + basic_machine=hppa1.1-winbond
  978 + os=-proelf
  979 + ;;
  980 + xps | xps100)
  981 + basic_machine=xps100-honeywell
  982 + ;;
  983 + ymp)
  984 + basic_machine=ymp-cray
  985 + os=-unicos
  986 + ;;
  987 + z8k-*-coff)
  988 + basic_machine=z8k-unknown
  989 + os=-sim
  990 + ;;
  991 + none)
  992 + basic_machine=none-none
  993 + os=-none
  994 + ;;
  995 +
  996 +# Here we handle the default manufacturer of certain CPU types. It is in
  997 +# some cases the only manufacturer, in others, it is the most popular.
  998 + w89k)
  999 + basic_machine=hppa1.1-winbond
  1000 + ;;
  1001 + op50n)
  1002 + basic_machine=hppa1.1-oki
  1003 + ;;
  1004 + op60c)
  1005 + basic_machine=hppa1.1-oki
  1006 + ;;
  1007 + romp)
  1008 + basic_machine=romp-ibm
  1009 + ;;
  1010 + rs6000)
  1011 + basic_machine=rs6000-ibm
  1012 + ;;
  1013 + vax)
  1014 + basic_machine=vax-dec
  1015 + ;;
  1016 + pdp10)
  1017 + # there are many clones, so DEC is not a safe bet
  1018 + basic_machine=pdp10-unknown
  1019 + ;;
  1020 + pdp11)
  1021 + basic_machine=pdp11-dec
  1022 + ;;
  1023 + we32k)
  1024 + basic_machine=we32k-att
  1025 + ;;
  1026 + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
  1027 + basic_machine=sh-unknown
  1028 + ;;
  1029 + sh64)
  1030 + basic_machine=sh64-unknown
  1031 + ;;
  1032 + sparc | sparcv9 | sparcv9b)
  1033 + basic_machine=sparc-sun
  1034 + ;;
  1035 + cydra)
  1036 + basic_machine=cydra-cydrome
  1037 + ;;
  1038 + orion)
  1039 + basic_machine=orion-highlevel
  1040 + ;;
  1041 + orion105)
  1042 + basic_machine=clipper-highlevel
  1043 + ;;
  1044 + mac | mpw | mac-mpw)
  1045 + basic_machine=m68k-apple
  1046 + ;;
  1047 + pmac | pmac-mpw)
  1048 + basic_machine=powerpc-apple
  1049 + ;;
  1050 + *-unknown)
  1051 + # Make sure to match an already-canonicalized machine name.
  1052 + ;;
  1053 + *)
  1054 + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  1055 + exit 1
  1056 + ;;
  1057 +esac
  1058 +
  1059 +# Here we canonicalize certain aliases for manufacturers.
  1060 +case $basic_machine in
  1061 + *-digital*)
  1062 + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  1063 + ;;
  1064 + *-commodore*)
  1065 + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  1066 + ;;
  1067 + *)
  1068 + ;;
  1069 +esac
  1070 +
  1071 +# Decode manufacturer-specific aliases for certain operating systems.
  1072 +
  1073 +if [ x"$os" != x"" ]
  1074 +then
  1075 +case $os in
  1076 + # First match some system type aliases
  1077 + # that might get confused with valid system types.
  1078 + # -solaris* is a basic system type, with this one exception.
  1079 + -solaris1 | -solaris1.*)
  1080 + os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1081 + ;;
  1082 + -solaris)
  1083 + os=-solaris2
  1084 + ;;
  1085 + -svr4*)
  1086 + os=-sysv4
  1087 + ;;
  1088 + -unixware*)
  1089 + os=-sysv4.2uw
  1090 + ;;
  1091 + -gnu/linux*)
  1092 + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  1093 + ;;
  1094 + # First accept the basic system types.
  1095 + # The portable systems comes first.
  1096 + # Each alternative MUST END IN A *, to match a version number.
  1097 + # -sysv* is not here because it comes later, after sysvr4.
  1098 + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  1099 + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
  1100 + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  1101 + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  1102 + | -aos* \
  1103 + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  1104 + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  1105 + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
  1106 + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  1107 + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  1108 + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1109 + | -chorusos* | -chorusrdb* \
  1110 + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1111 + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
  1112 + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
  1113 + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  1114 + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  1115 + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  1116 + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
  1117 + | -powermax* | -dnix* | -microbsd*)
  1118 + # Remember, each alternative MUST END IN *, to match a version number.
  1119 + ;;
  1120 + -qnx*)
  1121 + case $basic_machine in
  1122 + x86-* | i*86-*)
  1123 + ;;
  1124 + *)
  1125 + os=-nto$os
  1126 + ;;
  1127 + esac
  1128 + ;;
  1129 + -nto-qnx*)
  1130 + ;;
  1131 + -nto*)
  1132 + os=`echo $os | sed -e 's|nto|nto-qnx|'`
  1133 + ;;
  1134 + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
  1135 + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
  1136 + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  1137 + ;;
  1138 + -mac*)
  1139 + os=`echo $os | sed -e 's|mac|macos|'`
  1140 + ;;
  1141 + -linux*)
  1142 + os=`echo $os | sed -e 's|linux|linux-gnu|'`
  1143 + ;;
  1144 + -sunos5*)
  1145 + os=`echo $os | sed -e 's|sunos5|solaris2|'`
  1146 + ;;
  1147 + -sunos6*)
  1148 + os=`echo $os | sed -e 's|sunos6|solaris3|'`
  1149 + ;;
  1150 + -opened*)
  1151 + os=-openedition
  1152 + ;;
  1153 + -wince*)
  1154 + os=-wince
  1155 + ;;
  1156 + -osfrose*)
  1157 + os=-osfrose
  1158 + ;;
  1159 + -osf*)
  1160 + os=-osf
  1161 + ;;
  1162 + -utek*)
  1163 + os=-bsd
  1164 + ;;
  1165 + -dynix*)
  1166 + os=-bsd
  1167 + ;;
  1168 + -acis*)
  1169 + os=-aos
  1170 + ;;
  1171 + -atheos*)
  1172 + os=-atheos
  1173 + ;;
  1174 + -386bsd)
  1175 + os=-bsd
  1176 + ;;
  1177 + -ctix* | -uts*)
  1178 + os=-sysv
  1179 + ;;
  1180 + -nova*)
  1181 + os=-rtmk-nova
  1182 + ;;
  1183 + -ns2 )
  1184 + os=-nextstep2
  1185 + ;;
  1186 + -nsk*)
  1187 + os=-nsk
  1188 + ;;
  1189 + # Preserve the version number of sinix5.
  1190 + -sinix5.*)
  1191 + os=`echo $os | sed -e 's|sinix|sysv|'`
  1192 + ;;
  1193 + -sinix*)
  1194 + os=-sysv4
  1195 + ;;
  1196 + -triton*)
  1197 + os=-sysv3
  1198 + ;;
  1199 + -oss*)
  1200 + os=-sysv3
  1201 + ;;
  1202 + -svr4)
  1203 + os=-sysv4
  1204 + ;;
  1205 + -svr3)
  1206 + os=-sysv3
  1207 + ;;
  1208 + -sysvr4)
  1209 + os=-sysv4
  1210 + ;;
  1211 + # This must come after -sysvr4.
  1212 + -sysv*)
  1213 + ;;
  1214 + -ose*)
  1215 + os=-ose
  1216 + ;;
  1217 + -es1800*)
  1218 + os=-ose
  1219 + ;;
  1220 + -xenix)
  1221 + os=-xenix
  1222 + ;;
  1223 + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1224 + os=-mint
  1225 + ;;
  1226 + -none)
  1227 + ;;
  1228 + *)
  1229 + # Get rid of the `-' at the beginning of $os.
  1230 + os=`echo $os | sed 's/[^-]*-//'`
  1231 + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1232 + exit 1
  1233 + ;;
  1234 +esac
  1235 +else
  1236 +
  1237 +# Here we handle the default operating systems that come with various machines.
  1238 +# The value should be what the vendor currently ships out the door with their
  1239 +# machine or put another way, the most popular os provided with the machine.
  1240 +
  1241 +# Note that if you're going to try to match "-MANUFACTURER" here (say,
  1242 +# "-sun"), then you have to tell the case statement up towards the top
  1243 +# that MANUFACTURER isn't an operating system. Otherwise, code above
  1244 +# will signal an error saying that MANUFACTURER isn't an operating
  1245 +# system, and we'll never get to this point.
  1246 +
  1247 +case $basic_machine in
  1248 + *-acorn)
  1249 + os=-riscix1.2
  1250 + ;;
  1251 + arm*-rebel)
  1252 + os=-linux
  1253 + ;;
  1254 + arm*-semi)
  1255 + os=-aout
  1256 + ;;
  1257 + # This must come before the *-dec entry.
  1258 + pdp10-*)
  1259 + os=-tops20
  1260 + ;;
  1261 + pdp11-*)
  1262 + os=-none
  1263 + ;;
  1264 + *-dec | vax-*)
  1265 + os=-ultrix4.2
  1266 + ;;
  1267 + m68*-apollo)
  1268 + os=-domain
  1269 + ;;
  1270 + i386-sun)
  1271 + os=-sunos4.0.2
  1272 + ;;
  1273 + m68000-sun)
  1274 + os=-sunos3
  1275 + # This also exists in the configure program, but was not the
  1276 + # default.
  1277 + # os=-sunos4
  1278 + ;;
  1279 + m68*-cisco)
  1280 + os=-aout
  1281 + ;;
  1282 + mips*-cisco)
  1283 + os=-elf
  1284 + ;;
  1285 + mips*-*)
  1286 + os=-elf
  1287 + ;;
  1288 + or32-*)
  1289 + os=-coff
  1290 + ;;
  1291 + *-tti) # must be before sparc entry or we get the wrong os.
  1292 + os=-sysv3
  1293 + ;;
  1294 + sparc-* | *-sun)
  1295 + os=-sunos4.1.1
  1296 + ;;
  1297 + *-be)
  1298 + os=-beos
  1299 + ;;
  1300 + *-ibm)
  1301 + os=-aix
  1302 + ;;
  1303 + *-wec)
  1304 + os=-proelf
  1305 + ;;
  1306 + *-winbond)
  1307 + os=-proelf
  1308 + ;;
  1309 + *-oki)
  1310 + os=-proelf
  1311 + ;;
  1312 + *-hp)
  1313 + os=-hpux
  1314 + ;;
  1315 + *-hitachi)
  1316 + os=-hiux
  1317 + ;;
  1318 + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1319 + os=-sysv
  1320 + ;;
  1321 + *-cbm)
  1322 + os=-amigaos
  1323 + ;;
  1324 + *-dg)
  1325 + os=-dgux
  1326 + ;;
  1327 + *-dolphin)
  1328 + os=-sysv3
  1329 + ;;
  1330 + m68k-ccur)
  1331 + os=-rtu
  1332 + ;;
  1333 + m88k-omron*)
  1334 + os=-luna
  1335 + ;;
  1336 + *-next )
  1337 + os=-nextstep
  1338 + ;;
  1339 + *-sequent)
  1340 + os=-ptx
  1341 + ;;
  1342 + *-crds)
  1343 + os=-unos
  1344 + ;;
  1345 + *-ns)
  1346 + os=-genix
  1347 + ;;
  1348 + i370-*)
  1349 + os=-mvs
  1350 + ;;
  1351 + *-next)
  1352 + os=-nextstep3
  1353 + ;;
  1354 + *-gould)
  1355 + os=-sysv
  1356 + ;;
  1357 + *-highlevel)
  1358 + os=-bsd
  1359 + ;;
  1360 + *-encore)
  1361 + os=-bsd
  1362 + ;;
  1363 + *-sgi)
  1364 + os=-irix
  1365 + ;;
  1366 + *-siemens)
  1367 + os=-sysv4
  1368 + ;;
  1369 + *-masscomp)
  1370 + os=-rtu
  1371 + ;;
  1372 + f30[01]-fujitsu | f700-fujitsu)
  1373 + os=-uxpv
  1374 + ;;
  1375 + *-rom68k)
  1376 + os=-coff
  1377 + ;;
  1378 + *-*bug)
  1379 + os=-coff
  1380 + ;;
  1381 + *-apple)
  1382 + os=-macos
  1383 + ;;
  1384 + *-atari*)
  1385 + os=-mint
  1386 + ;;
  1387 + *)
  1388 + os=-none
  1389 + ;;
  1390 +esac
  1391 +fi
  1392 +
  1393 +# Here we handle the case where we know the os, and the CPU type, but not the
  1394 +# manufacturer. We pick the logical manufacturer.
  1395 +vendor=unknown
  1396 +case $basic_machine in
  1397 + *-unknown)
  1398 + case $os in
  1399 + -riscix*)
  1400 + vendor=acorn
  1401 + ;;
  1402 + -sunos*)
  1403 + vendor=sun
  1404 + ;;
  1405 + -aix*)
  1406 + vendor=ibm
  1407 + ;;
  1408 + -beos*)
  1409 + vendor=be
  1410 + ;;
  1411 + -hpux*)
  1412 + vendor=hp
  1413 + ;;
  1414 + -mpeix*)
  1415 + vendor=hp
  1416 + ;;
  1417 + -hiux*)
  1418 + vendor=hitachi
  1419 + ;;
  1420 + -unos*)
  1421 + vendor=crds
  1422 + ;;
  1423 + -dgux*)
  1424 + vendor=dg
  1425 + ;;
  1426 + -luna*)
  1427 + vendor=omron
  1428 + ;;
  1429 + -genix*)
  1430 + vendor=ns
  1431 + ;;
  1432 + -mvs* | -opened*)
  1433 + vendor=ibm
  1434 + ;;
  1435 + -ptx*)
  1436 + vendor=sequent
  1437 + ;;
  1438 + -vxsim* | -vxworks* | -windiss*)
  1439 + vendor=wrs
  1440 + ;;
  1441 + -aux*)
  1442 + vendor=apple
  1443 + ;;
  1444 + -hms*)
  1445 + vendor=hitachi
  1446 + ;;
  1447 + -mpw* | -macos*)
  1448 + vendor=apple
  1449 + ;;
  1450 + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1451 + vendor=atari
  1452 + ;;
  1453 + -vos*)
  1454 + vendor=stratus
  1455 + ;;
  1456 + esac
  1457 + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  1458 + ;;
  1459 +esac
  1460 +
  1461 +echo $basic_machine$os
  1462 +exit 0
  1463 +
  1464 +# Local variables:
  1465 +# eval: (add-hook 'write-file-hooks 'time-stamp)
  1466 +# time-stamp-start: "timestamp='"
  1467 +# time-stamp-format: "%:y-%02m-%02d"
  1468 +# time-stamp-end: "'"
  1469 +# End:
... ...
install-sh 0 → 100755
  1 +#!/bin/sh
  2 +# install - install a program, script, or datafile
  3 +
  4 +scriptversion=2004-09-10.20
  5 +
  6 +# This originates from X11R5 (mit/util/scripts/install.sh), which was
  7 +# later released in X11R6 (xc/config/util/install.sh) with the
  8 +# following copyright and license.
  9 +#
  10 +# Copyright (C) 1994 X Consortium
  11 +#
  12 +# Permission is hereby granted, free of charge, to any person obtaining a copy
  13 +# of this software and associated documentation files (the "Software"), to
  14 +# deal in the Software without restriction, including without limitation the
  15 +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  16 +# sell copies of the Software, and to permit persons to whom the Software is
  17 +# furnished to do so, subject to the following conditions:
  18 +#
  19 +# The above copyright notice and this permission notice shall be included in
  20 +# all copies or substantial portions of the Software.
  21 +#
  22 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23 +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24 +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  25 +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  26 +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
  27 +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28 +#
  29 +# Except as contained in this notice, the name of the X Consortium shall not
  30 +# be used in advertising or otherwise to promote the sale, use or other deal-
  31 +# ings in this Software without prior written authorization from the X Consor-
  32 +# tium.
  33 +#
  34 +#
  35 +# FSF changes to this file are in the public domain.
  36 +#
  37 +# Calling this script install-sh is preferred over install.sh, to prevent
  38 +# `make' implicit rules from creating a file called install from it
  39 +# when there is no Makefile.
  40 +#
  41 +# This script is compatible with the BSD install script, but was written
  42 +# from scratch. It can only install one file at a time, a restriction
  43 +# shared with many OS's install programs.
  44 +
  45 +# set DOITPROG to echo to test this script
  46 +
  47 +# Don't use :- since 4.3BSD and earlier shells don't like it.
  48 +doit="${DOITPROG-}"
  49 +
  50 +# put in absolute paths if you don't have them in your path; or use env. vars.
  51 +
  52 +mvprog="${MVPROG-mv}"
  53 +cpprog="${CPPROG-cp}"
  54 +chmodprog="${CHMODPROG-chmod}"
  55 +chownprog="${CHOWNPROG-chown}"
  56 +chgrpprog="${CHGRPPROG-chgrp}"
  57 +stripprog="${STRIPPROG-strip}"
  58 +rmprog="${RMPROG-rm}"
  59 +mkdirprog="${MKDIRPROG-mkdir}"
  60 +
  61 +chmodcmd="$chmodprog 0755"
  62 +chowncmd=
  63 +chgrpcmd=
  64 +stripcmd=
  65 +rmcmd="$rmprog -f"
  66 +mvcmd="$mvprog"
  67 +src=
  68 +dst=
  69 +dir_arg=
  70 +dstarg=
  71 +no_target_directory=
  72 +
  73 +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
  74 + or: $0 [OPTION]... SRCFILES... DIRECTORY
  75 + or: $0 [OPTION]... -t DIRECTORY SRCFILES...
  76 + or: $0 [OPTION]... -d DIRECTORIES...
  77 +
  78 +In the 1st form, copy SRCFILE to DSTFILE.
  79 +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
  80 +In the 4th, create DIRECTORIES.
  81 +
  82 +Options:
  83 +-c (ignored)
  84 +-d create directories instead of installing files.
  85 +-g GROUP $chgrpprog installed files to GROUP.
  86 +-m MODE $chmodprog installed files to MODE.
  87 +-o USER $chownprog installed files to USER.
  88 +-s $stripprog installed files.
  89 +-t DIRECTORY install into DIRECTORY.
  90 +-T report an error if DSTFILE is a directory.
  91 +--help display this help and exit.
  92 +--version display version info and exit.
  93 +
  94 +Environment variables override the default commands:
  95 + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
  96 +"
  97 +
  98 +while test -n "$1"; do
  99 + case $1 in
  100 + -c) shift
  101 + continue;;
  102 +
  103 + -d) dir_arg=true
  104 + shift
  105 + continue;;
  106 +
  107 + -g) chgrpcmd="$chgrpprog $2"
  108 + shift
  109 + shift
  110 + continue;;
  111 +
  112 + --help) echo "$usage"; exit 0;;
  113 +
  114 + -m) chmodcmd="$chmodprog $2"
  115 + shift
  116 + shift
  117 + continue;;
  118 +
  119 + -o) chowncmd="$chownprog $2"
  120 + shift
  121 + shift
  122 + continue;;
  123 +
  124 + -s) stripcmd=$stripprog
  125 + shift
  126 + continue;;
  127 +
  128 + -t) dstarg=$2
  129 + shift
  130 + shift
  131 + continue;;
  132 +
  133 + -T) no_target_directory=true
  134 + shift
  135 + continue;;
  136 +
  137 + --version) echo "$0 $scriptversion"; exit 0;;
  138 +
  139 + *) # When -d is used, all remaining arguments are directories to create.
  140 + # When -t is used, the destination is already specified.
  141 + test -n "$dir_arg$dstarg" && break
  142 + # Otherwise, the last argument is the destination. Remove it from $@.
  143 + for arg
  144 + do
  145 + if test -n "$dstarg"; then
  146 + # $@ is not empty: it contains at least $arg.
  147 + set fnord "$@" "$dstarg"
  148 + shift # fnord
  149 + fi
  150 + shift # arg
  151 + dstarg=$arg
  152 + done
  153 + break;;
  154 + esac
  155 +done
  156 +
  157 +if test -z "$1"; then
  158 + if test -z "$dir_arg"; then
  159 + echo "$0: no input file specified." >&2
  160 + exit 1
  161 + fi
  162 + # It's OK to call `install-sh -d' without argument.
  163 + # This can happen when creating conditional directories.
  164 + exit 0
  165 +fi
  166 +
  167 +for src
  168 +do
  169 + # Protect names starting with `-'.
  170 + case $src in
  171 + -*) src=./$src ;;
  172 + esac
  173 +
  174 + if test -n "$dir_arg"; then
  175 + dst=$src
  176 + src=
  177 +
  178 + if test -d "$dst"; then
  179 + mkdircmd=:
  180 + chmodcmd=
  181 + else
  182 + mkdircmd=$mkdirprog
  183 + fi
  184 + else
  185 + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
  186 + # might cause directories to be created, which would be especially bad
  187 + # if $src (and thus $dsttmp) contains '*'.
  188 + if test ! -f "$src" && test ! -d "$src"; then
  189 + echo "$0: $src does not exist." >&2
  190 + exit 1
  191 + fi
  192 +
  193 + if test -z "$dstarg"; then
  194 + echo "$0: no destination specified." >&2
  195 + exit 1
  196 + fi
  197 +
  198 + dst=$dstarg
  199 + # Protect names starting with `-'.
  200 + case $dst in
  201 + -*) dst=./$dst ;;
  202 + esac
  203 +
  204 + # If destination is a directory, append the input filename; won't work
  205 + # if double slashes aren't ignored.
  206 + if test -d "$dst"; then
  207 + if test -n "$no_target_directory"; then
  208 + echo "$0: $dstarg: Is a directory" >&2
  209 + exit 1
  210 + fi
  211 + dst=$dst/`basename "$src"`
  212 + fi
  213 + fi
  214 +
  215 + # This sed command emulates the dirname command.
  216 + dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
  217 +
  218 + # Make sure that the destination directory exists.
  219 +
  220 + # Skip lots of stat calls in the usual case.
  221 + if test ! -d "$dstdir"; then
  222 + defaultIFS='
  223 + '
  224 + IFS="${IFS-$defaultIFS}"
  225 +
  226 + oIFS=$IFS
  227 + # Some sh's can't handle IFS=/ for some reason.
  228 + IFS='%'
  229 + set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
  230 + IFS=$oIFS
  231 +
  232 + pathcomp=
  233 +
  234 + while test $# -ne 0 ; do
  235 + pathcomp=$pathcomp$1
  236 + shift
  237 + if test ! -d "$pathcomp"; then
  238 + $mkdirprog "$pathcomp"
  239 + # mkdir can fail with a `File exist' error in case several
  240 + # install-sh are creating the directory concurrently. This
  241 + # is OK.
  242 + test -d "$pathcomp" || exit
  243 + fi
  244 + pathcomp=$pathcomp/
  245 + done
  246 + fi
  247 +
  248 + if test -n "$dir_arg"; then
  249 + $doit $mkdircmd "$dst" \
  250 + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
  251 + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
  252 + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
  253 + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
  254 +
  255 + else
  256 + dstfile=`basename "$dst"`
  257 +
  258 + # Make a couple of temp file names in the proper directory.
  259 + dsttmp=$dstdir/_inst.$$_
  260 + rmtmp=$dstdir/_rm.$$_
  261 +
  262 + # Trap to clean up those temp files at exit.
  263 + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
  264 + trap '(exit $?); exit' 1 2 13 15
  265 +
  266 + # Copy the file name to the temp name.
  267 + $doit $cpprog "$src" "$dsttmp" &&
  268 +
  269 + # and set any options; do chmod last to preserve setuid bits.
  270 + #
  271 + # If any of these fail, we abort the whole thing. If we want to
  272 + # ignore errors from any of these, just make sure not to ignore
  273 + # errors from the above "$doit $cpprog $src $dsttmp" command.
  274 + #
  275 + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
  276 + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
  277 + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
  278 + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
  279 +
  280 + # Now rename the file to the real destination.
  281 + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
  282 + || {
  283 + # The rename failed, perhaps because mv can't rename something else
  284 + # to itself, or perhaps because mv is so ancient that it does not
  285 + # support -f.
  286 +
  287 + # Now remove or move aside any old file at destination location.
  288 + # We try this two ways since rm can't unlink itself on some
  289 + # systems and the destination file might be busy for other
  290 + # reasons. In this case, the final cleanup might fail but the new
  291 + # file should still install successfully.
  292 + {
  293 + if test -f "$dstdir/$dstfile"; then
  294 + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
  295 + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
  296 + || {
  297 + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
  298 + (exit 1); exit
  299 + }
  300 + else
  301 + :
  302 + fi
  303 + } &&
  304 +
  305 + # Now rename the file to the real destination.
  306 + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
  307 + }
  308 + }
  309 + fi || { (exit 1); exit; }
  310 +done
  311 +
  312 +# The final little trick to "correctly" pass the exit status to the exit trap.
  313 +{
  314 + (exit 0); exit
  315 +}
  316 +
  317 +# Local variables:
  318 +# eval: (add-hook 'write-file-hooks 'time-stamp)
  319 +# time-stamp-start: "scriptversion="
  320 +# time-stamp-format: "%:y-%02m-%02d.%02H"
  321 +# time-stamp-end: "$"
  322 +# End:
... ...
ltmain.sh 0 → 100644
Changes suppressed. Click to show
  1 +# ltmain.sh - Provide generalized library-building support services.
  2 +# NOTE: Changing this file will not affect anything until you rerun configure.
  3 +#
  4 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
  5 +# Free Software Foundation, Inc.
  6 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7 +#
  8 +# This program is free software; you can redistribute it and/or modify
  9 +# it under the terms of the GNU General Public License as published by
  10 +# the Free Software Foundation; either version 2 of the License, or
  11 +# (at your option) any later version.
  12 +#
  13 +# This program is distributed in the hope that it will be useful, but
  14 +# WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16 +# General Public License for more details.
  17 +#
  18 +# You should have received a copy of the GNU General Public License
  19 +# along with this program; if not, write to the Free Software
  20 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21 +#
  22 +# As a special exception to the GNU General Public License, if you
  23 +# distribute this file as part of a program that contains a
  24 +# configuration script generated by Autoconf, you may include it under
  25 +# the same distribution terms that you use for the rest of that program.
  26 +
  27 +basename="s,^.*/,,g"
  28 +
  29 +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  30 +# is ksh but when the shell is invoked as "sh" and the current value of
  31 +# the _XPG environment variable is not equal to 1 (one), the special
  32 +# positional parameter $0, within a function call, is the name of the
  33 +# function.
  34 +progpath="$0"
  35 +
  36 +# RH: define SED for historic ltconfig's generated by Libtool 1.3
  37 +[ -z "$SED" ] && SED=sed
  38 +
  39 +# The name of this program:
  40 +progname=`echo "$progpath" | $SED $basename`
  41 +modename="$progname"
  42 +
  43 +# Global variables:
  44 +EXIT_SUCCESS=0
  45 +EXIT_FAILURE=1
  46 +
  47 +PROGRAM=ltmain.sh
  48 +PACKAGE=libtool
  49 +VERSION=1.5.6
  50 +TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
  51 +
  52 +
  53 +# Check that we have a working $echo.
  54 +if test "X$1" = X--no-reexec; then
  55 + # Discard the --no-reexec flag, and continue.
  56 + shift
  57 +elif test "X$1" = X--fallback-echo; then
  58 + # Avoid inline document here, it may be left over
  59 + :
  60 +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  61 + # Yippee, $echo works!
  62 + :
  63 +else
  64 + # Restart under the correct shell, and then maybe $echo will work.
  65 + exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  66 +fi
  67 +
  68 +if test "X$1" = X--fallback-echo; then
  69 + # used as fallback echo
  70 + shift
  71 + cat <<EOF
  72 +$*
  73 +EOF
  74 + exit $EXIT_SUCCESS
  75 +fi
  76 +
  77 +default_mode=
  78 +help="Try \`$progname --help' for more information."
  79 +magic="%%%MAGIC variable%%%"
  80 +mkdir="mkdir"
  81 +mv="mv -f"
  82 +rm="rm -f"
  83 +
  84 +# Sed substitution that helps us do robust quoting. It backslashifies
  85 +# metacharacters that are still active within double-quoted strings.
  86 +Xsed="${SED}"' -e 1s/^X//'
  87 +sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  88 +# test EBCDIC or ASCII
  89 +case `echo A|tr A '\301'` in
  90 + A) # EBCDIC based system
  91 + SP2NL="tr '\100' '\n'"
  92 + NL2SP="tr '\r\n' '\100\100'"
  93 + ;;
  94 + *) # Assume ASCII based system
  95 + SP2NL="tr '\040' '\012'"
  96 + NL2SP="tr '\015\012' '\040\040'"
  97 + ;;
  98 +esac
  99 +
  100 +# NLS nuisances.
  101 +# Only set LANG and LC_ALL to C if already set.
  102 +# These must not be set unconditionally because not all systems understand
  103 +# e.g. LANG=C (notably SCO).
  104 +# We save the old values to restore during execute mode.
  105 +if test "${LC_ALL+set}" = set; then
  106 + save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  107 +fi
  108 +if test "${LANG+set}" = set; then
  109 + save_LANG="$LANG"; LANG=C; export LANG
  110 +fi
  111 +
  112 +# Make sure IFS has a sensible default
  113 +: ${IFS="
  114 +"}
  115 +
  116 +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  117 + $echo "$modename: not configured to build any kind of library" 1>&2
  118 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  119 + exit $EXIT_FAILURE
  120 +fi
  121 +
  122 +# Global variables.
  123 +mode=$default_mode
  124 +nonopt=
  125 +prev=
  126 +prevopt=
  127 +run=
  128 +show="$echo"
  129 +show_help=
  130 +execute_dlfiles=
  131 +lo2o="s/\\.lo\$/.${objext}/"
  132 +o2lo="s/\\.${objext}\$/.lo/"
  133 +
  134 +#####################################
  135 +# Shell function definitions:
  136 +# This seems to be the best place for them
  137 +
  138 +# func_win32_libid arg
  139 +# return the library type of file 'arg'
  140 +#
  141 +# Need a lot of goo to handle *both* DLLs and import libs
  142 +# Has to be a shell function in order to 'eat' the argument
  143 +# that is supplied when $file_magic_command is called.
  144 +func_win32_libid () {
  145 + win32_libid_type="unknown"
  146 + win32_fileres=`file -L $1 2>/dev/null`
  147 + case $win32_fileres in
  148 + *ar\ archive\ import\ library*) # definitely import
  149 + win32_libid_type="x86 archive import"
  150 + ;;
  151 + *ar\ archive*) # could be an import, or static
  152 + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
  153 + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  154 + win32_nmres=`eval $NM -f posix -A $1 | \
  155 + sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
  156 + if test "X$win32_nmres" = "Ximport" ; then
  157 + win32_libid_type="x86 archive import"
  158 + else
  159 + win32_libid_type="x86 archive static"
  160 + fi
  161 + fi
  162 + ;;
  163 + *DLL*)
  164 + win32_libid_type="x86 DLL"
  165 + ;;
  166 + *executable*) # but shell scripts are "executable" too...
  167 + case $win32_fileres in
  168 + *MS\ Windows\ PE\ Intel*)
  169 + win32_libid_type="x86 DLL"
  170 + ;;
  171 + esac
  172 + ;;
  173 + esac
  174 + $echo $win32_libid_type
  175 +}
  176 +
  177 +
  178 +# func_infer_tag arg
  179 +# Infer tagged configuration to use if any are available and
  180 +# if one wasn't chosen via the "--tag" command line option.
  181 +# Only attempt this if the compiler in the base compile
  182 +# command doesn't match the default compiler.
  183 +# arg is usually of the form 'gcc ...'
  184 +func_infer_tag () {
  185 + if test -n "$available_tags" && test -z "$tagname"; then
  186 + CC_quoted=
  187 + for arg in $CC; do
  188 + case $arg in
  189 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  190 + arg="\"$arg\""
  191 + ;;
  192 + esac
  193 + CC_quoted="$CC_quoted $arg"
  194 + done
  195 + case $@ in
  196 + # Blanks in the command may have been stripped by the calling shell,
  197 + # but not from the CC environment variable when configure was run.
  198 + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
  199 + # Blanks at the start of $base_compile will cause this to fail
  200 + # if we don't check for them as well.
  201 + *)
  202 + for z in $available_tags; do
  203 + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  204 + # Evaluate the configuration.
  205 + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  206 + CC_quoted=
  207 + for arg in $CC; do
  208 + # Double-quote args containing other shell metacharacters.
  209 + case $arg in
  210 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  211 + arg="\"$arg\""
  212 + ;;
  213 + esac
  214 + CC_quoted="$CC_quoted $arg"
  215 + done
  216 + case "$@ " in
  217 + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
  218 + # The compiler in the base compile command matches
  219 + # the one in the tagged configuration.
  220 + # Assume this is the tagged configuration we want.
  221 + tagname=$z
  222 + break
  223 + ;;
  224 + esac
  225 + fi
  226 + done
  227 + # If $tagname still isn't set, then no tagged configuration
  228 + # was found and let the user know that the "--tag" command
  229 + # line option must be used.
  230 + if test -z "$tagname"; then
  231 + $echo "$modename: unable to infer tagged configuration"
  232 + $echo "$modename: specify a tag with \`--tag'" 1>&2
  233 + exit $EXIT_FAILURE
  234 +# else
  235 +# $echo "$modename: using $tagname tagged configuration"
  236 + fi
  237 + ;;
  238 + esac
  239 + fi
  240 +}
  241 +# End of Shell function definitions
  242 +#####################################
  243 +
  244 +# Darwin sucks
  245 +eval std_shrext=\"$shrext_cmds\"
  246 +
  247 +# Parse our command line options once, thoroughly.
  248 +while test "$#" -gt 0
  249 +do
  250 + arg="$1"
  251 + shift
  252 +
  253 + case $arg in
  254 + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  255 + *) optarg= ;;
  256 + esac
  257 +
  258 + # If the previous option needs an argument, assign it.
  259 + if test -n "$prev"; then
  260 + case $prev in
  261 + execute_dlfiles)
  262 + execute_dlfiles="$execute_dlfiles $arg"
  263 + ;;
  264 + tag)
  265 + tagname="$arg"
  266 + preserve_args="${preserve_args}=$arg"
  267 +
  268 + # Check whether tagname contains only valid characters
  269 + case $tagname in
  270 + *[!-_A-Za-z0-9,/]*)
  271 + $echo "$progname: invalid tag name: $tagname" 1>&2
  272 + exit $EXIT_FAILURE
  273 + ;;
  274 + esac
  275 +
  276 + case $tagname in
  277 + CC)
  278 + # Don't test for the "default" C tag, as we know, it's there, but
  279 + # not specially marked.
  280 + ;;
  281 + *)
  282 + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
  283 + taglist="$taglist $tagname"
  284 + # Evaluate the configuration.
  285 + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
  286 + else
  287 + $echo "$progname: ignoring unknown tag $tagname" 1>&2
  288 + fi
  289 + ;;
  290 + esac
  291 + ;;
  292 + *)
  293 + eval "$prev=\$arg"
  294 + ;;
  295 + esac
  296 +
  297 + prev=
  298 + prevopt=
  299 + continue
  300 + fi
  301 +
  302 + # Have we seen a non-optional argument yet?
  303 + case $arg in
  304 + --help)
  305 + show_help=yes
  306 + ;;
  307 +
  308 + --version)
  309 + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  310 + $echo
  311 + $echo "Copyright (C) 2003 Free Software Foundation, Inc."
  312 + $echo "This is free software; see the source for copying conditions. There is NO"
  313 + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  314 + exit $EXIT_SUCCESS
  315 + ;;
  316 +
  317 + --config)
  318 + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
  319 + # Now print the configurations for the tags.
  320 + for tagname in $taglist; do
  321 + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
  322 + done
  323 + exit $EXIT_SUCCESS
  324 + ;;
  325 +
  326 + --debug)
  327 + $echo "$progname: enabling shell trace mode"
  328 + set -x
  329 + preserve_args="$preserve_args $arg"
  330 + ;;
  331 +
  332 + --dry-run | -n)
  333 + run=:
  334 + ;;
  335 +
  336 + --features)
  337 + $echo "host: $host"
  338 + if test "$build_libtool_libs" = yes; then
  339 + $echo "enable shared libraries"
  340 + else
  341 + $echo "disable shared libraries"
  342 + fi
  343 + if test "$build_old_libs" = yes; then
  344 + $echo "enable static libraries"
  345 + else
  346 + $echo "disable static libraries"
  347 + fi
  348 + exit $EXIT_SUCCESS
  349 + ;;
  350 +
  351 + --finish) mode="finish" ;;
  352 +
  353 + --mode) prevopt="--mode" prev=mode ;;
  354 + --mode=*) mode="$optarg" ;;
  355 +
  356 + --preserve-dup-deps) duplicate_deps="yes" ;;
  357 +
  358 + --quiet | --silent)
  359 + show=:
  360 + preserve_args="$preserve_args $arg"
  361 + ;;
  362 +
  363 + --tag) prevopt="--tag" prev=tag ;;
  364 + --tag=*)
  365 + set tag "$optarg" ${1+"$@"}
  366 + shift
  367 + prev=tag
  368 + preserve_args="$preserve_args --tag"
  369 + ;;
  370 +
  371 + -dlopen)
  372 + prevopt="-dlopen"
  373 + prev=execute_dlfiles
  374 + ;;
  375 +
  376 + -*)
  377 + $echo "$modename: unrecognized option \`$arg'" 1>&2
  378 + $echo "$help" 1>&2
  379 + exit $EXIT_FAILURE
  380 + ;;
  381 +
  382 + *)
  383 + nonopt="$arg"
  384 + break
  385 + ;;
  386 + esac
  387 +done
  388 +
  389 +if test -n "$prevopt"; then
  390 + $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  391 + $echo "$help" 1>&2
  392 + exit $EXIT_FAILURE
  393 +fi
  394 +
  395 +# If this variable is set in any of the actions, the command in it
  396 +# will be execed at the end. This prevents here-documents from being
  397 +# left over by shells.
  398 +exec_cmd=
  399 +
  400 +if test -z "$show_help"; then
  401 +
  402 + # Infer the operation mode.
  403 + if test -z "$mode"; then
  404 + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
  405 + $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
  406 + case $nonopt in
  407 + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
  408 + mode=link
  409 + for arg
  410 + do
  411 + case $arg in
  412 + -c)
  413 + mode=compile
  414 + break
  415 + ;;
  416 + esac
  417 + done
  418 + ;;
  419 + *db | *dbx | *strace | *truss)
  420 + mode=execute
  421 + ;;
  422 + *install*|cp|mv)
  423 + mode=install
  424 + ;;
  425 + *rm)
  426 + mode=uninstall
  427 + ;;
  428 + *)
  429 + # If we have no mode, but dlfiles were specified, then do execute mode.
  430 + test -n "$execute_dlfiles" && mode=execute
  431 +
  432 + # Just use the default operation mode.
  433 + if test -z "$mode"; then
  434 + if test -n "$nonopt"; then
  435 + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  436 + else
  437 + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  438 + fi
  439 + fi
  440 + ;;
  441 + esac
  442 + fi
  443 +
  444 + # Only execute mode is allowed to have -dlopen flags.
  445 + if test -n "$execute_dlfiles" && test "$mode" != execute; then
  446 + $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  447 + $echo "$help" 1>&2
  448 + exit $EXIT_FAILURE
  449 + fi
  450 +
  451 + # Change the help message to a mode-specific one.
  452 + generic_help="$help"
  453 + help="Try \`$modename --help --mode=$mode' for more information."
  454 +
  455 + # These modes are in order of execution frequency so that they run quickly.
  456 + case $mode in
  457 + # libtool compile mode
  458 + compile)
  459 + modename="$modename: compile"
  460 + # Get the compilation command and the source file.
  461 + base_compile=
  462 + srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  463 + suppress_opt=yes
  464 + suppress_output=
  465 + arg_mode=normal
  466 + libobj=
  467 + later=
  468 +
  469 + for arg
  470 + do
  471 + case "$arg_mode" in
  472 + arg )
  473 + # do not "continue". Instead, add this to base_compile
  474 + lastarg="$arg"
  475 + arg_mode=normal
  476 + ;;
  477 +
  478 + target )
  479 + libobj="$arg"
  480 + arg_mode=normal
  481 + continue
  482 + ;;
  483 +
  484 + normal )
  485 + # Accept any command-line options.
  486 + case $arg in
  487 + -o)
  488 + if test -n "$libobj" ; then
  489 + $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  490 + exit $EXIT_FAILURE
  491 + fi
  492 + arg_mode=target
  493 + continue
  494 + ;;
  495 +
  496 + -static | -prefer-pic | -prefer-non-pic)
  497 + later="$later $arg"
  498 + continue
  499 + ;;
  500 +
  501 + -no-suppress)
  502 + suppress_opt=no
  503 + continue
  504 + ;;
  505 +
  506 + -Xcompiler)
  507 + arg_mode=arg # the next one goes into the "base_compile" arg list
  508 + continue # The current "srcfile" will either be retained or
  509 + ;; # replaced later. I would guess that would be a bug.
  510 +
  511 + -Wc,*)
  512 + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  513 + lastarg=
  514 + save_ifs="$IFS"; IFS=','
  515 + for arg in $args; do
  516 + IFS="$save_ifs"
  517 +
  518 + # Double-quote args containing other shell metacharacters.
  519 + # Many Bourne shells cannot handle close brackets correctly
  520 + # in scan sets, so we specify it separately.
  521 + case $arg in
  522 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  523 + arg="\"$arg\""
  524 + ;;
  525 + esac
  526 + lastarg="$lastarg $arg"
  527 + done
  528 + IFS="$save_ifs"
  529 + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  530 +
  531 + # Add the arguments to base_compile.
  532 + base_compile="$base_compile $lastarg"
  533 + continue
  534 + ;;
  535 +
  536 + * )
  537 + # Accept the current argument as the source file.
  538 + # The previous "srcfile" becomes the current argument.
  539 + #
  540 + lastarg="$srcfile"
  541 + srcfile="$arg"
  542 + ;;
  543 + esac # case $arg
  544 + ;;
  545 + esac # case $arg_mode
  546 +
  547 + # Aesthetically quote the previous argument.
  548 + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  549 +
  550 + case $lastarg in
  551 + # Double-quote args containing other shell metacharacters.
  552 + # Many Bourne shells cannot handle close brackets correctly
  553 + # in scan sets, so we specify it separately.
  554 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  555 + lastarg="\"$lastarg\""
  556 + ;;
  557 + esac
  558 +
  559 + base_compile="$base_compile $lastarg"
  560 + done # for arg
  561 +
  562 + case $arg_mode in
  563 + arg)
  564 + $echo "$modename: you must specify an argument for -Xcompile"
  565 + exit $EXIT_FAILURE
  566 + ;;
  567 + target)
  568 + $echo "$modename: you must specify a target with \`-o'" 1>&2
  569 + exit $EXIT_FAILURE
  570 + ;;
  571 + *)
  572 + # Get the name of the library object.
  573 + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  574 + ;;
  575 + esac
  576 +
  577 + # Recognize several different file suffixes.
  578 + # If the user specifies -o file.o, it is replaced with file.lo
  579 + xform='[cCFSifmso]'
  580 + case $libobj in
  581 + *.ada) xform=ada ;;
  582 + *.adb) xform=adb ;;
  583 + *.ads) xform=ads ;;
  584 + *.asm) xform=asm ;;
  585 + *.c++) xform=c++ ;;
  586 + *.cc) xform=cc ;;
  587 + *.ii) xform=ii ;;
  588 + *.class) xform=class ;;
  589 + *.cpp) xform=cpp ;;
  590 + *.cxx) xform=cxx ;;
  591 + *.f90) xform=f90 ;;
  592 + *.for) xform=for ;;
  593 + *.java) xform=java ;;
  594 + esac
  595 +
  596 + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  597 +
  598 + case $libobj in
  599 + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  600 + *)
  601 + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  602 + exit $EXIT_FAILURE
  603 + ;;
  604 + esac
  605 +
  606 + func_infer_tag $base_compile
  607 +
  608 + for arg in $later; do
  609 + case $arg in
  610 + -static)
  611 + build_old_libs=yes
  612 + continue
  613 + ;;
  614 +
  615 + -prefer-pic)
  616 + pic_mode=yes
  617 + continue
  618 + ;;
  619 +
  620 + -prefer-non-pic)
  621 + pic_mode=no
  622 + continue
  623 + ;;
  624 + esac
  625 + done
  626 +
  627 + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  628 + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  629 + if test "X$xdir" = "X$obj"; then
  630 + xdir=
  631 + else
  632 + xdir=$xdir/
  633 + fi
  634 + lobj=${xdir}$objdir/$objname
  635 +
  636 + if test -z "$base_compile"; then
  637 + $echo "$modename: you must specify a compilation command" 1>&2
  638 + $echo "$help" 1>&2
  639 + exit $EXIT_FAILURE
  640 + fi
  641 +
  642 + # Delete any leftover library objects.
  643 + if test "$build_old_libs" = yes; then
  644 + removelist="$obj $lobj $libobj ${libobj}T"
  645 + else
  646 + removelist="$lobj $libobj ${libobj}T"
  647 + fi
  648 +
  649 + $run $rm $removelist
  650 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  651 +
  652 + # On Cygwin there's no "real" PIC flag so we must build both object types
  653 + case $host_os in
  654 + cygwin* | mingw* | pw32* | os2*)
  655 + pic_mode=default
  656 + ;;
  657 + esac
  658 + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  659 + # non-PIC code in shared libraries is not supported
  660 + pic_mode=default
  661 + fi
  662 +
  663 + # Calculate the filename of the output object if compiler does
  664 + # not support -o with -c
  665 + if test "$compiler_c_o" = no; then
  666 + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  667 + lockfile="$output_obj.lock"
  668 + removelist="$removelist $output_obj $lockfile"
  669 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  670 + else
  671 + output_obj=
  672 + need_locks=no
  673 + lockfile=
  674 + fi
  675 +
  676 + # Lock this critical section if it is needed
  677 + # We use this script file to make the link, it avoids creating a new file
  678 + if test "$need_locks" = yes; then
  679 + until $run ln "$progpath" "$lockfile" 2>/dev/null; do
  680 + $show "Waiting for $lockfile to be removed"
  681 + sleep 2
  682 + done
  683 + elif test "$need_locks" = warn; then
  684 + if test -f "$lockfile"; then
  685 + $echo "\
  686 +*** ERROR, $lockfile exists and contains:
  687 +`cat $lockfile 2>/dev/null`
  688 +
  689 +This indicates that another process is trying to use the same
  690 +temporary object file, and libtool could not work around it because
  691 +your compiler does not support \`-c' and \`-o' together. If you
  692 +repeat this compilation, it may succeed, by chance, but you had better
  693 +avoid parallel builds (make -j) in this platform, or get a better
  694 +compiler."
  695 +
  696 + $run $rm $removelist
  697 + exit $EXIT_FAILURE
  698 + fi
  699 + $echo $srcfile > "$lockfile"
  700 + fi
  701 +
  702 + if test -n "$fix_srcfile_path"; then
  703 + eval srcfile=\"$fix_srcfile_path\"
  704 + fi
  705 +
  706 + $run $rm "$libobj" "${libobj}T"
  707 +
  708 + # Create a libtool object file (analogous to a ".la" file),
  709 + # but don't create it if we're doing a dry run.
  710 + test -z "$run" && cat > ${libobj}T <<EOF
  711 +# $libobj - a libtool object file
  712 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  713 +#
  714 +# Please DO NOT delete this file!
  715 +# It is necessary for linking the library.
  716 +
  717 +# Name of the PIC object.
  718 +EOF
  719 +
  720 + # Only build a PIC object if we are building libtool libraries.
  721 + if test "$build_libtool_libs" = yes; then
  722 + # Without this assignment, base_compile gets emptied.
  723 + fbsd_hideous_sh_bug=$base_compile
  724 +
  725 + if test "$pic_mode" != no; then
  726 + command="$base_compile $srcfile $pic_flag"
  727 + else
  728 + # Don't build PIC code
  729 + command="$base_compile $srcfile"
  730 + fi
  731 +
  732 + if test ! -d "${xdir}$objdir"; then
  733 + $show "$mkdir ${xdir}$objdir"
  734 + $run $mkdir ${xdir}$objdir
  735 + status=$?
  736 + if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
  737 + exit $status
  738 + fi
  739 + fi
  740 +
  741 + if test -z "$output_obj"; then
  742 + # Place PIC objects in $objdir
  743 + command="$command -o $lobj"
  744 + fi
  745 +
  746 + $run $rm "$lobj" "$output_obj"
  747 +
  748 + $show "$command"
  749 + if $run eval "$command"; then :
  750 + else
  751 + test -n "$output_obj" && $run $rm $removelist
  752 + exit $EXIT_FAILURE
  753 + fi
  754 +
  755 + if test "$need_locks" = warn &&
  756 + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  757 + $echo "\
  758 +*** ERROR, $lockfile contains:
  759 +`cat $lockfile 2>/dev/null`
  760 +
  761 +but it should contain:
  762 +$srcfile
  763 +
  764 +This indicates that another process is trying to use the same
  765 +temporary object file, and libtool could not work around it because
  766 +your compiler does not support \`-c' and \`-o' together. If you
  767 +repeat this compilation, it may succeed, by chance, but you had better
  768 +avoid parallel builds (make -j) in this platform, or get a better
  769 +compiler."
  770 +
  771 + $run $rm $removelist
  772 + exit $EXIT_FAILURE
  773 + fi
  774 +
  775 + # Just move the object if needed, then go on to compile the next one
  776 + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  777 + $show "$mv $output_obj $lobj"
  778 + if $run $mv $output_obj $lobj; then :
  779 + else
  780 + error=$?
  781 + $run $rm $removelist
  782 + exit $error
  783 + fi
  784 + fi
  785 +
  786 + # Append the name of the PIC object to the libtool object file.
  787 + test -z "$run" && cat >> ${libobj}T <<EOF
  788 +pic_object='$objdir/$objname'
  789 +
  790 +EOF
  791 +
  792 + # Allow error messages only from the first compilation.
  793 + if test "$suppress_opt" = yes; then
  794 + suppress_output=' >/dev/null 2>&1'
  795 + fi
  796 + else
  797 + # No PIC object so indicate it doesn't exist in the libtool
  798 + # object file.
  799 + test -z "$run" && cat >> ${libobj}T <<EOF
  800 +pic_object=none
  801 +
  802 +EOF
  803 + fi
  804 +
  805 + # Only build a position-dependent object if we build old libraries.
  806 + if test "$build_old_libs" = yes; then
  807 + if test "$pic_mode" != yes; then
  808 + # Don't build PIC code
  809 + command="$base_compile $srcfile"
  810 + else
  811 + command="$base_compile $srcfile $pic_flag"
  812 + fi
  813 + if test "$compiler_c_o" = yes; then
  814 + command="$command -o $obj"
  815 + fi
  816 +
  817 + # Suppress compiler output if we already did a PIC compilation.
  818 + command="$command$suppress_output"
  819 + $run $rm "$obj" "$output_obj"
  820 + $show "$command"
  821 + if $run eval "$command"; then :
  822 + else
  823 + $run $rm $removelist
  824 + exit $EXIT_FAILURE
  825 + fi
  826 +
  827 + if test "$need_locks" = warn &&
  828 + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  829 + $echo "\
  830 +*** ERROR, $lockfile contains:
  831 +`cat $lockfile 2>/dev/null`
  832 +
  833 +but it should contain:
  834 +$srcfile
  835 +
  836 +This indicates that another process is trying to use the same
  837 +temporary object file, and libtool could not work around it because
  838 +your compiler does not support \`-c' and \`-o' together. If you
  839 +repeat this compilation, it may succeed, by chance, but you had better
  840 +avoid parallel builds (make -j) in this platform, or get a better
  841 +compiler."
  842 +
  843 + $run $rm $removelist
  844 + exit $EXIT_FAILURE
  845 + fi
  846 +
  847 + # Just move the object if needed
  848 + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  849 + $show "$mv $output_obj $obj"
  850 + if $run $mv $output_obj $obj; then :
  851 + else
  852 + error=$?
  853 + $run $rm $removelist
  854 + exit $error
  855 + fi
  856 + fi
  857 +
  858 + # Append the name of the non-PIC object the libtool object file.
  859 + # Only append if the libtool object file exists.
  860 + test -z "$run" && cat >> ${libobj}T <<EOF
  861 +# Name of the non-PIC object.
  862 +non_pic_object='$objname'
  863 +
  864 +EOF
  865 + else
  866 + # Append the name of the non-PIC object the libtool object file.
  867 + # Only append if the libtool object file exists.
  868 + test -z "$run" && cat >> ${libobj}T <<EOF
  869 +# Name of the non-PIC object.
  870 +non_pic_object=none
  871 +
  872 +EOF
  873 + fi
  874 +
  875 + $run $mv "${libobj}T" "${libobj}"
  876 +
  877 + # Unlock the critical section if it was locked
  878 + if test "$need_locks" != no; then
  879 + $run $rm "$lockfile"
  880 + fi
  881 +
  882 + exit $EXIT_SUCCESS
  883 + ;;
  884 +
  885 + # libtool link mode
  886 + link | relink)
  887 + modename="$modename: link"
  888 + case $host in
  889 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  890 + # It is impossible to link a dll without this setting, and
  891 + # we shouldn't force the makefile maintainer to figure out
  892 + # which system we are compiling for in order to pass an extra
  893 + # flag for every libtool invocation.
  894 + # allow_undefined=no
  895 +
  896 + # FIXME: Unfortunately, there are problems with the above when trying
  897 + # to make a dll which has undefined symbols, in which case not
  898 + # even a static library is built. For now, we need to specify
  899 + # -no-undefined on the libtool link line when we can be certain
  900 + # that all symbols are satisfied, otherwise we get a static library.
  901 + allow_undefined=yes
  902 + ;;
  903 + *)
  904 + allow_undefined=yes
  905 + ;;
  906 + esac
  907 + libtool_args="$nonopt"
  908 + base_compile="$nonopt $@"
  909 + compile_command="$nonopt"
  910 + finalize_command="$nonopt"
  911 +
  912 + compile_rpath=
  913 + finalize_rpath=
  914 + compile_shlibpath=
  915 + finalize_shlibpath=
  916 + convenience=
  917 + old_convenience=
  918 + deplibs=
  919 + old_deplibs=
  920 + compiler_flags=
  921 + linker_flags=
  922 + dllsearchpath=
  923 + lib_search_path=`pwd`
  924 + inst_prefix_dir=
  925 +
  926 + avoid_version=no
  927 + dlfiles=
  928 + dlprefiles=
  929 + dlself=no
  930 + export_dynamic=no
  931 + export_symbols=
  932 + export_symbols_regex=
  933 + generated=
  934 + libobjs=
  935 + ltlibs=
  936 + module=no
  937 + no_install=no
  938 + objs=
  939 + non_pic_objects=
  940 + precious_files_regex=
  941 + prefer_static_libs=no
  942 + preload=no
  943 + prev=
  944 + prevarg=
  945 + release=
  946 + rpath=
  947 + xrpath=
  948 + perm_rpath=
  949 + temp_rpath=
  950 + thread_safe=no
  951 + vinfo=
  952 + vinfo_number=no
  953 +
  954 + func_infer_tag $base_compile
  955 +
  956 + # We need to know -static, to get the right output filenames.
  957 + for arg
  958 + do
  959 + case $arg in
  960 + -all-static | -static)
  961 + if test "X$arg" = "X-all-static"; then
  962 + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  963 + $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  964 + fi
  965 + if test -n "$link_static_flag"; then
  966 + dlopen_self=$dlopen_self_static
  967 + fi
  968 + else
  969 + if test -z "$pic_flag" && test -n "$link_static_flag"; then
  970 + dlopen_self=$dlopen_self_static
  971 + fi
  972 + fi
  973 + build_libtool_libs=no
  974 + build_old_libs=yes
  975 + prefer_static_libs=yes
  976 + break
  977 + ;;
  978 + esac
  979 + done
  980 +
  981 + # See if our shared archives depend on static archives.
  982 + test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  983 +
  984 + # Go through the arguments, transforming them on the way.
  985 + while test "$#" -gt 0; do
  986 + arg="$1"
  987 + shift
  988 + case $arg in
  989 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  990 + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  991 + ;;
  992 + *) qarg=$arg ;;
  993 + esac
  994 + libtool_args="$libtool_args $qarg"
  995 +
  996 + # If the previous option needs an argument, assign it.
  997 + if test -n "$prev"; then
  998 + case $prev in
  999 + output)
  1000 + compile_command="$compile_command @OUTPUT@"
  1001 + finalize_command="$finalize_command @OUTPUT@"
  1002 + ;;
  1003 + esac
  1004 +
  1005 + case $prev in
  1006 + dlfiles|dlprefiles)
  1007 + if test "$preload" = no; then
  1008 + # Add the symbol object into the linking commands.
  1009 + compile_command="$compile_command @SYMFILE@"
  1010 + finalize_command="$finalize_command @SYMFILE@"
  1011 + preload=yes
  1012 + fi
  1013 + case $arg in
  1014 + *.la | *.lo) ;; # We handle these cases below.
  1015 + force)
  1016 + if test "$dlself" = no; then
  1017 + dlself=needless
  1018 + export_dynamic=yes
  1019 + fi
  1020 + prev=
  1021 + continue
  1022 + ;;
  1023 + self)
  1024 + if test "$prev" = dlprefiles; then
  1025 + dlself=yes
  1026 + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1027 + dlself=yes
  1028 + else
  1029 + dlself=needless
  1030 + export_dynamic=yes
  1031 + fi
  1032 + prev=
  1033 + continue
  1034 + ;;
  1035 + *)
  1036 + if test "$prev" = dlfiles; then
  1037 + dlfiles="$dlfiles $arg"
  1038 + else
  1039 + dlprefiles="$dlprefiles $arg"
  1040 + fi
  1041 + prev=
  1042 + continue
  1043 + ;;
  1044 + esac
  1045 + ;;
  1046 + expsyms)
  1047 + export_symbols="$arg"
  1048 + if test ! -f "$arg"; then
  1049 + $echo "$modename: symbol file \`$arg' does not exist"
  1050 + exit $EXIT_FAILURE
  1051 + fi
  1052 + prev=
  1053 + continue
  1054 + ;;
  1055 + expsyms_regex)
  1056 + export_symbols_regex="$arg"
  1057 + prev=
  1058 + continue
  1059 + ;;
  1060 + inst_prefix)
  1061 + inst_prefix_dir="$arg"
  1062 + prev=
  1063 + continue
  1064 + ;;
  1065 + precious_regex)
  1066 + precious_files_regex="$arg"
  1067 + prev=
  1068 + continue
  1069 + ;;
  1070 + release)
  1071 + release="-$arg"
  1072 + prev=
  1073 + continue
  1074 + ;;
  1075 + objectlist)
  1076 + if test -f "$arg"; then
  1077 + save_arg=$arg
  1078 + moreargs=
  1079 + for fil in `cat $save_arg`
  1080 + do
  1081 +# moreargs="$moreargs $fil"
  1082 + arg=$fil
  1083 + # A libtool-controlled object.
  1084 +
  1085 + # Check to see that this really is a libtool object.
  1086 + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1087 + pic_object=
  1088 + non_pic_object=
  1089 +
  1090 + # Read the .lo file
  1091 + # If there is no directory component, then add one.
  1092 + case $arg in
  1093 + */* | *\\*) . $arg ;;
  1094 + *) . ./$arg ;;
  1095 + esac
  1096 +
  1097 + if test -z "$pic_object" || \
  1098 + test -z "$non_pic_object" ||
  1099 + test "$pic_object" = none && \
  1100 + test "$non_pic_object" = none; then
  1101 + $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1102 + exit $EXIT_FAILURE
  1103 + fi
  1104 +
  1105 + # Extract subdirectory from the argument.
  1106 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1107 + if test "X$xdir" = "X$arg"; then
  1108 + xdir=
  1109 + else
  1110 + xdir="$xdir/"
  1111 + fi
  1112 +
  1113 + if test "$pic_object" != none; then
  1114 + # Prepend the subdirectory the object is found in.
  1115 + pic_object="$xdir$pic_object"
  1116 +
  1117 + if test "$prev" = dlfiles; then
  1118 + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1119 + dlfiles="$dlfiles $pic_object"
  1120 + prev=
  1121 + continue
  1122 + else
  1123 + # If libtool objects are unsupported, then we need to preload.
  1124 + prev=dlprefiles
  1125 + fi
  1126 + fi
  1127 +
  1128 + # CHECK ME: I think I busted this. -Ossama
  1129 + if test "$prev" = dlprefiles; then
  1130 + # Preload the old-style object.
  1131 + dlprefiles="$dlprefiles $pic_object"
  1132 + prev=
  1133 + fi
  1134 +
  1135 + # A PIC object.
  1136 + libobjs="$libobjs $pic_object"
  1137 + arg="$pic_object"
  1138 + fi
  1139 +
  1140 + # Non-PIC object.
  1141 + if test "$non_pic_object" != none; then
  1142 + # Prepend the subdirectory the object is found in.
  1143 + non_pic_object="$xdir$non_pic_object"
  1144 +
  1145 + # A standard non-PIC object
  1146 + non_pic_objects="$non_pic_objects $non_pic_object"
  1147 + if test -z "$pic_object" || test "$pic_object" = none ; then
  1148 + arg="$non_pic_object"
  1149 + fi
  1150 + fi
  1151 + else
  1152 + # Only an error if not doing a dry-run.
  1153 + if test -z "$run"; then
  1154 + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1155 + exit $EXIT_FAILURE
  1156 + else
  1157 + # Dry-run case.
  1158 +
  1159 + # Extract subdirectory from the argument.
  1160 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1161 + if test "X$xdir" = "X$arg"; then
  1162 + xdir=
  1163 + else
  1164 + xdir="$xdir/"
  1165 + fi
  1166 +
  1167 + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1168 + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1169 + libobjs="$libobjs $pic_object"
  1170 + non_pic_objects="$non_pic_objects $non_pic_object"
  1171 + fi
  1172 + fi
  1173 + done
  1174 + else
  1175 + $echo "$modename: link input file \`$save_arg' does not exist"
  1176 + exit $EXIT_FAILURE
  1177 + fi
  1178 + arg=$save_arg
  1179 + prev=
  1180 + continue
  1181 + ;;
  1182 + rpath | xrpath)
  1183 + # We need an absolute path.
  1184 + case $arg in
  1185 + [\\/]* | [A-Za-z]:[\\/]*) ;;
  1186 + *)
  1187 + $echo "$modename: only absolute run-paths are allowed" 1>&2
  1188 + exit $EXIT_FAILURE
  1189 + ;;
  1190 + esac
  1191 + if test "$prev" = rpath; then
  1192 + case "$rpath " in
  1193 + *" $arg "*) ;;
  1194 + *) rpath="$rpath $arg" ;;
  1195 + esac
  1196 + else
  1197 + case "$xrpath " in
  1198 + *" $arg "*) ;;
  1199 + *) xrpath="$xrpath $arg" ;;
  1200 + esac
  1201 + fi
  1202 + prev=
  1203 + continue
  1204 + ;;
  1205 + xcompiler)
  1206 + compiler_flags="$compiler_flags $qarg"
  1207 + prev=
  1208 + compile_command="$compile_command $qarg"
  1209 + finalize_command="$finalize_command $qarg"
  1210 + continue
  1211 + ;;
  1212 + xlinker)
  1213 + linker_flags="$linker_flags $qarg"
  1214 + compiler_flags="$compiler_flags $wl$qarg"
  1215 + prev=
  1216 + compile_command="$compile_command $wl$qarg"
  1217 + finalize_command="$finalize_command $wl$qarg"
  1218 + continue
  1219 + ;;
  1220 + xcclinker)
  1221 + linker_flags="$linker_flags $qarg"
  1222 + compiler_flags="$compiler_flags $qarg"
  1223 + prev=
  1224 + compile_command="$compile_command $qarg"
  1225 + finalize_command="$finalize_command $qarg"
  1226 + continue
  1227 + ;;
  1228 + shrext)
  1229 + shrext_cmds="$arg"
  1230 + prev=
  1231 + continue
  1232 + ;;
  1233 + *)
  1234 + eval "$prev=\"\$arg\""
  1235 + prev=
  1236 + continue
  1237 + ;;
  1238 + esac
  1239 + fi # test -n "$prev"
  1240 +
  1241 + prevarg="$arg"
  1242 +
  1243 + case $arg in
  1244 + -all-static)
  1245 + if test -n "$link_static_flag"; then
  1246 + compile_command="$compile_command $link_static_flag"
  1247 + finalize_command="$finalize_command $link_static_flag"
  1248 + fi
  1249 + continue
  1250 + ;;
  1251 +
  1252 + -allow-undefined)
  1253 + # FIXME: remove this flag sometime in the future.
  1254 + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1255 + continue
  1256 + ;;
  1257 +
  1258 + -avoid-version)
  1259 + avoid_version=yes
  1260 + continue
  1261 + ;;
  1262 +
  1263 + -dlopen)
  1264 + prev=dlfiles
  1265 + continue
  1266 + ;;
  1267 +
  1268 + -dlpreopen)
  1269 + prev=dlprefiles
  1270 + continue
  1271 + ;;
  1272 +
  1273 + -export-dynamic)
  1274 + export_dynamic=yes
  1275 + continue
  1276 + ;;
  1277 +
  1278 + -export-symbols | -export-symbols-regex)
  1279 + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1280 + $echo "$modename: more than one -exported-symbols argument is not allowed"
  1281 + exit $EXIT_FAILURE
  1282 + fi
  1283 + if test "X$arg" = "X-export-symbols"; then
  1284 + prev=expsyms
  1285 + else
  1286 + prev=expsyms_regex
  1287 + fi
  1288 + continue
  1289 + ;;
  1290 +
  1291 + -inst-prefix-dir)
  1292 + prev=inst_prefix
  1293 + continue
  1294 + ;;
  1295 +
  1296 + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1297 + # so, if we see these flags be careful not to treat them like -L
  1298 + -L[A-Z][A-Z]*:*)
  1299 + case $with_gcc/$host in
  1300 + no/*-*-irix* | /*-*-irix*)
  1301 + compile_command="$compile_command $arg"
  1302 + finalize_command="$finalize_command $arg"
  1303 + ;;
  1304 + esac
  1305 + continue
  1306 + ;;
  1307 +
  1308 + -L*)
  1309 + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1310 + # We need an absolute path.
  1311 + case $dir in
  1312 + [\\/]* | [A-Za-z]:[\\/]*) ;;
  1313 + *)
  1314 + absdir=`cd "$dir" && pwd`
  1315 + if test -z "$absdir"; then
  1316 + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1317 + exit $EXIT_FAILURE
  1318 + fi
  1319 + dir="$absdir"
  1320 + ;;
  1321 + esac
  1322 + case "$deplibs " in
  1323 + *" -L$dir "*) ;;
  1324 + *)
  1325 + deplibs="$deplibs -L$dir"
  1326 + lib_search_path="$lib_search_path $dir"
  1327 + ;;
  1328 + esac
  1329 + case $host in
  1330 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1331 + case :$dllsearchpath: in
  1332 + *":$dir:"*) ;;
  1333 + *) dllsearchpath="$dllsearchpath:$dir";;
  1334 + esac
  1335 + ;;
  1336 + esac
  1337 + continue
  1338 + ;;
  1339 +
  1340 + -l*)
  1341 + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1342 + case $host in
  1343 + *-*-cygwin* | *-*-pw32* | *-*-beos*)
  1344 + # These systems don't actually have a C or math library (as such)
  1345 + continue
  1346 + ;;
  1347 + *-*-mingw* | *-*-os2*)
  1348 + # These systems don't actually have a C library (as such)
  1349 + test "X$arg" = "X-lc" && continue
  1350 + ;;
  1351 + *-*-openbsd* | *-*-freebsd*)
  1352 + # Do not include libc due to us having libc/libc_r.
  1353 + test "X$arg" = "X-lc" && continue
  1354 + ;;
  1355 + *-*-rhapsody* | *-*-darwin1.[012])
  1356 + # Rhapsody C and math libraries are in the System framework
  1357 + deplibs="$deplibs -framework System"
  1358 + continue
  1359 + esac
  1360 + elif test "X$arg" = "X-lc_r"; then
  1361 + case $host in
  1362 + *-*-openbsd* | *-*-freebsd*)
  1363 + # Do not include libc_r directly, use -pthread flag.
  1364 + continue
  1365 + ;;
  1366 + esac
  1367 + fi
  1368 + deplibs="$deplibs $arg"
  1369 + continue
  1370 + ;;
  1371 +
  1372 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1373 + deplibs="$deplibs $arg"
  1374 + continue
  1375 + ;;
  1376 +
  1377 + -module)
  1378 + module=yes
  1379 + continue
  1380 + ;;
  1381 +
  1382 + # gcc -m* arguments should be passed to the linker via $compiler_flags
  1383 + # in order to pass architecture information to the linker
  1384 + # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
  1385 + # but this is not reliable with gcc because gcc may use -mfoo to
  1386 + # select a different linker, different libraries, etc, while
  1387 + # -Wl,-mfoo simply passes -mfoo to the linker.
  1388 + -m*)
  1389 + # Unknown arguments in both finalize_command and compile_command need
  1390 + # to be aesthetically quoted because they are evaled later.
  1391 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1392 + case $arg in
  1393 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1394 + arg="\"$arg\""
  1395 + ;;
  1396 + esac
  1397 + compile_command="$compile_command $arg"
  1398 + finalize_command="$finalize_command $arg"
  1399 + if test "$with_gcc" = "yes" ; then
  1400 + compiler_flags="$compiler_flags $arg"
  1401 + fi
  1402 + continue
  1403 + ;;
  1404 +
  1405 + -shrext)
  1406 + prev=shrext
  1407 + continue
  1408 + ;;
  1409 +
  1410 + -no-fast-install)
  1411 + fast_install=no
  1412 + continue
  1413 + ;;
  1414 +
  1415 + -no-install)
  1416 + case $host in
  1417 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1418 + # The PATH hackery in wrapper scripts is required on Windows
  1419 + # in order for the loader to find any dlls it needs.
  1420 + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1421 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1422 + fast_install=no
  1423 + ;;
  1424 + *) no_install=yes ;;
  1425 + esac
  1426 + continue
  1427 + ;;
  1428 +
  1429 + -no-undefined)
  1430 + allow_undefined=no
  1431 + continue
  1432 + ;;
  1433 +
  1434 + -objectlist)
  1435 + prev=objectlist
  1436 + continue
  1437 + ;;
  1438 +
  1439 + -o) prev=output ;;
  1440 +
  1441 + -precious-files-regex)
  1442 + prev=precious_regex
  1443 + continue
  1444 + ;;
  1445 +
  1446 + -release)
  1447 + prev=release
  1448 + continue
  1449 + ;;
  1450 +
  1451 + -rpath)
  1452 + prev=rpath
  1453 + continue
  1454 + ;;
  1455 +
  1456 + -R)
  1457 + prev=xrpath
  1458 + continue
  1459 + ;;
  1460 +
  1461 + -R*)
  1462 + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1463 + # We need an absolute path.
  1464 + case $dir in
  1465 + [\\/]* | [A-Za-z]:[\\/]*) ;;
  1466 + *)
  1467 + $echo "$modename: only absolute run-paths are allowed" 1>&2
  1468 + exit $EXIT_FAILURE
  1469 + ;;
  1470 + esac
  1471 + case "$xrpath " in
  1472 + *" $dir "*) ;;
  1473 + *) xrpath="$xrpath $dir" ;;
  1474 + esac
  1475 + continue
  1476 + ;;
  1477 +
  1478 + -static)
  1479 + # The effects of -static are defined in a previous loop.
  1480 + # We used to do the same as -all-static on platforms that
  1481 + # didn't have a PIC flag, but the assumption that the effects
  1482 + # would be equivalent was wrong. It would break on at least
  1483 + # Digital Unix and AIX.
  1484 + continue
  1485 + ;;
  1486 +
  1487 + -thread-safe)
  1488 + thread_safe=yes
  1489 + continue
  1490 + ;;
  1491 +
  1492 + -version-info)
  1493 + prev=vinfo
  1494 + continue
  1495 + ;;
  1496 + -version-number)
  1497 + prev=vinfo
  1498 + vinfo_number=yes
  1499 + continue
  1500 + ;;
  1501 +
  1502 + -Wc,*)
  1503 + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1504 + arg=
  1505 + save_ifs="$IFS"; IFS=','
  1506 + for flag in $args; do
  1507 + IFS="$save_ifs"
  1508 + case $flag in
  1509 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1510 + flag="\"$flag\""
  1511 + ;;
  1512 + esac
  1513 + arg="$arg $wl$flag"
  1514 + compiler_flags="$compiler_flags $flag"
  1515 + done
  1516 + IFS="$save_ifs"
  1517 + arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1518 + ;;
  1519 +
  1520 + -Wl,*)
  1521 + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1522 + arg=
  1523 + save_ifs="$IFS"; IFS=','
  1524 + for flag in $args; do
  1525 + IFS="$save_ifs"
  1526 + case $flag in
  1527 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1528 + flag="\"$flag\""
  1529 + ;;
  1530 + esac
  1531 + arg="$arg $wl$flag"
  1532 + compiler_flags="$compiler_flags $wl$flag"
  1533 + linker_flags="$linker_flags $flag"
  1534 + done
  1535 + IFS="$save_ifs"
  1536 + arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1537 + ;;
  1538 +
  1539 + -Xcompiler)
  1540 + prev=xcompiler
  1541 + continue
  1542 + ;;
  1543 +
  1544 + -Xlinker)
  1545 + prev=xlinker
  1546 + continue
  1547 + ;;
  1548 +
  1549 + -XCClinker)
  1550 + prev=xcclinker
  1551 + continue
  1552 + ;;
  1553 +
  1554 + # Some other compiler flag.
  1555 + -* | +*)
  1556 + # Unknown arguments in both finalize_command and compile_command need
  1557 + # to be aesthetically quoted because they are evaled later.
  1558 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1559 + case $arg in
  1560 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1561 + arg="\"$arg\""
  1562 + ;;
  1563 + esac
  1564 + ;;
  1565 +
  1566 + *.$objext)
  1567 + # A standard object.
  1568 + objs="$objs $arg"
  1569 + ;;
  1570 +
  1571 + *.lo)
  1572 + # A libtool-controlled object.
  1573 +
  1574 + # Check to see that this really is a libtool object.
  1575 + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1576 + pic_object=
  1577 + non_pic_object=
  1578 +
  1579 + # Read the .lo file
  1580 + # If there is no directory component, then add one.
  1581 + case $arg in
  1582 + */* | *\\*) . $arg ;;
  1583 + *) . ./$arg ;;
  1584 + esac
  1585 +
  1586 + if test -z "$pic_object" || \
  1587 + test -z "$non_pic_object" ||
  1588 + test "$pic_object" = none && \
  1589 + test "$non_pic_object" = none; then
  1590 + $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1591 + exit $EXIT_FAILURE
  1592 + fi
  1593 +
  1594 + # Extract subdirectory from the argument.
  1595 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1596 + if test "X$xdir" = "X$arg"; then
  1597 + xdir=
  1598 + else
  1599 + xdir="$xdir/"
  1600 + fi
  1601 +
  1602 + if test "$pic_object" != none; then
  1603 + # Prepend the subdirectory the object is found in.
  1604 + pic_object="$xdir$pic_object"
  1605 +
  1606 + if test "$prev" = dlfiles; then
  1607 + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1608 + dlfiles="$dlfiles $pic_object"
  1609 + prev=
  1610 + continue
  1611 + else
  1612 + # If libtool objects are unsupported, then we need to preload.
  1613 + prev=dlprefiles
  1614 + fi
  1615 + fi
  1616 +
  1617 + # CHECK ME: I think I busted this. -Ossama
  1618 + if test "$prev" = dlprefiles; then
  1619 + # Preload the old-style object.
  1620 + dlprefiles="$dlprefiles $pic_object"
  1621 + prev=
  1622 + fi
  1623 +
  1624 + # A PIC object.
  1625 + libobjs="$libobjs $pic_object"
  1626 + arg="$pic_object"
  1627 + fi
  1628 +
  1629 + # Non-PIC object.
  1630 + if test "$non_pic_object" != none; then
  1631 + # Prepend the subdirectory the object is found in.
  1632 + non_pic_object="$xdir$non_pic_object"
  1633 +
  1634 + # A standard non-PIC object
  1635 + non_pic_objects="$non_pic_objects $non_pic_object"
  1636 + if test -z "$pic_object" || test "$pic_object" = none ; then
  1637 + arg="$non_pic_object"
  1638 + fi
  1639 + fi
  1640 + else
  1641 + # Only an error if not doing a dry-run.
  1642 + if test -z "$run"; then
  1643 + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1644 + exit $EXIT_FAILURE
  1645 + else
  1646 + # Dry-run case.
  1647 +
  1648 + # Extract subdirectory from the argument.
  1649 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1650 + if test "X$xdir" = "X$arg"; then
  1651 + xdir=
  1652 + else
  1653 + xdir="$xdir/"
  1654 + fi
  1655 +
  1656 + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1657 + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1658 + libobjs="$libobjs $pic_object"
  1659 + non_pic_objects="$non_pic_objects $non_pic_object"
  1660 + fi
  1661 + fi
  1662 + ;;
  1663 +
  1664 + *.$libext)
  1665 + # An archive.
  1666 + deplibs="$deplibs $arg"
  1667 + old_deplibs="$old_deplibs $arg"
  1668 + continue
  1669 + ;;
  1670 +
  1671 + *.la)
  1672 + # A libtool-controlled library.
  1673 +
  1674 + if test "$prev" = dlfiles; then
  1675 + # This library was specified with -dlopen.
  1676 + dlfiles="$dlfiles $arg"
  1677 + prev=
  1678 + elif test "$prev" = dlprefiles; then
  1679 + # The library was specified with -dlpreopen.
  1680 + dlprefiles="$dlprefiles $arg"
  1681 + prev=
  1682 + else
  1683 + deplibs="$deplibs $arg"
  1684 + fi
  1685 + continue
  1686 + ;;
  1687 +
  1688 + # Some other compiler argument.
  1689 + *)
  1690 + # Unknown arguments in both finalize_command and compile_command need
  1691 + # to be aesthetically quoted because they are evaled later.
  1692 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1693 + case $arg in
  1694 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1695 + arg="\"$arg\""
  1696 + ;;
  1697 + esac
  1698 + ;;
  1699 + esac # arg
  1700 +
  1701 + # Now actually substitute the argument into the commands.
  1702 + if test -n "$arg"; then
  1703 + compile_command="$compile_command $arg"
  1704 + finalize_command="$finalize_command $arg"
  1705 + fi
  1706 + done # argument parsing loop
  1707 +
  1708 + if test -n "$prev"; then
  1709 + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1710 + $echo "$help" 1>&2
  1711 + exit $EXIT_FAILURE
  1712 + fi
  1713 +
  1714 + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1715 + eval arg=\"$export_dynamic_flag_spec\"
  1716 + compile_command="$compile_command $arg"
  1717 + finalize_command="$finalize_command $arg"
  1718 + fi
  1719 +
  1720 + oldlibs=
  1721 + # calculate the name of the file, without its directory
  1722 + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1723 + libobjs_save="$libobjs"
  1724 +
  1725 + if test -n "$shlibpath_var"; then
  1726 + # get the directories listed in $shlibpath_var
  1727 + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1728 + else
  1729 + shlib_search_path=
  1730 + fi
  1731 + eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1732 + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1733 +
  1734 + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1735 + if test "X$output_objdir" = "X$output"; then
  1736 + output_objdir="$objdir"
  1737 + else
  1738 + output_objdir="$output_objdir/$objdir"
  1739 + fi
  1740 + # Create the object directory.
  1741 + if test ! -d "$output_objdir"; then
  1742 + $show "$mkdir $output_objdir"
  1743 + $run $mkdir $output_objdir
  1744 + status=$?
  1745 + if test "$status" -ne 0 && test ! -d "$output_objdir"; then
  1746 + exit $status
  1747 + fi
  1748 + fi
  1749 +
  1750 + # Determine the type of output
  1751 + case $output in
  1752 + "")
  1753 + $echo "$modename: you must specify an output file" 1>&2
  1754 + $echo "$help" 1>&2
  1755 + exit $EXIT_FAILURE
  1756 + ;;
  1757 + *.$libext) linkmode=oldlib ;;
  1758 + *.lo | *.$objext) linkmode=obj ;;
  1759 + *.la) linkmode=lib ;;
  1760 + *) linkmode=prog ;; # Anything else should be a program.
  1761 + esac
  1762 +
  1763 + case $host in
  1764 + *cygwin* | *mingw* | *pw32*)
  1765 + # don't eliminate duplications in $postdeps and $predeps
  1766 + duplicate_compiler_generated_deps=yes
  1767 + ;;
  1768 + *)
  1769 + duplicate_compiler_generated_deps=$duplicate_deps
  1770 + ;;
  1771 + esac
  1772 + specialdeplibs=
  1773 +
  1774 + libs=
  1775 + # Find all interdependent deplibs by searching for libraries
  1776 + # that are linked more than once (e.g. -la -lb -la)
  1777 + for deplib in $deplibs; do
  1778 + if test "X$duplicate_deps" = "Xyes" ; then
  1779 + case "$libs " in
  1780 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1781 + esac
  1782 + fi
  1783 + libs="$libs $deplib"
  1784 + done
  1785 +
  1786 + if test "$linkmode" = lib; then
  1787 + libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1788 +
  1789 + # Compute libraries that are listed more than once in $predeps
  1790 + # $postdeps and mark them as special (i.e., whose duplicates are
  1791 + # not to be eliminated).
  1792 + pre_post_deps=
  1793 + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  1794 + for pre_post_dep in $predeps $postdeps; do
  1795 + case "$pre_post_deps " in
  1796 + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1797 + esac
  1798 + pre_post_deps="$pre_post_deps $pre_post_dep"
  1799 + done
  1800 + fi
  1801 + pre_post_deps=
  1802 + fi
  1803 +
  1804 + deplibs=
  1805 + newdependency_libs=
  1806 + newlib_search_path=
  1807 + need_relink=no # whether we're linking any uninstalled libtool libraries
  1808 + notinst_deplibs= # not-installed libtool libraries
  1809 + notinst_path= # paths that contain not-installed libtool libraries
  1810 + case $linkmode in
  1811 + lib)
  1812 + passes="conv link"
  1813 + for file in $dlfiles $dlprefiles; do
  1814 + case $file in
  1815 + *.la) ;;
  1816 + *)
  1817 + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1818 + exit $EXIT_FAILURE
  1819 + ;;
  1820 + esac
  1821 + done
  1822 + ;;
  1823 + prog)
  1824 + compile_deplibs=
  1825 + finalize_deplibs=
  1826 + alldeplibs=no
  1827 + newdlfiles=
  1828 + newdlprefiles=
  1829 + passes="conv scan dlopen dlpreopen link"
  1830 + ;;
  1831 + *) passes="conv"
  1832 + ;;
  1833 + esac
  1834 + for pass in $passes; do
  1835 + if test "$linkmode,$pass" = "lib,link" ||
  1836 + test "$linkmode,$pass" = "prog,scan"; then
  1837 + libs="$deplibs"
  1838 + deplibs=
  1839 + fi
  1840 + if test "$linkmode" = prog; then
  1841 + case $pass in
  1842 + dlopen) libs="$dlfiles" ;;
  1843 + dlpreopen) libs="$dlprefiles" ;;
  1844 + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1845 + esac
  1846 + fi
  1847 + if test "$pass" = dlopen; then
  1848 + # Collect dlpreopened libraries
  1849 + save_deplibs="$deplibs"
  1850 + deplibs=
  1851 + fi
  1852 + for deplib in $libs; do
  1853 + lib=
  1854 + found=no
  1855 + case $deplib in
  1856 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1857 + if test "$linkmode,$pass" = "prog,link"; then
  1858 + compile_deplibs="$deplib $compile_deplibs"
  1859 + finalize_deplibs="$deplib $finalize_deplibs"
  1860 + else
  1861 + deplibs="$deplib $deplibs"
  1862 + fi
  1863 + continue
  1864 + ;;
  1865 + -l*)
  1866 + if test "$linkmode" != lib && test "$linkmode" != prog; then
  1867 + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1868 + continue
  1869 + fi
  1870 + if test "$pass" = conv; then
  1871 + deplibs="$deplib $deplibs"
  1872 + continue
  1873 + fi
  1874 + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1875 + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1876 + for search_ext in .la $std_shrext .so .a; do
  1877 + # Search the libtool library
  1878 + lib="$searchdir/lib${name}${search_ext}"
  1879 + if test -f "$lib"; then
  1880 + if test "$search_ext" = ".la"; then
  1881 + found=yes
  1882 + else
  1883 + found=no
  1884 + fi
  1885 + break 2
  1886 + fi
  1887 + done
  1888 + done
  1889 + if test "$found" != yes; then
  1890 + # deplib doesn't seem to be a libtool library
  1891 + if test "$linkmode,$pass" = "prog,link"; then
  1892 + compile_deplibs="$deplib $compile_deplibs"
  1893 + finalize_deplibs="$deplib $finalize_deplibs"
  1894 + else
  1895 + deplibs="$deplib $deplibs"
  1896 + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1897 + fi
  1898 + continue
  1899 + else # deplib is a libtool library
  1900 + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1901 + # We need to do some special things here, and not later.
  1902 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1903 + case " $predeps $postdeps " in
  1904 + *" $deplib "*)
  1905 + if (${SED} -e '2q' $lib |
  1906 + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1907 + library_names=
  1908 + old_library=
  1909 + case $lib in
  1910 + */* | *\\*) . $lib ;;
  1911 + *) . ./$lib ;;
  1912 + esac
  1913 + for l in $old_library $library_names; do
  1914 + ll="$l"
  1915 + done
  1916 + if test "X$ll" = "X$old_library" ; then # only static version available
  1917 + found=no
  1918 + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1919 + test "X$ladir" = "X$lib" && ladir="."
  1920 + lib=$ladir/$old_library
  1921 + if test "$linkmode,$pass" = "prog,link"; then
  1922 + compile_deplibs="$deplib $compile_deplibs"
  1923 + finalize_deplibs="$deplib $finalize_deplibs"
  1924 + else
  1925 + deplibs="$deplib $deplibs"
  1926 + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1927 + fi
  1928 + continue
  1929 + fi
  1930 + fi
  1931 + ;;
  1932 + *) ;;
  1933 + esac
  1934 + fi
  1935 + fi
  1936 + ;; # -l
  1937 + -L*)
  1938 + case $linkmode in
  1939 + lib)
  1940 + deplibs="$deplib $deplibs"
  1941 + test "$pass" = conv && continue
  1942 + newdependency_libs="$deplib $newdependency_libs"
  1943 + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1944 + ;;
  1945 + prog)
  1946 + if test "$pass" = conv; then
  1947 + deplibs="$deplib $deplibs"
  1948 + continue
  1949 + fi
  1950 + if test "$pass" = scan; then
  1951 + deplibs="$deplib $deplibs"
  1952 + else
  1953 + compile_deplibs="$deplib $compile_deplibs"
  1954 + finalize_deplibs="$deplib $finalize_deplibs"
  1955 + fi
  1956 + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1957 + ;;
  1958 + *)
  1959 + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1960 + ;;
  1961 + esac # linkmode
  1962 + continue
  1963 + ;; # -L
  1964 + -R*)
  1965 + if test "$pass" = link; then
  1966 + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1967 + # Make sure the xrpath contains only unique directories.
  1968 + case "$xrpath " in
  1969 + *" $dir "*) ;;
  1970 + *) xrpath="$xrpath $dir" ;;
  1971 + esac
  1972 + fi
  1973 + deplibs="$deplib $deplibs"
  1974 + continue
  1975 + ;;
  1976 + *.la) lib="$deplib" ;;
  1977 + *.$libext)
  1978 + if test "$pass" = conv; then
  1979 + deplibs="$deplib $deplibs"
  1980 + continue
  1981 + fi
  1982 + case $linkmode in
  1983 + lib)
  1984 + if test "$deplibs_check_method" != pass_all; then
  1985 + $echo
  1986 + $echo "*** Warning: Trying to link with static lib archive $deplib."
  1987 + $echo "*** I have the capability to make that library automatically link in when"
  1988 + $echo "*** you link to this library. But I can only do this if you have a"
  1989 + $echo "*** shared version of the library, which you do not appear to have"
  1990 + $echo "*** because the file extensions .$libext of this argument makes me believe"
  1991 + $echo "*** that it is just a static archive that I should not used here."
  1992 + else
  1993 + $echo
  1994 + $echo "*** Warning: Linking the shared library $output against the"
  1995 + $echo "*** static library $deplib is not portable!"
  1996 + deplibs="$deplib $deplibs"
  1997 + fi
  1998 + continue
  1999 + ;;
  2000 + prog)
  2001 + if test "$pass" != link; then
  2002 + deplibs="$deplib $deplibs"
  2003 + else
  2004 + compile_deplibs="$deplib $compile_deplibs"
  2005 + finalize_deplibs="$deplib $finalize_deplibs"
  2006 + fi
  2007 + continue
  2008 + ;;
  2009 + esac # linkmode
  2010 + ;; # *.$libext
  2011 + *.lo | *.$objext)
  2012 + if test "$pass" = conv; then
  2013 + deplibs="$deplib $deplibs"
  2014 + elif test "$linkmode" = prog; then
  2015 + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  2016 + # If there is no dlopen support or we're linking statically,
  2017 + # we need to preload.
  2018 + newdlprefiles="$newdlprefiles $deplib"
  2019 + compile_deplibs="$deplib $compile_deplibs"
  2020 + finalize_deplibs="$deplib $finalize_deplibs"
  2021 + else
  2022 + newdlfiles="$newdlfiles $deplib"
  2023 + fi
  2024 + fi
  2025 + continue
  2026 + ;;
  2027 + %DEPLIBS%)
  2028 + alldeplibs=yes
  2029 + continue
  2030 + ;;
  2031 + esac # case $deplib
  2032 + if test "$found" = yes || test -f "$lib"; then :
  2033 + else
  2034 + $echo "$modename: cannot find the library \`$lib'" 1>&2
  2035 + exit $EXIT_FAILURE
  2036 + fi
  2037 +
  2038 + # Check to see that this really is a libtool archive.
  2039 + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2040 + else
  2041 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2042 + exit $EXIT_FAILURE
  2043 + fi
  2044 +
  2045 + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2046 + test "X$ladir" = "X$lib" && ladir="."
  2047 +
  2048 + dlname=
  2049 + dlopen=
  2050 + dlpreopen=
  2051 + libdir=
  2052 + library_names=
  2053 + old_library=
  2054 + # If the library was installed with an old release of libtool,
  2055 + # it will not redefine variables installed, or shouldnotlink
  2056 + installed=yes
  2057 + shouldnotlink=no
  2058 +
  2059 + # Read the .la file
  2060 + case $lib in
  2061 + */* | *\\*) . $lib ;;
  2062 + *) . ./$lib ;;
  2063 + esac
  2064 +
  2065 + if test "$linkmode,$pass" = "lib,link" ||
  2066 + test "$linkmode,$pass" = "prog,scan" ||
  2067 + { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  2068 + test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  2069 + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  2070 + fi
  2071 +
  2072 + if test "$pass" = conv; then
  2073 + # Only check for convenience libraries
  2074 + deplibs="$lib $deplibs"
  2075 + if test -z "$libdir"; then
  2076 + if test -z "$old_library"; then
  2077 + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2078 + exit $EXIT_FAILURE
  2079 + fi
  2080 + # It is a libtool convenience library, so add in its objects.
  2081 + convenience="$convenience $ladir/$objdir/$old_library"
  2082 + old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2083 + tmp_libs=
  2084 + for deplib in $dependency_libs; do
  2085 + deplibs="$deplib $deplibs"
  2086 + if test "X$duplicate_deps" = "Xyes" ; then
  2087 + case "$tmp_libs " in
  2088 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2089 + esac
  2090 + fi
  2091 + tmp_libs="$tmp_libs $deplib"
  2092 + done
  2093 + elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2094 + $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2095 + exit $EXIT_FAILURE
  2096 + fi
  2097 + continue
  2098 + fi # $pass = conv
  2099 +
  2100 +
  2101 + # Get the name of the library we link against.
  2102 + linklib=
  2103 + for l in $old_library $library_names; do
  2104 + linklib="$l"
  2105 + done
  2106 + if test -z "$linklib"; then
  2107 + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2108 + exit $EXIT_FAILURE
  2109 + fi
  2110 +
  2111 + # This library was specified with -dlopen.
  2112 + if test "$pass" = dlopen; then
  2113 + if test -z "$libdir"; then
  2114 + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2115 + exit $EXIT_FAILURE
  2116 + fi
  2117 + if test -z "$dlname" ||
  2118 + test "$dlopen_support" != yes ||
  2119 + test "$build_libtool_libs" = no; then
  2120 + # If there is no dlname, no dlopen support or we're linking
  2121 + # statically, we need to preload. We also need to preload any
  2122 + # dependent libraries so libltdl's deplib preloader doesn't
  2123 + # bomb out in the load deplibs phase.
  2124 + dlprefiles="$dlprefiles $lib $dependency_libs"
  2125 + else
  2126 + newdlfiles="$newdlfiles $lib"
  2127 + fi
  2128 + continue
  2129 + fi # $pass = dlopen
  2130 +
  2131 + # We need an absolute path.
  2132 + case $ladir in
  2133 + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  2134 + *)
  2135 + abs_ladir=`cd "$ladir" && pwd`
  2136 + if test -z "$abs_ladir"; then
  2137 + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  2138 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  2139 + abs_ladir="$ladir"
  2140 + fi
  2141 + ;;
  2142 + esac
  2143 + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  2144 +
  2145 + # Find the relevant object directory and library name.
  2146 + if test "X$installed" = Xyes; then
  2147 + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2148 + $echo "$modename: warning: library \`$lib' was moved." 1>&2
  2149 + dir="$ladir"
  2150 + absdir="$abs_ladir"
  2151 + libdir="$abs_ladir"
  2152 + else
  2153 + dir="$libdir"
  2154 + absdir="$libdir"
  2155 + fi
  2156 + else
  2157 + dir="$ladir/$objdir"
  2158 + absdir="$abs_ladir/$objdir"
  2159 + # Remove this search path later
  2160 + notinst_path="$notinst_path $abs_ladir"
  2161 + fi # $installed = yes
  2162 + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2163 +
  2164 + # This library was specified with -dlpreopen.
  2165 + if test "$pass" = dlpreopen; then
  2166 + if test -z "$libdir"; then
  2167 + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2168 + exit $EXIT_FAILURE
  2169 + fi
  2170 + # Prefer using a static library (so that no silly _DYNAMIC symbols
  2171 + # are required to link).
  2172 + if test -n "$old_library"; then
  2173 + newdlprefiles="$newdlprefiles $dir/$old_library"
  2174 + # Otherwise, use the dlname, so that lt_dlopen finds it.
  2175 + elif test -n "$dlname"; then
  2176 + newdlprefiles="$newdlprefiles $dir/$dlname"
  2177 + else
  2178 + newdlprefiles="$newdlprefiles $dir/$linklib"
  2179 + fi
  2180 + fi # $pass = dlpreopen
  2181 +
  2182 + if test -z "$libdir"; then
  2183 + # Link the convenience library
  2184 + if test "$linkmode" = lib; then
  2185 + deplibs="$dir/$old_library $deplibs"
  2186 + elif test "$linkmode,$pass" = "prog,link"; then
  2187 + compile_deplibs="$dir/$old_library $compile_deplibs"
  2188 + finalize_deplibs="$dir/$old_library $finalize_deplibs"
  2189 + else
  2190 + deplibs="$lib $deplibs" # used for prog,scan pass
  2191 + fi
  2192 + continue
  2193 + fi
  2194 +
  2195 +
  2196 + if test "$linkmode" = prog && test "$pass" != link; then
  2197 + newlib_search_path="$newlib_search_path $ladir"
  2198 + deplibs="$lib $deplibs"
  2199 +
  2200 + linkalldeplibs=no
  2201 + if test "$link_all_deplibs" != no || test -z "$library_names" ||
  2202 + test "$build_libtool_libs" = no; then
  2203 + linkalldeplibs=yes
  2204 + fi
  2205 +
  2206 + tmp_libs=
  2207 + for deplib in $dependency_libs; do
  2208 + case $deplib in
  2209 + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  2210 + esac
  2211 + # Need to link against all dependency_libs?
  2212 + if test "$linkalldeplibs" = yes; then
  2213 + deplibs="$deplib $deplibs"
  2214 + else
  2215 + # Need to hardcode shared library paths
  2216 + # or/and link against static libraries
  2217 + newdependency_libs="$deplib $newdependency_libs"
  2218 + fi
  2219 + if test "X$duplicate_deps" = "Xyes" ; then
  2220 + case "$tmp_libs " in
  2221 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2222 + esac
  2223 + fi
  2224 + tmp_libs="$tmp_libs $deplib"
  2225 + done # for deplib
  2226 + continue
  2227 + fi # $linkmode = prog...
  2228 +
  2229 + if test "$linkmode,$pass" = "prog,link"; then
  2230 + if test -n "$library_names" &&
  2231 + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2232 + # We need to hardcode the library path
  2233 + if test -n "$shlibpath_var"; then
  2234 + # Make sure the rpath contains only unique directories.
  2235 + case "$temp_rpath " in
  2236 + *" $dir "*) ;;
  2237 + *" $absdir "*) ;;
  2238 + *) temp_rpath="$temp_rpath $dir" ;;
  2239 + esac
  2240 + fi
  2241 +
  2242 + # Hardcode the library path.
  2243 + # Skip directories that are in the system default run-time
  2244 + # search path.
  2245 + case " $sys_lib_dlsearch_path " in
  2246 + *" $absdir "*) ;;
  2247 + *)
  2248 + case "$compile_rpath " in
  2249 + *" $absdir "*) ;;
  2250 + *) compile_rpath="$compile_rpath $absdir"
  2251 + esac
  2252 + ;;
  2253 + esac
  2254 + case " $sys_lib_dlsearch_path " in
  2255 + *" $libdir "*) ;;
  2256 + *)
  2257 + case "$finalize_rpath " in
  2258 + *" $libdir "*) ;;
  2259 + *) finalize_rpath="$finalize_rpath $libdir"
  2260 + esac
  2261 + ;;
  2262 + esac
  2263 + fi # $linkmode,$pass = prog,link...
  2264 +
  2265 + if test "$alldeplibs" = yes &&
  2266 + { test "$deplibs_check_method" = pass_all ||
  2267 + { test "$build_libtool_libs" = yes &&
  2268 + test -n "$library_names"; }; }; then
  2269 + # We only need to search for static libraries
  2270 + continue
  2271 + fi
  2272 + fi
  2273 +
  2274 + link_static=no # Whether the deplib will be linked statically
  2275 + if test -n "$library_names" &&
  2276 + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2277 + if test "$installed" = no; then
  2278 + notinst_deplibs="$notinst_deplibs $lib"
  2279 + need_relink=yes
  2280 + fi
  2281 + # This is a shared library
  2282 +
  2283 + # Warn about portability, can't link against -module's on
  2284 + # some systems (darwin)
  2285 + if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2286 + $echo
  2287 + if test "$linkmode" = prog; then
  2288 + $echo "*** Warning: Linking the executable $output against the loadable module"
  2289 + else
  2290 + $echo "*** Warning: Linking the shared library $output against the loadable module"
  2291 + fi
  2292 + $echo "*** $linklib is not portable!"
  2293 + fi
  2294 + if test "$linkmode" = lib &&
  2295 + test "$hardcode_into_libs" = yes; then
  2296 + # Hardcode the library path.
  2297 + # Skip directories that are in the system default run-time
  2298 + # search path.
  2299 + case " $sys_lib_dlsearch_path " in
  2300 + *" $absdir "*) ;;
  2301 + *)
  2302 + case "$compile_rpath " in
  2303 + *" $absdir "*) ;;
  2304 + *) compile_rpath="$compile_rpath $absdir"
  2305 + esac
  2306 + ;;
  2307 + esac
  2308 + case " $sys_lib_dlsearch_path " in
  2309 + *" $libdir "*) ;;
  2310 + *)
  2311 + case "$finalize_rpath " in
  2312 + *" $libdir "*) ;;
  2313 + *) finalize_rpath="$finalize_rpath $libdir"
  2314 + esac
  2315 + ;;
  2316 + esac
  2317 + fi
  2318 +
  2319 + if test -n "$old_archive_from_expsyms_cmds"; then
  2320 + # figure out the soname
  2321 + set dummy $library_names
  2322 + realname="$2"
  2323 + shift; shift
  2324 + libname=`eval \\$echo \"$libname_spec\"`
  2325 + # use dlname if we got it. it's perfectly good, no?
  2326 + if test -n "$dlname"; then
  2327 + soname="$dlname"
  2328 + elif test -n "$soname_spec"; then
  2329 + # bleh windows
  2330 + case $host in
  2331 + *cygwin* | mingw*)
  2332 + major=`expr $current - $age`
  2333 + versuffix="-$major"
  2334 + ;;
  2335 + esac
  2336 + eval soname=\"$soname_spec\"
  2337 + else
  2338 + soname="$realname"
  2339 + fi
  2340 +
  2341 + # Make a new name for the extract_expsyms_cmds to use
  2342 + soroot="$soname"
  2343 + soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  2344 + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  2345 +
  2346 + # If the library has no export list, then create one now
  2347 + if test -f "$output_objdir/$soname-def"; then :
  2348 + else
  2349 + $show "extracting exported symbol list from \`$soname'"
  2350 + save_ifs="$IFS"; IFS='~'
  2351 + cmds=$extract_expsyms_cmds
  2352 + for cmd in $cmds; do
  2353 + IFS="$save_ifs"
  2354 + eval cmd=\"$cmd\"
  2355 + $show "$cmd"
  2356 + $run eval "$cmd" || exit $?
  2357 + done
  2358 + IFS="$save_ifs"
  2359 + fi
  2360 +
  2361 + # Create $newlib
  2362 + if test -f "$output_objdir/$newlib"; then :; else
  2363 + $show "generating import library for \`$soname'"
  2364 + save_ifs="$IFS"; IFS='~'
  2365 + cmds=$old_archive_from_expsyms_cmds
  2366 + for cmd in $cmds; do
  2367 + IFS="$save_ifs"
  2368 + eval cmd=\"$cmd\"
  2369 + $show "$cmd"
  2370 + $run eval "$cmd" || exit $?
  2371 + done
  2372 + IFS="$save_ifs"
  2373 + fi
  2374 + # make sure the library variables are pointing to the new library
  2375 + dir=$output_objdir
  2376 + linklib=$newlib
  2377 + fi # test -n "$old_archive_from_expsyms_cmds"
  2378 +
  2379 + if test "$linkmode" = prog || test "$mode" != relink; then
  2380 + add_shlibpath=
  2381 + add_dir=
  2382 + add=
  2383 + lib_linked=yes
  2384 + case $hardcode_action in
  2385 + immediate | unsupported)
  2386 + if test "$hardcode_direct" = no; then
  2387 + add="$dir/$linklib"
  2388 + case $host in
  2389 + *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2390 + *-*-darwin* )
  2391 + # if the lib is a module then we can not link against
  2392 + # it, someone is ignoring the new warnings I added
  2393 + if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
  2394 + $echo "** Warning, lib $linklib is a module, not a shared library"
  2395 + if test -z "$old_library" ; then
  2396 + $echo
  2397 + $echo "** And there doesn't seem to be a static archive available"
  2398 + $echo "** The link will probably fail, sorry"
  2399 + else
  2400 + add="$dir/$old_library"
  2401 + fi
  2402 + fi
  2403 + esac
  2404 + elif test "$hardcode_minus_L" = no; then
  2405 + case $host in
  2406 + *-*-sunos*) add_shlibpath="$dir" ;;
  2407 + esac
  2408 + add_dir="-L$dir"
  2409 + add="-l$name"
  2410 + elif test "$hardcode_shlibpath_var" = no; then
  2411 + add_shlibpath="$dir"
  2412 + add="-l$name"
  2413 + else
  2414 + lib_linked=no
  2415 + fi
  2416 + ;;
  2417 + relink)
  2418 + if test "$hardcode_direct" = yes; then
  2419 + add="$dir/$linklib"
  2420 + elif test "$hardcode_minus_L" = yes; then
  2421 + add_dir="-L$dir"
  2422 + # Try looking first in the location we're being installed to.
  2423 + if test -n "$inst_prefix_dir"; then
  2424 + case "$libdir" in
  2425 + [\\/]*)
  2426 + add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2427 + ;;
  2428 + esac
  2429 + fi
  2430 + add="-l$name"
  2431 + elif test "$hardcode_shlibpath_var" = yes; then
  2432 + add_shlibpath="$dir"
  2433 + add="-l$name"
  2434 + else
  2435 + lib_linked=no
  2436 + fi
  2437 + ;;
  2438 + *) lib_linked=no ;;
  2439 + esac
  2440 +
  2441 + if test "$lib_linked" != yes; then
  2442 + $echo "$modename: configuration error: unsupported hardcode properties"
  2443 + exit $EXIT_FAILURE
  2444 + fi
  2445 +
  2446 + if test -n "$add_shlibpath"; then
  2447 + case :$compile_shlibpath: in
  2448 + *":$add_shlibpath:"*) ;;
  2449 + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  2450 + esac
  2451 + fi
  2452 + if test "$linkmode" = prog; then
  2453 + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  2454 + test -n "$add" && compile_deplibs="$add $compile_deplibs"
  2455 + else
  2456 + test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2457 + test -n "$add" && deplibs="$add $deplibs"
  2458 + if test "$hardcode_direct" != yes && \
  2459 + test "$hardcode_minus_L" != yes && \
  2460 + test "$hardcode_shlibpath_var" = yes; then
  2461 + case :$finalize_shlibpath: in
  2462 + *":$libdir:"*) ;;
  2463 + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2464 + esac
  2465 + fi
  2466 + fi
  2467 + fi
  2468 +
  2469 + if test "$linkmode" = prog || test "$mode" = relink; then
  2470 + add_shlibpath=
  2471 + add_dir=
  2472 + add=
  2473 + # Finalize command for both is simple: just hardcode it.
  2474 + if test "$hardcode_direct" = yes; then
  2475 + add="$libdir/$linklib"
  2476 + elif test "$hardcode_minus_L" = yes; then
  2477 + add_dir="-L$libdir"
  2478 + add="-l$name"
  2479 + elif test "$hardcode_shlibpath_var" = yes; then
  2480 + case :$finalize_shlibpath: in
  2481 + *":$libdir:"*) ;;
  2482 + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2483 + esac
  2484 + add="-l$name"
  2485 + elif test "$hardcode_automatic" = yes; then
  2486 + if test -n "$inst_prefix_dir" &&
  2487 + test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2488 + add="$inst_prefix_dir$libdir/$linklib"
  2489 + else
  2490 + add="$libdir/$linklib"
  2491 + fi
  2492 + else
  2493 + # We cannot seem to hardcode it, guess we'll fake it.
  2494 + add_dir="-L$libdir"
  2495 + # Try looking first in the location we're being installed to.
  2496 + if test -n "$inst_prefix_dir"; then
  2497 + case "$libdir" in
  2498 + [\\/]*)
  2499 + add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2500 + ;;
  2501 + esac
  2502 + fi
  2503 + add="-l$name"
  2504 + fi
  2505 +
  2506 + if test "$linkmode" = prog; then
  2507 + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  2508 + test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  2509 + else
  2510 + test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2511 + test -n "$add" && deplibs="$add $deplibs"
  2512 + fi
  2513 + fi
  2514 + elif test "$linkmode" = prog; then
  2515 + # Here we assume that one of hardcode_direct or hardcode_minus_L
  2516 + # is not unsupported. This is valid on all known static and
  2517 + # shared platforms.
  2518 + if test "$hardcode_direct" != unsupported; then
  2519 + test -n "$old_library" && linklib="$old_library"
  2520 + compile_deplibs="$dir/$linklib $compile_deplibs"
  2521 + finalize_deplibs="$dir/$linklib $finalize_deplibs"
  2522 + else
  2523 + compile_deplibs="-l$name -L$dir $compile_deplibs"
  2524 + finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  2525 + fi
  2526 + elif test "$build_libtool_libs" = yes; then
  2527 + # Not a shared library
  2528 + if test "$deplibs_check_method" != pass_all; then
  2529 + # We're trying link a shared library against a static one
  2530 + # but the system doesn't support it.
  2531 +
  2532 + # Just print a warning and add the library to dependency_libs so
  2533 + # that the program can be linked against the static library.
  2534 + $echo
  2535 + $echo "*** Warning: This system can not link to static lib archive $lib."
  2536 + $echo "*** I have the capability to make that library automatically link in when"
  2537 + $echo "*** you link to this library. But I can only do this if you have a"
  2538 + $echo "*** shared version of the library, which you do not appear to have."
  2539 + if test "$module" = yes; then
  2540 + $echo "*** But as you try to build a module library, libtool will still create "
  2541 + $echo "*** a static module, that should work as long as the dlopening application"
  2542 + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  2543 + if test -z "$global_symbol_pipe"; then
  2544 + $echo
  2545 + $echo "*** However, this would only work if libtool was able to extract symbol"
  2546 + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2547 + $echo "*** not find such a program. So, this module is probably useless."
  2548 + $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2549 + fi
  2550 + if test "$build_old_libs" = no; then
  2551 + build_libtool_libs=module
  2552 + build_old_libs=yes
  2553 + else
  2554 + build_libtool_libs=no
  2555 + fi
  2556 + fi
  2557 + else
  2558 + convenience="$convenience $dir/$old_library"
  2559 + old_convenience="$old_convenience $dir/$old_library"
  2560 + deplibs="$dir/$old_library $deplibs"
  2561 + link_static=yes
  2562 + fi
  2563 + fi # link shared/static library?
  2564 +
  2565 + if test "$linkmode" = lib; then
  2566 + if test -n "$dependency_libs" &&
  2567 + { test "$hardcode_into_libs" != yes ||
  2568 + test "$build_old_libs" = yes ||
  2569 + test "$link_static" = yes; }; then
  2570 + # Extract -R from dependency_libs
  2571 + temp_deplibs=
  2572 + for libdir in $dependency_libs; do
  2573 + case $libdir in
  2574 + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  2575 + case " $xrpath " in
  2576 + *" $temp_xrpath "*) ;;
  2577 + *) xrpath="$xrpath $temp_xrpath";;
  2578 + esac;;
  2579 + *) temp_deplibs="$temp_deplibs $libdir";;
  2580 + esac
  2581 + done
  2582 + dependency_libs="$temp_deplibs"
  2583 + fi
  2584 +
  2585 + newlib_search_path="$newlib_search_path $absdir"
  2586 + # Link against this library
  2587 + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  2588 + # ... and its dependency_libs
  2589 + tmp_libs=
  2590 + for deplib in $dependency_libs; do
  2591 + newdependency_libs="$deplib $newdependency_libs"
  2592 + if test "X$duplicate_deps" = "Xyes" ; then
  2593 + case "$tmp_libs " in
  2594 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2595 + esac
  2596 + fi
  2597 + tmp_libs="$tmp_libs $deplib"
  2598 + done
  2599 +
  2600 + if test "$link_all_deplibs" != no; then
  2601 + # Add the search paths of all dependency libraries
  2602 + for deplib in $dependency_libs; do
  2603 + case $deplib in
  2604 + -L*) path="$deplib" ;;
  2605 + *.la)
  2606 + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  2607 + test "X$dir" = "X$deplib" && dir="."
  2608 + # We need an absolute path.
  2609 + case $dir in
  2610 + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  2611 + *)
  2612 + absdir=`cd "$dir" && pwd`
  2613 + if test -z "$absdir"; then
  2614 + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  2615 + absdir="$dir"
  2616 + fi
  2617 + ;;
  2618 + esac
  2619 + if grep "^installed=no" $deplib > /dev/null; then
  2620 + path="$absdir/$objdir"
  2621 + else
  2622 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2623 + if test -z "$libdir"; then
  2624 + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2625 + exit $EXIT_FAILURE
  2626 + fi
  2627 + if test "$absdir" != "$libdir"; then
  2628 + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2629 + fi
  2630 + path="$absdir"
  2631 + fi
  2632 + depdepl=
  2633 + case $host in
  2634 + *-*-darwin*)
  2635 + # we do not want to link against static libs,
  2636 + # but need to link against shared
  2637 + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2638 + if test -n "$deplibrary_names" ; then
  2639 + for tmp in $deplibrary_names ; do
  2640 + depdepl=$tmp
  2641 + done
  2642 + if test -f "$path/$depdepl" ; then
  2643 + depdepl="$path/$depdepl"
  2644 + fi
  2645 + # do not add paths which are already there
  2646 + case " $newlib_search_path " in
  2647 + *" $path "*) ;;
  2648 + *) newlib_search_path="$newlib_search_path $path";;
  2649 + esac
  2650 + fi
  2651 + path=""
  2652 + ;;
  2653 + *)
  2654 + path="-L$path"
  2655 + ;;
  2656 + esac
  2657 + ;;
  2658 + -l*)
  2659 + case $host in
  2660 + *-*-darwin*)
  2661 + # Again, we only want to link against shared libraries
  2662 + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2663 + for tmp in $newlib_search_path ; do
  2664 + if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2665 + eval depdepl="$tmp/lib$tmp_libs.dylib"
  2666 + break
  2667 + fi
  2668 + done
  2669 + path=""
  2670 + ;;
  2671 + *) continue ;;
  2672 + esac
  2673 + ;;
  2674 + *) continue ;;
  2675 + esac
  2676 + case " $deplibs " in
  2677 + *" $depdepl "*) ;;
  2678 + *) deplibs="$depdepl $deplibs" ;;
  2679 + esac
  2680 + case " $deplibs " in
  2681 + *" $path "*) ;;
  2682 + *) deplibs="$deplibs $path" ;;
  2683 + esac
  2684 + done
  2685 + fi # link_all_deplibs != no
  2686 + fi # linkmode = lib
  2687 + done # for deplib in $libs
  2688 + dependency_libs="$newdependency_libs"
  2689 + if test "$pass" = dlpreopen; then
  2690 + # Link the dlpreopened libraries before other libraries
  2691 + for deplib in $save_deplibs; do
  2692 + deplibs="$deplib $deplibs"
  2693 + done
  2694 + fi
  2695 + if test "$pass" != dlopen; then
  2696 + if test "$pass" != conv; then
  2697 + # Make sure lib_search_path contains only unique directories.
  2698 + lib_search_path=
  2699 + for dir in $newlib_search_path; do
  2700 + case "$lib_search_path " in
  2701 + *" $dir "*) ;;
  2702 + *) lib_search_path="$lib_search_path $dir" ;;
  2703 + esac
  2704 + done
  2705 + newlib_search_path=
  2706 + fi
  2707 +
  2708 + if test "$linkmode,$pass" != "prog,link"; then
  2709 + vars="deplibs"
  2710 + else
  2711 + vars="compile_deplibs finalize_deplibs"
  2712 + fi
  2713 + for var in $vars dependency_libs; do
  2714 + # Add libraries to $var in reverse order
  2715 + eval tmp_libs=\"\$$var\"
  2716 + new_libs=
  2717 + for deplib in $tmp_libs; do
  2718 + # FIXME: Pedantically, this is the right thing to do, so
  2719 + # that some nasty dependency loop isn't accidentally
  2720 + # broken:
  2721 + #new_libs="$deplib $new_libs"
  2722 + # Pragmatically, this seems to cause very few problems in
  2723 + # practice:
  2724 + case $deplib in
  2725 + -L*) new_libs="$deplib $new_libs" ;;
  2726 + -R*) ;;
  2727 + *)
  2728 + # And here is the reason: when a library appears more
  2729 + # than once as an explicit dependence of a library, or
  2730 + # is implicitly linked in more than once by the
  2731 + # compiler, it is considered special, and multiple
  2732 + # occurrences thereof are not removed. Compare this
  2733 + # with having the same library being listed as a
  2734 + # dependency of multiple other libraries: in this case,
  2735 + # we know (pedantically, we assume) the library does not
  2736 + # need to be listed more than once, so we keep only the
  2737 + # last copy. This is not always right, but it is rare
  2738 + # enough that we require users that really mean to play
  2739 + # such unportable linking tricks to link the library
  2740 + # using -Wl,-lname, so that libtool does not consider it
  2741 + # for duplicate removal.
  2742 + case " $specialdeplibs " in
  2743 + *" $deplib "*) new_libs="$deplib $new_libs" ;;
  2744 + *)
  2745 + case " $new_libs " in
  2746 + *" $deplib "*) ;;
  2747 + *) new_libs="$deplib $new_libs" ;;
  2748 + esac
  2749 + ;;
  2750 + esac
  2751 + ;;
  2752 + esac
  2753 + done
  2754 + tmp_libs=
  2755 + for deplib in $new_libs; do
  2756 + case $deplib in
  2757 + -L*)
  2758 + case " $tmp_libs " in
  2759 + *" $deplib "*) ;;
  2760 + *) tmp_libs="$tmp_libs $deplib" ;;
  2761 + esac
  2762 + ;;
  2763 + *) tmp_libs="$tmp_libs $deplib" ;;
  2764 + esac
  2765 + done
  2766 + eval $var=\"$tmp_libs\"
  2767 + done # for var
  2768 + fi
  2769 + # Last step: remove runtime libs from dependency_libs
  2770 + # (they stay in deplibs)
  2771 + tmp_libs=
  2772 + for i in $dependency_libs ; do
  2773 + case " $predeps $postdeps $compiler_lib_search_path " in
  2774 + *" $i "*)
  2775 + i=""
  2776 + ;;
  2777 + esac
  2778 + if test -n "$i" ; then
  2779 + tmp_libs="$tmp_libs $i"
  2780 + fi
  2781 + done
  2782 + dependency_libs=$tmp_libs
  2783 + done # for pass
  2784 + if test "$linkmode" = prog; then
  2785 + dlfiles="$newdlfiles"
  2786 + dlprefiles="$newdlprefiles"
  2787 + fi
  2788 +
  2789 + case $linkmode in
  2790 + oldlib)
  2791 + if test -n "$deplibs"; then
  2792 + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  2793 + fi
  2794 +
  2795 + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2796 + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  2797 + fi
  2798 +
  2799 + if test -n "$rpath"; then
  2800 + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  2801 + fi
  2802 +
  2803 + if test -n "$xrpath"; then
  2804 + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  2805 + fi
  2806 +
  2807 + if test -n "$vinfo"; then
  2808 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  2809 + fi
  2810 +
  2811 + if test -n "$release"; then
  2812 + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  2813 + fi
  2814 +
  2815 + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  2816 + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  2817 + fi
  2818 +
  2819 + # Now set the variables for building old libraries.
  2820 + build_libtool_libs=no
  2821 + oldlibs="$output"
  2822 + objs="$objs$old_deplibs"
  2823 + ;;
  2824 +
  2825 + lib)
  2826 + # Make sure we only generate libraries of the form `libNAME.la'.
  2827 + case $outputname in
  2828 + lib*)
  2829 + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2830 + eval shared_ext=\"$shrext_cmds\"
  2831 + eval libname=\"$libname_spec\"
  2832 + ;;
  2833 + *)
  2834 + if test "$module" = no; then
  2835 + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2836 + $echo "$help" 1>&2
  2837 + exit $EXIT_FAILURE
  2838 + fi
  2839 + if test "$need_lib_prefix" != no; then
  2840 + # Add the "lib" prefix for modules if required
  2841 + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2842 + eval shared_ext=\"$shrext_cmds\"
  2843 + eval libname=\"$libname_spec\"
  2844 + else
  2845 + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2846 + fi
  2847 + ;;
  2848 + esac
  2849 +
  2850 + if test -n "$objs"; then
  2851 + if test "$deplibs_check_method" != pass_all; then
  2852 + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2853 + exit $EXIT_FAILURE
  2854 + else
  2855 + $echo
  2856 + $echo "*** Warning: Linking the shared library $output against the non-libtool"
  2857 + $echo "*** objects $objs is not portable!"
  2858 + libobjs="$libobjs $objs"
  2859 + fi
  2860 + fi
  2861 +
  2862 + if test "$dlself" != no; then
  2863 + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  2864 + fi
  2865 +
  2866 + set dummy $rpath
  2867 + if test "$#" -gt 2; then
  2868 + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  2869 + fi
  2870 + install_libdir="$2"
  2871 +
  2872 + oldlibs=
  2873 + if test -z "$rpath"; then
  2874 + if test "$build_libtool_libs" = yes; then
  2875 + # Building a libtool convenience library.
  2876 + # Some compilers have problems with a `.al' extension so
  2877 + # convenience libraries should have the same extension an
  2878 + # archive normally would.
  2879 + oldlibs="$output_objdir/$libname.$libext $oldlibs"
  2880 + build_libtool_libs=convenience
  2881 + build_old_libs=yes
  2882 + fi
  2883 +
  2884 + if test -n "$vinfo"; then
  2885 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  2886 + fi
  2887 +
  2888 + if test -n "$release"; then
  2889 + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  2890 + fi
  2891 + else
  2892 +
  2893 + # Parse the version information argument.
  2894 + save_ifs="$IFS"; IFS=':'
  2895 + set dummy $vinfo 0 0 0
  2896 + IFS="$save_ifs"
  2897 +
  2898 + if test -n "$8"; then
  2899 + $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2900 + $echo "$help" 1>&2
  2901 + exit $EXIT_FAILURE
  2902 + fi
  2903 +
  2904 + # convert absolute version numbers to libtool ages
  2905 + # this retains compatibility with .la files and attempts
  2906 + # to make the code below a bit more comprehensible
  2907 +
  2908 + case $vinfo_number in
  2909 + yes)
  2910 + number_major="$2"
  2911 + number_minor="$3"
  2912 + number_revision="$4"
  2913 + #
  2914 + # There are really only two kinds -- those that
  2915 + # use the current revision as the major version
  2916 + # and those that subtract age and use age as
  2917 + # a minor version. But, then there is irix
  2918 + # which has an extra 1 added just for fun
  2919 + #
  2920 + case $version_type in
  2921 + darwin|linux|osf|windows)
  2922 + current=`expr $number_major + $number_minor`
  2923 + age="$number_minor"
  2924 + revision="$number_revision"
  2925 + ;;
  2926 + freebsd-aout|freebsd-elf|sunos)
  2927 + current="$number_major"
  2928 + revision="$number_minor"
  2929 + age="0"
  2930 + ;;
  2931 + irix|nonstopux)
  2932 + current=`expr $number_major + $number_minor - 1`
  2933 + age="$number_minor"
  2934 + revision="$number_minor"
  2935 + ;;
  2936 + esac
  2937 + ;;
  2938 + no)
  2939 + current="$2"
  2940 + revision="$3"
  2941 + age="$4"
  2942 + ;;
  2943 + esac
  2944 +
  2945 + # Check that each of the things are valid numbers.
  2946 + case $current in
  2947 + [0-9]*) ;;
  2948 + *)
  2949 + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2950 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2951 + exit $EXIT_FAILURE
  2952 + ;;
  2953 + esac
  2954 +
  2955 + case $revision in
  2956 + [0-9]*) ;;
  2957 + *)
  2958 + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2959 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2960 + exit $EXIT_FAILURE
  2961 + ;;
  2962 + esac
  2963 +
  2964 + case $age in
  2965 + [0-9]*) ;;
  2966 + *)
  2967 + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2968 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2969 + exit $EXIT_FAILURE
  2970 + ;;
  2971 + esac
  2972 +
  2973 + if test "$age" -gt "$current"; then
  2974 + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2975 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2976 + exit $EXIT_FAILURE
  2977 + fi
  2978 +
  2979 + # Calculate the version variables.
  2980 + major=
  2981 + versuffix=
  2982 + verstring=
  2983 + case $version_type in
  2984 + none) ;;
  2985 +
  2986 + darwin)
  2987 + # Like Linux, but with the current version available in
  2988 + # verstring for coding it into the library header
  2989 + major=.`expr $current - $age`
  2990 + versuffix="$major.$age.$revision"
  2991 + # Darwin ld doesn't like 0 for these options...
  2992 + minor_current=`expr $current + 1`
  2993 + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  2994 + ;;
  2995 +
  2996 + freebsd-aout)
  2997 + major=".$current"
  2998 + versuffix=".$current.$revision";
  2999 + ;;
  3000 +
  3001 + freebsd-elf)
  3002 + major=".$current"
  3003 + versuffix=".$current";
  3004 + ;;
  3005 +
  3006 + irix | nonstopux)
  3007 + major=`expr $current - $age + 1`
  3008 +
  3009 + case $version_type in
  3010 + nonstopux) verstring_prefix=nonstopux ;;
  3011 + *) verstring_prefix=sgi ;;
  3012 + esac
  3013 + verstring="$verstring_prefix$major.$revision"
  3014 +
  3015 + # Add in all the interfaces that we are compatible with.
  3016 + loop=$revision
  3017 + while test "$loop" -ne 0; do
  3018 + iface=`expr $revision - $loop`
  3019 + loop=`expr $loop - 1`
  3020 + verstring="$verstring_prefix$major.$iface:$verstring"
  3021 + done
  3022 +
  3023 + # Before this point, $major must not contain `.'.
  3024 + major=.$major
  3025 + versuffix="$major.$revision"
  3026 + ;;
  3027 +
  3028 + linux)
  3029 + major=.`expr $current - $age`
  3030 + versuffix="$major.$age.$revision"
  3031 + ;;
  3032 +
  3033 + osf)
  3034 + major=.`expr $current - $age`
  3035 + versuffix=".$current.$age.$revision"
  3036 + verstring="$current.$age.$revision"
  3037 +
  3038 + # Add in all the interfaces that we are compatible with.
  3039 + loop=$age
  3040 + while test "$loop" -ne 0; do
  3041 + iface=`expr $current - $loop`
  3042 + loop=`expr $loop - 1`
  3043 + verstring="$verstring:${iface}.0"
  3044 + done
  3045 +
  3046 + # Make executables depend on our current version.
  3047 + verstring="$verstring:${current}.0"
  3048 + ;;
  3049 +
  3050 + sunos)
  3051 + major=".$current"
  3052 + versuffix=".$current.$revision"
  3053 + ;;
  3054 +
  3055 + windows)
  3056 + # Use '-' rather than '.', since we only want one
  3057 + # extension on DOS 8.3 filesystems.
  3058 + major=`expr $current - $age`
  3059 + versuffix="-$major"
  3060 + ;;
  3061 +
  3062 + *)
  3063 + $echo "$modename: unknown library version type \`$version_type'" 1>&2
  3064 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  3065 + exit $EXIT_FAILURE
  3066 + ;;
  3067 + esac
  3068 +
  3069 + # Clear the version info if we defaulted, and they specified a release.
  3070 + if test -z "$vinfo" && test -n "$release"; then
  3071 + major=
  3072 + case $version_type in
  3073 + darwin)
  3074 + # we can't check for "0.0" in archive_cmds due to quoting
  3075 + # problems, so we reset it completely
  3076 + verstring=
  3077 + ;;
  3078 + *)
  3079 + verstring="0.0"
  3080 + ;;
  3081 + esac
  3082 + if test "$need_version" = no; then
  3083 + versuffix=
  3084 + else
  3085 + versuffix=".0.0"
  3086 + fi
  3087 + fi
  3088 +
  3089 + # Remove version info from name if versioning should be avoided
  3090 + if test "$avoid_version" = yes && test "$need_version" = no; then
  3091 + major=
  3092 + versuffix=
  3093 + verstring=""
  3094 + fi
  3095 +
  3096 + # Check to see if the archive will have undefined symbols.
  3097 + if test "$allow_undefined" = yes; then
  3098 + if test "$allow_undefined_flag" = unsupported; then
  3099 + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  3100 + build_libtool_libs=no
  3101 + build_old_libs=yes
  3102 + fi
  3103 + else
  3104 + # Don't allow undefined symbols.
  3105 + allow_undefined_flag="$no_undefined_flag"
  3106 + fi
  3107 + fi
  3108 +
  3109 + if test "$mode" != relink; then
  3110 + # Remove our outputs, but don't remove object files since they
  3111 + # may have been created when compiling PIC objects.
  3112 + removelist=
  3113 + tempremovelist=`$echo "$output_objdir/*"`
  3114 + for p in $tempremovelist; do
  3115 + case $p in
  3116 + *.$objext)
  3117 + ;;
  3118 + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  3119 + if test "X$precious_files_regex" != "X"; then
  3120 + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  3121 + then
  3122 + continue
  3123 + fi
  3124 + fi
  3125 + removelist="$removelist $p"
  3126 + ;;
  3127 + *) ;;
  3128 + esac
  3129 + done
  3130 + if test -n "$removelist"; then
  3131 + $show "${rm}r $removelist"
  3132 + $run ${rm}r $removelist
  3133 + fi
  3134 + fi
  3135 +
  3136 + # Now set the variables for building old libraries.
  3137 + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  3138 + oldlibs="$oldlibs $output_objdir/$libname.$libext"
  3139 +
  3140 + # Transform .lo files to .o files.
  3141 + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  3142 + fi
  3143 +
  3144 + # Eliminate all temporary directories.
  3145 + for path in $notinst_path; do
  3146 + lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
  3147 + deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
  3148 + dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
  3149 + done
  3150 +
  3151 + if test -n "$xrpath"; then
  3152 + # If the user specified any rpath flags, then add them.
  3153 + temp_xrpath=
  3154 + for libdir in $xrpath; do
  3155 + temp_xrpath="$temp_xrpath -R$libdir"
  3156 + case "$finalize_rpath " in
  3157 + *" $libdir "*) ;;
  3158 + *) finalize_rpath="$finalize_rpath $libdir" ;;
  3159 + esac
  3160 + done
  3161 + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  3162 + dependency_libs="$temp_xrpath $dependency_libs"
  3163 + fi
  3164 + fi
  3165 +
  3166 + # Make sure dlfiles contains only unique files that won't be dlpreopened
  3167 + old_dlfiles="$dlfiles"
  3168 + dlfiles=
  3169 + for lib in $old_dlfiles; do
  3170 + case " $dlprefiles $dlfiles " in
  3171 + *" $lib "*) ;;
  3172 + *) dlfiles="$dlfiles $lib" ;;
  3173 + esac
  3174 + done
  3175 +
  3176 + # Make sure dlprefiles contains only unique files
  3177 + old_dlprefiles="$dlprefiles"
  3178 + dlprefiles=
  3179 + for lib in $old_dlprefiles; do
  3180 + case "$dlprefiles " in
  3181 + *" $lib "*) ;;
  3182 + *) dlprefiles="$dlprefiles $lib" ;;
  3183 + esac
  3184 + done
  3185 +
  3186 + if test "$build_libtool_libs" = yes; then
  3187 + if test -n "$rpath"; then
  3188 + case $host in
  3189 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  3190 + # these systems don't actually have a c library (as such)!
  3191 + ;;
  3192 + *-*-rhapsody* | *-*-darwin1.[012])
  3193 + # Rhapsody C library is in the System framework
  3194 + deplibs="$deplibs -framework System"
  3195 + ;;
  3196 + *-*-netbsd*)
  3197 + # Don't link with libc until the a.out ld.so is fixed.
  3198 + ;;
  3199 + *-*-openbsd* | *-*-freebsd*)
  3200 + # Do not include libc due to us having libc/libc_r.
  3201 + test "X$arg" = "X-lc" && continue
  3202 + ;;
  3203 + *)
  3204 + # Add libc to deplibs on all other systems if necessary.
  3205 + if test "$build_libtool_need_lc" = "yes"; then
  3206 + deplibs="$deplibs -lc"
  3207 + fi
  3208 + ;;
  3209 + esac
  3210 + fi
  3211 +
  3212 + # Transform deplibs into only deplibs that can be linked in shared.
  3213 + name_save=$name
  3214 + libname_save=$libname
  3215 + release_save=$release
  3216 + versuffix_save=$versuffix
  3217 + major_save=$major
  3218 + # I'm not sure if I'm treating the release correctly. I think
  3219 + # release should show up in the -l (ie -lgmp5) so we don't want to
  3220 + # add it in twice. Is that correct?
  3221 + release=""
  3222 + versuffix=""
  3223 + major=""
  3224 + newdeplibs=
  3225 + droppeddeps=no
  3226 + case $deplibs_check_method in
  3227 + pass_all)
  3228 + # Don't check for shared/static. Everything works.
  3229 + # This might be a little naive. We might want to check
  3230 + # whether the library exists or not. But this is on
  3231 + # osf3 & osf4 and I'm not really sure... Just
  3232 + # implementing what was already the behavior.
  3233 + newdeplibs=$deplibs
  3234 + ;;
  3235 + test_compile)
  3236 + # This code stresses the "libraries are programs" paradigm to its
  3237 + # limits. Maybe even breaks it. We compile a program, linking it
  3238 + # against the deplibs as a proxy for the library. Then we can check
  3239 + # whether they linked in statically or dynamically with ldd.
  3240 + $rm conftest.c
  3241 + cat > conftest.c <<EOF
  3242 + int main() { return 0; }
  3243 +EOF
  3244 + $rm conftest
  3245 + $LTCC -o conftest conftest.c $deplibs
  3246 + if test "$?" -eq 0 ; then
  3247 + ldd_output=`ldd conftest`
  3248 + for i in $deplibs; do
  3249 + name="`expr $i : '-l\(.*\)'`"
  3250 + # If $name is empty we are operating on a -L argument.
  3251 + if test "$name" != "" && test "$name" -ne "0"; then
  3252 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3253 + case " $predeps $postdeps " in
  3254 + *" $i "*)
  3255 + newdeplibs="$newdeplibs $i"
  3256 + i=""
  3257 + ;;
  3258 + esac
  3259 + fi
  3260 + if test -n "$i" ; then
  3261 + libname=`eval \\$echo \"$libname_spec\"`
  3262 + deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3263 + set dummy $deplib_matches
  3264 + deplib_match=$2
  3265 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3266 + newdeplibs="$newdeplibs $i"
  3267 + else
  3268 + droppeddeps=yes
  3269 + $echo
  3270 + $echo "*** Warning: dynamic linker does not accept needed library $i."
  3271 + $echo "*** I have the capability to make that library automatically link in when"
  3272 + $echo "*** you link to this library. But I can only do this if you have a"
  3273 + $echo "*** shared version of the library, which I believe you do not have"
  3274 + $echo "*** because a test_compile did reveal that the linker did not use it for"
  3275 + $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  3276 + fi
  3277 + fi
  3278 + else
  3279 + newdeplibs="$newdeplibs $i"
  3280 + fi
  3281 + done
  3282 + else
  3283 + # Error occurred in the first compile. Let's try to salvage
  3284 + # the situation: Compile a separate program for each library.
  3285 + for i in $deplibs; do
  3286 + name="`expr $i : '-l\(.*\)'`"
  3287 + # If $name is empty we are operating on a -L argument.
  3288 + if test "$name" != "" && test "$name" != "0"; then
  3289 + $rm conftest
  3290 + $LTCC -o conftest conftest.c $i
  3291 + # Did it work?
  3292 + if test "$?" -eq 0 ; then
  3293 + ldd_output=`ldd conftest`
  3294 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3295 + case " $predeps $postdeps " in
  3296 + *" $i "*)
  3297 + newdeplibs="$newdeplibs $i"
  3298 + i=""
  3299 + ;;
  3300 + esac
  3301 + fi
  3302 + if test -n "$i" ; then
  3303 + libname=`eval \\$echo \"$libname_spec\"`
  3304 + deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3305 + set dummy $deplib_matches
  3306 + deplib_match=$2
  3307 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3308 + newdeplibs="$newdeplibs $i"
  3309 + else
  3310 + droppeddeps=yes
  3311 + $echo
  3312 + $echo "*** Warning: dynamic linker does not accept needed library $i."
  3313 + $echo "*** I have the capability to make that library automatically link in when"
  3314 + $echo "*** you link to this library. But I can only do this if you have a"
  3315 + $echo "*** shared version of the library, which you do not appear to have"
  3316 + $echo "*** because a test_compile did reveal that the linker did not use this one"
  3317 + $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  3318 + fi
  3319 + fi
  3320 + else
  3321 + droppeddeps=yes
  3322 + $echo
  3323 + $echo "*** Warning! Library $i is needed by this library but I was not able to"
  3324 + $echo "*** make it link in! You will probably need to install it or some"
  3325 + $echo "*** library that it depends on before this library will be fully"
  3326 + $echo "*** functional. Installing it before continuing would be even better."
  3327 + fi
  3328 + else
  3329 + newdeplibs="$newdeplibs $i"
  3330 + fi
  3331 + done
  3332 + fi
  3333 + ;;
  3334 + file_magic*)
  3335 + set dummy $deplibs_check_method
  3336 + file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3337 + for a_deplib in $deplibs; do
  3338 + name="`expr $a_deplib : '-l\(.*\)'`"
  3339 + # If $name is empty we are operating on a -L argument.
  3340 + if test "$name" != "" && test "$name" != "0"; then
  3341 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3342 + case " $predeps $postdeps " in
  3343 + *" $a_deplib "*)
  3344 + newdeplibs="$newdeplibs $a_deplib"
  3345 + a_deplib=""
  3346 + ;;
  3347 + esac
  3348 + fi
  3349 + if test -n "$a_deplib" ; then
  3350 + libname=`eval \\$echo \"$libname_spec\"`
  3351 + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3352 + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3353 + for potent_lib in $potential_libs; do
  3354 + # Follow soft links.
  3355 + if ls -lLd "$potent_lib" 2>/dev/null \
  3356 + | grep " -> " >/dev/null; then
  3357 + continue
  3358 + fi
  3359 + # The statement above tries to avoid entering an
  3360 + # endless loop below, in case of cyclic links.
  3361 + # We might still enter an endless loop, since a link
  3362 + # loop can be closed while we follow links,
  3363 + # but so what?
  3364 + potlib="$potent_lib"
  3365 + while test -h "$potlib" 2>/dev/null; do
  3366 + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  3367 + case $potliblink in
  3368 + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  3369 + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  3370 + esac
  3371 + done
  3372 + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  3373 + | ${SED} 10q \
  3374 + | $EGREP "$file_magic_regex" > /dev/null; then
  3375 + newdeplibs="$newdeplibs $a_deplib"
  3376 + a_deplib=""
  3377 + break 2
  3378 + fi
  3379 + done
  3380 + done
  3381 + fi
  3382 + if test -n "$a_deplib" ; then
  3383 + droppeddeps=yes
  3384 + $echo
  3385 + $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3386 + $echo "*** I have the capability to make that library automatically link in when"
  3387 + $echo "*** you link to this library. But I can only do this if you have a"
  3388 + $echo "*** shared version of the library, which you do not appear to have"
  3389 + $echo "*** because I did check the linker path looking for a file starting"
  3390 + if test -z "$potlib" ; then
  3391 + $echo "*** with $libname but no candidates were found. (...for file magic test)"
  3392 + else
  3393 + $echo "*** with $libname and none of the candidates passed a file format test"
  3394 + $echo "*** using a file magic. Last file checked: $potlib"
  3395 + fi
  3396 + fi
  3397 + else
  3398 + # Add a -L argument.
  3399 + newdeplibs="$newdeplibs $a_deplib"
  3400 + fi
  3401 + done # Gone through all deplibs.
  3402 + ;;
  3403 + match_pattern*)
  3404 + set dummy $deplibs_check_method
  3405 + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3406 + for a_deplib in $deplibs; do
  3407 + name="`expr $a_deplib : '-l\(.*\)'`"
  3408 + # If $name is empty we are operating on a -L argument.
  3409 + if test -n "$name" && test "$name" != "0"; then
  3410 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3411 + case " $predeps $postdeps " in
  3412 + *" $a_deplib "*)
  3413 + newdeplibs="$newdeplibs $a_deplib"
  3414 + a_deplib=""
  3415 + ;;
  3416 + esac
  3417 + fi
  3418 + if test -n "$a_deplib" ; then
  3419 + libname=`eval \\$echo \"$libname_spec\"`
  3420 + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3421 + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3422 + for potent_lib in $potential_libs; do
  3423 + potlib="$potent_lib" # see symlink-check above in file_magic test
  3424 + if eval $echo \"$potent_lib\" 2>/dev/null \
  3425 + | ${SED} 10q \
  3426 + | $EGREP "$match_pattern_regex" > /dev/null; then
  3427 + newdeplibs="$newdeplibs $a_deplib"
  3428 + a_deplib=""
  3429 + break 2
  3430 + fi
  3431 + done
  3432 + done
  3433 + fi
  3434 + if test -n "$a_deplib" ; then
  3435 + droppeddeps=yes
  3436 + $echo
  3437 + $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3438 + $echo "*** I have the capability to make that library automatically link in when"
  3439 + $echo "*** you link to this library. But I can only do this if you have a"
  3440 + $echo "*** shared version of the library, which you do not appear to have"
  3441 + $echo "*** because I did check the linker path looking for a file starting"
  3442 + if test -z "$potlib" ; then
  3443 + $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  3444 + else
  3445 + $echo "*** with $libname and none of the candidates passed a file format test"
  3446 + $echo "*** using a regex pattern. Last file checked: $potlib"
  3447 + fi
  3448 + fi
  3449 + else
  3450 + # Add a -L argument.
  3451 + newdeplibs="$newdeplibs $a_deplib"
  3452 + fi
  3453 + done # Gone through all deplibs.
  3454 + ;;
  3455 + none | unknown | *)
  3456 + newdeplibs=""
  3457 + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  3458 + -e 's/ -[LR][^ ]*//g'`
  3459 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3460 + for i in $predeps $postdeps ; do
  3461 + # can't use Xsed below, because $i might contain '/'
  3462 + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  3463 + done
  3464 + fi
  3465 + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
  3466 + | grep . >/dev/null; then
  3467 + $echo
  3468 + if test "X$deplibs_check_method" = "Xnone"; then
  3469 + $echo "*** Warning: inter-library dependencies are not supported in this platform."
  3470 + else
  3471 + $echo "*** Warning: inter-library dependencies are not known to be supported."
  3472 + fi
  3473 + $echo "*** All declared inter-library dependencies are being dropped."
  3474 + droppeddeps=yes
  3475 + fi
  3476 + ;;
  3477 + esac
  3478 + versuffix=$versuffix_save
  3479 + major=$major_save
  3480 + release=$release_save
  3481 + libname=$libname_save
  3482 + name=$name_save
  3483 +
  3484 + case $host in
  3485 + *-*-rhapsody* | *-*-darwin1.[012])
  3486 + # On Rhapsody replace the C library is the System framework
  3487 + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3488 + ;;
  3489 + esac
  3490 +
  3491 + if test "$droppeddeps" = yes; then
  3492 + if test "$module" = yes; then
  3493 + $echo
  3494 + $echo "*** Warning: libtool could not satisfy all declared inter-library"
  3495 + $echo "*** dependencies of module $libname. Therefore, libtool will create"
  3496 + $echo "*** a static module, that should work as long as the dlopening"
  3497 + $echo "*** application is linked with the -dlopen flag."
  3498 + if test -z "$global_symbol_pipe"; then
  3499 + $echo
  3500 + $echo "*** However, this would only work if libtool was able to extract symbol"
  3501 + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  3502 + $echo "*** not find such a program. So, this module is probably useless."
  3503 + $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  3504 + fi
  3505 + if test "$build_old_libs" = no; then
  3506 + oldlibs="$output_objdir/$libname.$libext"
  3507 + build_libtool_libs=module
  3508 + build_old_libs=yes
  3509 + else
  3510 + build_libtool_libs=no
  3511 + fi
  3512 + else
  3513 + $echo "*** The inter-library dependencies that have been dropped here will be"
  3514 + $echo "*** automatically added whenever a program is linked with this library"
  3515 + $echo "*** or is declared to -dlopen it."
  3516 +
  3517 + if test "$allow_undefined" = no; then
  3518 + $echo
  3519 + $echo "*** Since this library must not contain undefined symbols,"
  3520 + $echo "*** because either the platform does not support them or"
  3521 + $echo "*** it was explicitly requested with -no-undefined,"
  3522 + $echo "*** libtool will only create a static version of it."
  3523 + if test "$build_old_libs" = no; then
  3524 + oldlibs="$output_objdir/$libname.$libext"
  3525 + build_libtool_libs=module
  3526 + build_old_libs=yes
  3527 + else
  3528 + build_libtool_libs=no
  3529 + fi
  3530 + fi
  3531 + fi
  3532 + fi
  3533 + # Done checking deplibs!
  3534 + deplibs=$newdeplibs
  3535 + fi
  3536 +
  3537 + # All the library-specific variables (install_libdir is set above).
  3538 + library_names=
  3539 + old_library=
  3540 + dlname=
  3541 +
  3542 + # Test again, we may have decided not to build it any more
  3543 + if test "$build_libtool_libs" = yes; then
  3544 + if test "$hardcode_into_libs" = yes; then
  3545 + # Hardcode the library paths
  3546 + hardcode_libdirs=
  3547 + dep_rpath=
  3548 + rpath="$finalize_rpath"
  3549 + test "$mode" != relink && rpath="$compile_rpath$rpath"
  3550 + for libdir in $rpath; do
  3551 + if test -n "$hardcode_libdir_flag_spec"; then
  3552 + if test -n "$hardcode_libdir_separator"; then
  3553 + if test -z "$hardcode_libdirs"; then
  3554 + hardcode_libdirs="$libdir"
  3555 + else
  3556 + # Just accumulate the unique libdirs.
  3557 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3558 + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3559 + ;;
  3560 + *)
  3561 + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3562 + ;;
  3563 + esac
  3564 + fi
  3565 + else
  3566 + eval flag=\"$hardcode_libdir_flag_spec\"
  3567 + dep_rpath="$dep_rpath $flag"
  3568 + fi
  3569 + elif test -n "$runpath_var"; then
  3570 + case "$perm_rpath " in
  3571 + *" $libdir "*) ;;
  3572 + *) perm_rpath="$perm_rpath $libdir" ;;
  3573 + esac
  3574 + fi
  3575 + done
  3576 + # Substitute the hardcoded libdirs into the rpath.
  3577 + if test -n "$hardcode_libdir_separator" &&
  3578 + test -n "$hardcode_libdirs"; then
  3579 + libdir="$hardcode_libdirs"
  3580 + if test -n "$hardcode_libdir_flag_spec_ld"; then
  3581 + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  3582 + else
  3583 + eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  3584 + fi
  3585 + fi
  3586 + if test -n "$runpath_var" && test -n "$perm_rpath"; then
  3587 + # We should set the runpath_var.
  3588 + rpath=
  3589 + for dir in $perm_rpath; do
  3590 + rpath="$rpath$dir:"
  3591 + done
  3592 + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  3593 + fi
  3594 + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  3595 + fi
  3596 +
  3597 + shlibpath="$finalize_shlibpath"
  3598 + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  3599 + if test -n "$shlibpath"; then
  3600 + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3601 + fi
  3602 +
  3603 + # Get the real and link names of the library.
  3604 + eval shared_ext=\"$shrext_cmds\"
  3605 + eval library_names=\"$library_names_spec\"
  3606 + set dummy $library_names
  3607 + realname="$2"
  3608 + shift; shift
  3609 +
  3610 + if test -n "$soname_spec"; then
  3611 + eval soname=\"$soname_spec\"
  3612 + else
  3613 + soname="$realname"
  3614 + fi
  3615 + if test -z "$dlname"; then
  3616 + dlname=$soname
  3617 + fi
  3618 +
  3619 + lib="$output_objdir/$realname"
  3620 + for link
  3621 + do
  3622 + linknames="$linknames $link"
  3623 + done
  3624 +
  3625 + # Use standard objects if they are pic
  3626 + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3627 +
  3628 + # Prepare the list of exported symbols
  3629 + if test -z "$export_symbols"; then
  3630 + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3631 + $show "generating symbol list for \`$libname.la'"
  3632 + export_symbols="$output_objdir/$libname.exp"
  3633 + $run $rm $export_symbols
  3634 + cmds=$export_symbols_cmds
  3635 + save_ifs="$IFS"; IFS='~'
  3636 + for cmd in $cmds; do
  3637 + IFS="$save_ifs"
  3638 + eval cmd=\"$cmd\"
  3639 + if len=`expr "X$cmd" : ".*"` &&
  3640 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3641 + $show "$cmd"
  3642 + $run eval "$cmd" || exit $?
  3643 + skipped_export=false
  3644 + else
  3645 + # The command line is too long to execute in one step.
  3646 + $show "using reloadable object file for export list..."
  3647 + skipped_export=:
  3648 + fi
  3649 + done
  3650 + IFS="$save_ifs"
  3651 + if test -n "$export_symbols_regex"; then
  3652 + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  3653 + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  3654 + $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  3655 + $run eval '$mv "${export_symbols}T" "$export_symbols"'
  3656 + fi
  3657 + fi
  3658 + fi
  3659 +
  3660 + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  3661 + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  3662 + fi
  3663 +
  3664 + tmp_deplibs=
  3665 + for test_deplib in $deplibs; do
  3666 + case " $convenience " in
  3667 + *" $test_deplib "*) ;;
  3668 + *)
  3669 + tmp_deplibs="$tmp_deplibs $test_deplib"
  3670 + ;;
  3671 + esac
  3672 + done
  3673 + deplibs="$tmp_deplibs"
  3674 +
  3675 + if test -n "$convenience"; then
  3676 + if test -n "$whole_archive_flag_spec"; then
  3677 + save_libobjs=$libobjs
  3678 + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3679 + else
  3680 + gentop="$output_objdir/${outputname}x"
  3681 + $show "${rm}r $gentop"
  3682 + $run ${rm}r "$gentop"
  3683 + $show "$mkdir $gentop"
  3684 + $run $mkdir "$gentop"
  3685 + status=$?
  3686 + if test "$status" -ne 0 && test ! -d "$gentop"; then
  3687 + exit $status
  3688 + fi
  3689 + generated="$generated $gentop"
  3690 +
  3691 + for xlib in $convenience; do
  3692 + # Extract the objects.
  3693 + case $xlib in
  3694 + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3695 + *) xabs=`pwd`"/$xlib" ;;
  3696 + esac
  3697 + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3698 + xdir="$gentop/$xlib"
  3699 +
  3700 + $show "${rm}r $xdir"
  3701 + $run ${rm}r "$xdir"
  3702 + $show "$mkdir $xdir"
  3703 + $run $mkdir "$xdir"
  3704 + status=$?
  3705 + if test "$status" -ne 0 && test ! -d "$xdir"; then
  3706 + exit $status
  3707 + fi
  3708 + # We will extract separately just the conflicting names and we will no
  3709 + # longer touch any unique names. It is faster to leave these extract
  3710 + # automatically by $AR in one run.
  3711 + $show "(cd $xdir && $AR x $xabs)"
  3712 + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3713 + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  3714 + :
  3715 + else
  3716 + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  3717 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  3718 + $AR t "$xabs" | sort | uniq -cd | while read -r count name
  3719 + do
  3720 + i=1
  3721 + while test "$i" -le "$count"
  3722 + do
  3723 + # Put our $i before any first dot (extension)
  3724 + # Never overwrite any file
  3725 + name_to="$name"
  3726 + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  3727 + do
  3728 + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  3729 + done
  3730 + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  3731 + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  3732 + i=`expr $i + 1`
  3733 + done
  3734 + done
  3735 + fi
  3736 +
  3737 + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  3738 + done
  3739 + fi
  3740 + fi
  3741 +
  3742 + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3743 + eval flag=\"$thread_safe_flag_spec\"
  3744 + linker_flags="$linker_flags $flag"
  3745 + fi
  3746 +
  3747 + # Make a backup of the uninstalled library when relinking
  3748 + if test "$mode" = relink; then
  3749 + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  3750 + fi
  3751 +
  3752 + # Do each of the archive commands.
  3753 + if test "$module" = yes && test -n "$module_cmds" ; then
  3754 + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3755 + eval test_cmds=\"$module_expsym_cmds\"
  3756 + cmds=$module_expsym_cmds
  3757 + else
  3758 + eval test_cmds=\"$module_cmds\"
  3759 + cmds=$module_cmds
  3760 + fi
  3761 + else
  3762 + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3763 + eval test_cmds=\"$archive_expsym_cmds\"
  3764 + cmds=$archive_expsym_cmds
  3765 + else
  3766 + eval test_cmds=\"$archive_cmds\"
  3767 + cmds=$archive_cmds
  3768 + fi
  3769 + fi
  3770 +
  3771 + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
  3772 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3773 + :
  3774 + else
  3775 + # The command line is too long to link in one step, link piecewise.
  3776 + $echo "creating reloadable object files..."
  3777 +
  3778 + # Save the value of $output and $libobjs because we want to
  3779 + # use them later. If we have whole_archive_flag_spec, we
  3780 + # want to use save_libobjs as it was before
  3781 + # whole_archive_flag_spec was expanded, because we can't
  3782 + # assume the linker understands whole_archive_flag_spec.
  3783 + # This may have to be revisited, in case too many
  3784 + # convenience libraries get linked in and end up exceeding
  3785 + # the spec.
  3786 + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  3787 + save_libobjs=$libobjs
  3788 + fi
  3789 + save_output=$output
  3790 +
  3791 + # Clear the reloadable object creation command queue and
  3792 + # initialize k to one.
  3793 + test_cmds=
  3794 + concat_cmds=
  3795 + objlist=
  3796 + delfiles=
  3797 + last_robj=
  3798 + k=1
  3799 + output=$output_objdir/$save_output-${k}.$objext
  3800 + # Loop over the list of objects to be linked.
  3801 + for obj in $save_libobjs
  3802 + do
  3803 + eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  3804 + if test "X$objlist" = X ||
  3805 + { len=`expr "X$test_cmds" : ".*"` &&
  3806 + test "$len" -le "$max_cmd_len"; }; then
  3807 + objlist="$objlist $obj"
  3808 + else
  3809 + # The command $test_cmds is almost too long, add a
  3810 + # command to the queue.
  3811 + if test "$k" -eq 1 ; then
  3812 + # The first file doesn't have a previous command to add.
  3813 + eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  3814 + else
  3815 + # All subsequent reloadable object files will link in
  3816 + # the last one created.
  3817 + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  3818 + fi
  3819 + last_robj=$output_objdir/$save_output-${k}.$objext
  3820 + k=`expr $k + 1`
  3821 + output=$output_objdir/$save_output-${k}.$objext
  3822 + objlist=$obj
  3823 + len=1
  3824 + fi
  3825 + done
  3826 + # Handle the remaining objects by creating one last
  3827 + # reloadable object file. All subsequent reloadable object
  3828 + # files will link in the last one created.
  3829 + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3830 + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  3831 +
  3832 + if ${skipped_export-false}; then
  3833 + $show "generating symbol list for \`$libname.la'"
  3834 + export_symbols="$output_objdir/$libname.exp"
  3835 + $run $rm $export_symbols
  3836 + libobjs=$output
  3837 + # Append the command to create the export file.
  3838 + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  3839 + fi
  3840 +
  3841 + # Set up a command to remove the reloadale object files
  3842 + # after they are used.
  3843 + i=0
  3844 + while test "$i" -lt "$k"
  3845 + do
  3846 + i=`expr $i + 1`
  3847 + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
  3848 + done
  3849 +
  3850 + $echo "creating a temporary reloadable object file: $output"
  3851 +
  3852 + # Loop through the commands generated above and execute them.
  3853 + save_ifs="$IFS"; IFS='~'
  3854 + for cmd in $concat_cmds; do
  3855 + IFS="$save_ifs"
  3856 + $show "$cmd"
  3857 + $run eval "$cmd" || exit $?
  3858 + done
  3859 + IFS="$save_ifs"
  3860 +
  3861 + libobjs=$output
  3862 + # Restore the value of output.
  3863 + output=$save_output
  3864 +
  3865 + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  3866 + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3867 + fi
  3868 + # Expand the library linking commands again to reset the
  3869 + # value of $libobjs for piecewise linking.
  3870 +
  3871 + # Do each of the archive commands.
  3872 + if test "$module" = yes && test -n "$module_cmds" ; then
  3873 + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3874 + cmds=$module_expsym_cmds
  3875 + else
  3876 + cmds=$module_cmds
  3877 + fi
  3878 + else
  3879 + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3880 + cmds=$archive_expsym_cmds
  3881 + else
  3882 + cmds=$archive_cmds
  3883 + fi
  3884 + fi
  3885 +
  3886 + # Append the command to remove the reloadable object files
  3887 + # to the just-reset $cmds.
  3888 + eval cmds=\"\$cmds~\$rm $delfiles\"
  3889 + fi
  3890 + save_ifs="$IFS"; IFS='~'
  3891 + for cmd in $cmds; do
  3892 + IFS="$save_ifs"
  3893 + eval cmd=\"$cmd\"
  3894 + $show "$cmd"
  3895 + $run eval "$cmd" || exit $?
  3896 + done
  3897 + IFS="$save_ifs"
  3898 +
  3899 + # Restore the uninstalled library and exit
  3900 + if test "$mode" = relink; then
  3901 + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  3902 + exit $EXIT_SUCCESS
  3903 + fi
  3904 +
  3905 + # Create links to the real library.
  3906 + for linkname in $linknames; do
  3907 + if test "$realname" != "$linkname"; then
  3908 + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  3909 + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  3910 + fi
  3911 + done
  3912 +
  3913 + # If -module or -export-dynamic was specified, set the dlname.
  3914 + if test "$module" = yes || test "$export_dynamic" = yes; then
  3915 + # On all known operating systems, these are identical.
  3916 + dlname="$soname"
  3917 + fi
  3918 + fi
  3919 + ;;
  3920 +
  3921 + obj)
  3922 + if test -n "$deplibs"; then
  3923 + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  3924 + fi
  3925 +
  3926 + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3927 + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  3928 + fi
  3929 +
  3930 + if test -n "$rpath"; then
  3931 + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  3932 + fi
  3933 +
  3934 + if test -n "$xrpath"; then
  3935 + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  3936 + fi
  3937 +
  3938 + if test -n "$vinfo"; then
  3939 + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  3940 + fi
  3941 +
  3942 + if test -n "$release"; then
  3943 + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  3944 + fi
  3945 +
  3946 + case $output in
  3947 + *.lo)
  3948 + if test -n "$objs$old_deplibs"; then
  3949 + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  3950 + exit $EXIT_FAILURE
  3951 + fi
  3952 + libobj="$output"
  3953 + obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  3954 + ;;
  3955 + *)
  3956 + libobj=
  3957 + obj="$output"
  3958 + ;;
  3959 + esac
  3960 +
  3961 + # Delete the old objects.
  3962 + $run $rm $obj $libobj
  3963 +
  3964 + # Objects from convenience libraries. This assumes
  3965 + # single-version convenience libraries. Whenever we create
  3966 + # different ones for PIC/non-PIC, this we'll have to duplicate
  3967 + # the extraction.
  3968 + reload_conv_objs=
  3969 + gentop=
  3970 + # reload_cmds runs $LD directly, so let us get rid of
  3971 + # -Wl from whole_archive_flag_spec
  3972 + wl=
  3973 +
  3974 + if test -n "$convenience"; then
  3975 + if test -n "$whole_archive_flag_spec"; then
  3976 + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  3977 + else
  3978 + gentop="$output_objdir/${obj}x"
  3979 + $show "${rm}r $gentop"
  3980 + $run ${rm}r "$gentop"
  3981 + $show "$mkdir $gentop"
  3982 + $run $mkdir "$gentop"
  3983 + status=$?
  3984 + if test "$status" -ne 0 && test ! -d "$gentop"; then
  3985 + exit $status
  3986 + fi
  3987 + generated="$generated $gentop"
  3988 +
  3989 + for xlib in $convenience; do
  3990 + # Extract the objects.
  3991 + case $xlib in
  3992 + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3993 + *) xabs=`pwd`"/$xlib" ;;
  3994 + esac
  3995 + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3996 + xdir="$gentop/$xlib"
  3997 +
  3998 + $show "${rm}r $xdir"
  3999 + $run ${rm}r "$xdir"
  4000 + $show "$mkdir $xdir"
  4001 + $run $mkdir "$xdir"
  4002 + status=$?
  4003 + if test "$status" -ne 0 && test ! -d "$xdir"; then
  4004 + exit $status
  4005 + fi
  4006 + # We will extract separately just the conflicting names and we will no
  4007 + # longer touch any unique names. It is faster to leave these extract
  4008 + # automatically by $AR in one run.
  4009 + $show "(cd $xdir && $AR x $xabs)"
  4010 + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  4011 + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  4012 + :
  4013 + else
  4014 + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  4015 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  4016 + $AR t "$xabs" | sort | uniq -cd | while read -r count name
  4017 + do
  4018 + i=1
  4019 + while test "$i" -le "$count"
  4020 + do
  4021 + # Put our $i before any first dot (extension)
  4022 + # Never overwrite any file
  4023 + name_to="$name"
  4024 + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  4025 + do
  4026 + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  4027 + done
  4028 + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  4029 + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  4030 + i=`expr $i + 1`
  4031 + done
  4032 + done
  4033 + fi
  4034 +
  4035 + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  4036 + done
  4037 + fi
  4038 + fi
  4039 +
  4040 + # Create the old-style object.
  4041 + 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
  4042 +
  4043 + output="$obj"
  4044 + cmds=$reload_cmds
  4045 + save_ifs="$IFS"; IFS='~'
  4046 + for cmd in $cmds; do
  4047 + IFS="$save_ifs"
  4048 + eval cmd=\"$cmd\"
  4049 + $show "$cmd"
  4050 + $run eval "$cmd" || exit $?
  4051 + done
  4052 + IFS="$save_ifs"
  4053 +
  4054 + # Exit if we aren't doing a library object file.
  4055 + if test -z "$libobj"; then
  4056 + if test -n "$gentop"; then
  4057 + $show "${rm}r $gentop"
  4058 + $run ${rm}r $gentop
  4059 + fi
  4060 +
  4061 + exit $EXIT_SUCCESS
  4062 + fi
  4063 +
  4064 + if test "$build_libtool_libs" != yes; then
  4065 + if test -n "$gentop"; then
  4066 + $show "${rm}r $gentop"
  4067 + $run ${rm}r $gentop
  4068 + fi
  4069 +
  4070 + # Create an invalid libtool object if no PIC, so that we don't
  4071 + # accidentally link it into a program.
  4072 + # $show "echo timestamp > $libobj"
  4073 + # $run eval "echo timestamp > $libobj" || exit $?
  4074 + exit $EXIT_SUCCESS
  4075 + fi
  4076 +
  4077 + if test -n "$pic_flag" || test "$pic_mode" != default; then
  4078 + # Only do commands if we really have different PIC objects.
  4079 + reload_objs="$libobjs $reload_conv_objs"
  4080 + output="$libobj"
  4081 + cmds=$reload_cmds
  4082 + save_ifs="$IFS"; IFS='~'
  4083 + for cmd in $cmds; do
  4084 + IFS="$save_ifs"
  4085 + eval cmd=\"$cmd\"
  4086 + $show "$cmd"
  4087 + $run eval "$cmd" || exit $?
  4088 + done
  4089 + IFS="$save_ifs"
  4090 + fi
  4091 +
  4092 + if test -n "$gentop"; then
  4093 + $show "${rm}r $gentop"
  4094 + $run ${rm}r $gentop
  4095 + fi
  4096 +
  4097 + exit $EXIT_SUCCESS
  4098 + ;;
  4099 +
  4100 + prog)
  4101 + case $host in
  4102 + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  4103 + esac
  4104 + if test -n "$vinfo"; then
  4105 + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  4106 + fi
  4107 +
  4108 + if test -n "$release"; then
  4109 + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  4110 + fi
  4111 +
  4112 + if test "$preload" = yes; then
  4113 + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  4114 + test "$dlopen_self_static" = unknown; then
  4115 + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  4116 + fi
  4117 + fi
  4118 +
  4119 + case $host in
  4120 + *-*-rhapsody* | *-*-darwin1.[012])
  4121 + # On Rhapsody replace the C library is the System framework
  4122 + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  4123 + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  4124 + ;;
  4125 + esac
  4126 +
  4127 + case $host in
  4128 + *darwin*)
  4129 + # Don't allow lazy linking, it breaks C++ global constructors
  4130 + if test "$tagname" = CXX ; then
  4131 + compile_command="$compile_command ${wl}-bind_at_load"
  4132 + finalize_command="$finalize_command ${wl}-bind_at_load"
  4133 + fi
  4134 + ;;
  4135 + esac
  4136 +
  4137 + compile_command="$compile_command $compile_deplibs"
  4138 + finalize_command="$finalize_command $finalize_deplibs"
  4139 +
  4140 + if test -n "$rpath$xrpath"; then
  4141 + # If the user specified any rpath flags, then add them.
  4142 + for libdir in $rpath $xrpath; do
  4143 + # This is the magic to use -rpath.
  4144 + case "$finalize_rpath " in
  4145 + *" $libdir "*) ;;
  4146 + *) finalize_rpath="$finalize_rpath $libdir" ;;
  4147 + esac
  4148 + done
  4149 + fi
  4150 +
  4151 + # Now hardcode the library paths
  4152 + rpath=
  4153 + hardcode_libdirs=
  4154 + for libdir in $compile_rpath $finalize_rpath; do
  4155 + if test -n "$hardcode_libdir_flag_spec"; then
  4156 + if test -n "$hardcode_libdir_separator"; then
  4157 + if test -z "$hardcode_libdirs"; then
  4158 + hardcode_libdirs="$libdir"
  4159 + else
  4160 + # Just accumulate the unique libdirs.
  4161 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  4162 + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  4163 + ;;
  4164 + *)
  4165 + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  4166 + ;;
  4167 + esac
  4168 + fi
  4169 + else
  4170 + eval flag=\"$hardcode_libdir_flag_spec\"
  4171 + rpath="$rpath $flag"
  4172 + fi
  4173 + elif test -n "$runpath_var"; then
  4174 + case "$perm_rpath " in
  4175 + *" $libdir "*) ;;
  4176 + *) perm_rpath="$perm_rpath $libdir" ;;
  4177 + esac
  4178 + fi
  4179 + case $host in
  4180 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  4181 + case :$dllsearchpath: in
  4182 + *":$libdir:"*) ;;
  4183 + *) dllsearchpath="$dllsearchpath:$libdir";;
  4184 + esac
  4185 + ;;
  4186 + esac
  4187 + done
  4188 + # Substitute the hardcoded libdirs into the rpath.
  4189 + if test -n "$hardcode_libdir_separator" &&
  4190 + test -n "$hardcode_libdirs"; then
  4191 + libdir="$hardcode_libdirs"
  4192 + eval rpath=\" $hardcode_libdir_flag_spec\"
  4193 + fi
  4194 + compile_rpath="$rpath"
  4195 +
  4196 + rpath=
  4197 + hardcode_libdirs=
  4198 + for libdir in $finalize_rpath; do
  4199 + if test -n "$hardcode_libdir_flag_spec"; then
  4200 + if test -n "$hardcode_libdir_separator"; then
  4201 + if test -z "$hardcode_libdirs"; then
  4202 + hardcode_libdirs="$libdir"
  4203 + else
  4204 + # Just accumulate the unique libdirs.
  4205 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  4206 + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  4207 + ;;
  4208 + *)
  4209 + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  4210 + ;;
  4211 + esac
  4212 + fi
  4213 + else
  4214 + eval flag=\"$hardcode_libdir_flag_spec\"
  4215 + rpath="$rpath $flag"
  4216 + fi
  4217 + elif test -n "$runpath_var"; then
  4218 + case "$finalize_perm_rpath " in
  4219 + *" $libdir "*) ;;
  4220 + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  4221 + esac
  4222 + fi
  4223 + done
  4224 + # Substitute the hardcoded libdirs into the rpath.
  4225 + if test -n "$hardcode_libdir_separator" &&
  4226 + test -n "$hardcode_libdirs"; then
  4227 + libdir="$hardcode_libdirs"
  4228 + eval rpath=\" $hardcode_libdir_flag_spec\"
  4229 + fi
  4230 + finalize_rpath="$rpath"
  4231 +
  4232 + if test -n "$libobjs" && test "$build_old_libs" = yes; then
  4233 + # Transform all the library objects into standard objects.
  4234 + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4235 + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4236 + fi
  4237 +
  4238 + dlsyms=
  4239 + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  4240 + if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4241 + dlsyms="${outputname}S.c"
  4242 + else
  4243 + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  4244 + fi
  4245 + fi
  4246 +
  4247 + if test -n "$dlsyms"; then
  4248 + case $dlsyms in
  4249 + "") ;;
  4250 + *.c)
  4251 + # Discover the nlist of each of the dlfiles.
  4252 + nlist="$output_objdir/${outputname}.nm"
  4253 +
  4254 + $show "$rm $nlist ${nlist}S ${nlist}T"
  4255 + $run $rm "$nlist" "${nlist}S" "${nlist}T"
  4256 +
  4257 + # Parse the name list into a source file.
  4258 + $show "creating $output_objdir/$dlsyms"
  4259 +
  4260 + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  4261 +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  4262 +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  4263 +
  4264 +#ifdef __cplusplus
  4265 +extern \"C\" {
  4266 +#endif
  4267 +
  4268 +/* Prevent the only kind of declaration conflicts we can make. */
  4269 +#define lt_preloaded_symbols some_other_symbol
  4270 +
  4271 +/* External symbol declarations for the compiler. */\
  4272 +"
  4273 +
  4274 + if test "$dlself" = yes; then
  4275 + $show "generating symbol list for \`$output'"
  4276 +
  4277 + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  4278 +
  4279 + # Add our own program objects to the symbol list.
  4280 + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4281 + for arg in $progfiles; do
  4282 + $show "extracting global C symbols from \`$arg'"
  4283 + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4284 + done
  4285 +
  4286 + if test -n "$exclude_expsyms"; then
  4287 + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4288 + $run eval '$mv "$nlist"T "$nlist"'
  4289 + fi
  4290 +
  4291 + if test -n "$export_symbols_regex"; then
  4292 + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4293 + $run eval '$mv "$nlist"T "$nlist"'
  4294 + fi
  4295 +
  4296 + # Prepare the list of exported symbols
  4297 + if test -z "$export_symbols"; then
  4298 + export_symbols="$output_objdir/$output.exp"
  4299 + $run $rm $export_symbols
  4300 + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4301 + else
  4302 + $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  4303 + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  4304 + $run eval 'mv "$nlist"T "$nlist"'
  4305 + fi
  4306 + fi
  4307 +
  4308 + for arg in $dlprefiles; do
  4309 + $show "extracting global C symbols from \`$arg'"
  4310 + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  4311 + $run eval '$echo ": $name " >> "$nlist"'
  4312 + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4313 + done
  4314 +
  4315 + if test -z "$run"; then
  4316 + # Make sure we have at least an empty file.
  4317 + test -f "$nlist" || : > "$nlist"
  4318 +
  4319 + if test -n "$exclude_expsyms"; then
  4320 + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4321 + $mv "$nlist"T "$nlist"
  4322 + fi
  4323 +
  4324 + # Try sorting and uniquifying the output.
  4325 + if grep -v "^: " < "$nlist" |
  4326 + if sort -k 3 </dev/null >/dev/null 2>&1; then
  4327 + sort -k 3
  4328 + else
  4329 + sort +2
  4330 + fi |
  4331 + uniq > "$nlist"S; then
  4332 + :
  4333 + else
  4334 + grep -v "^: " < "$nlist" > "$nlist"S
  4335 + fi
  4336 +
  4337 + if test -f "$nlist"S; then
  4338 + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  4339 + else
  4340 + $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  4341 + fi
  4342 +
  4343 + $echo >> "$output_objdir/$dlsyms" "\
  4344 +
  4345 +#undef lt_preloaded_symbols
  4346 +
  4347 +#if defined (__STDC__) && __STDC__
  4348 +# define lt_ptr void *
  4349 +#else
  4350 +# define lt_ptr char *
  4351 +# define const
  4352 +#endif
  4353 +
  4354 +/* The mapping between symbol names and symbols. */
  4355 +const struct {
  4356 + const char *name;
  4357 + lt_ptr address;
  4358 +}
  4359 +lt_preloaded_symbols[] =
  4360 +{\
  4361 +"
  4362 +
  4363 + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  4364 +
  4365 + $echo >> "$output_objdir/$dlsyms" "\
  4366 + {0, (lt_ptr) 0}
  4367 +};
  4368 +
  4369 +/* This works around a problem in FreeBSD linker */
  4370 +#ifdef FREEBSD_WORKAROUND
  4371 +static const void *lt_preloaded_setup() {
  4372 + return lt_preloaded_symbols;
  4373 +}
  4374 +#endif
  4375 +
  4376 +#ifdef __cplusplus
  4377 +}
  4378 +#endif\
  4379 +"
  4380 + fi
  4381 +
  4382 + pic_flag_for_symtable=
  4383 + case $host in
  4384 + # compiling the symbol table file with pic_flag works around
  4385 + # a FreeBSD bug that causes programs to crash when -lm is
  4386 + # linked before any other PIC object. But we must not use
  4387 + # pic_flag when linking with -static. The problem exists in
  4388 + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4389 + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4390 + case "$compile_command " in
  4391 + *" -static "*) ;;
  4392 + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  4393 + esac;;
  4394 + *-*-hpux*)
  4395 + case "$compile_command " in
  4396 + *" -static "*) ;;
  4397 + *) pic_flag_for_symtable=" $pic_flag";;
  4398 + esac
  4399 + esac
  4400 +
  4401 + # Now compile the dynamic symbol file.
  4402 + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  4403 + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  4404 +
  4405 + # Clean up the generated files.
  4406 + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  4407 + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  4408 +
  4409 + # Transform the symbol file into the correct name.
  4410 + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4411 + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4412 + ;;
  4413 + *)
  4414 + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4415 + exit $EXIT_FAILURE
  4416 + ;;
  4417 + esac
  4418 + else
  4419 + # We keep going just in case the user didn't refer to
  4420 + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4421 + # really was required.
  4422 +
  4423 + # Nullify the symbol file.
  4424 + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  4425 + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  4426 + fi
  4427 +
  4428 + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  4429 + # Replace the output file specification.
  4430 + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4431 + link_command="$compile_command$compile_rpath"
  4432 +
  4433 + # We have no uninstalled library dependencies, so finalize right now.
  4434 + $show "$link_command"
  4435 + $run eval "$link_command"
  4436 + status=$?
  4437 +
  4438 + # Delete the generated files.
  4439 + if test -n "$dlsyms"; then
  4440 + $show "$rm $output_objdir/${outputname}S.${objext}"
  4441 + $run $rm "$output_objdir/${outputname}S.${objext}"
  4442 + fi
  4443 +
  4444 + exit $status
  4445 + fi
  4446 +
  4447 + if test -n "$shlibpath_var"; then
  4448 + # We should set the shlibpath_var
  4449 + rpath=
  4450 + for dir in $temp_rpath; do
  4451 + case $dir in
  4452 + [\\/]* | [A-Za-z]:[\\/]*)
  4453 + # Absolute path.
  4454 + rpath="$rpath$dir:"
  4455 + ;;
  4456 + *)
  4457 + # Relative path: add a thisdir entry.
  4458 + rpath="$rpath\$thisdir/$dir:"
  4459 + ;;
  4460 + esac
  4461 + done
  4462 + temp_rpath="$rpath"
  4463 + fi
  4464 +
  4465 + if test -n "$compile_shlibpath$finalize_shlibpath"; then
  4466 + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  4467 + fi
  4468 + if test -n "$finalize_shlibpath"; then
  4469 + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  4470 + fi
  4471 +
  4472 + compile_var=
  4473 + finalize_var=
  4474 + if test -n "$runpath_var"; then
  4475 + if test -n "$perm_rpath"; then
  4476 + # We should set the runpath_var.
  4477 + rpath=
  4478 + for dir in $perm_rpath; do
  4479 + rpath="$rpath$dir:"
  4480 + done
  4481 + compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4482 + fi
  4483 + if test -n "$finalize_perm_rpath"; then
  4484 + # We should set the runpath_var.
  4485 + rpath=
  4486 + for dir in $finalize_perm_rpath; do
  4487 + rpath="$rpath$dir:"
  4488 + done
  4489 + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4490 + fi
  4491 + fi
  4492 +
  4493 + if test "$no_install" = yes; then
  4494 + # We don't need to create a wrapper script.
  4495 + link_command="$compile_var$compile_command$compile_rpath"
  4496 + # Replace the output file specification.
  4497 + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4498 + # Delete the old output file.
  4499 + $run $rm $output
  4500 + # Link the executable and exit
  4501 + $show "$link_command"
  4502 + $run eval "$link_command" || exit $?
  4503 + exit $EXIT_SUCCESS
  4504 + fi
  4505 +
  4506 + if test "$hardcode_action" = relink; then
  4507 + # Fast installation is not supported
  4508 + link_command="$compile_var$compile_command$compile_rpath"
  4509 + relink_command="$finalize_var$finalize_command$finalize_rpath"
  4510 +
  4511 + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  4512 + $echo "$modename: \`$output' will be relinked during installation" 1>&2
  4513 + else
  4514 + if test "$fast_install" != no; then
  4515 + link_command="$finalize_var$compile_command$finalize_rpath"
  4516 + if test "$fast_install" = yes; then
  4517 + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  4518 + else
  4519 + # fast_install is set to needless
  4520 + relink_command=
  4521 + fi
  4522 + else
  4523 + link_command="$compile_var$compile_command$compile_rpath"
  4524 + relink_command="$finalize_var$finalize_command$finalize_rpath"
  4525 + fi
  4526 + fi
  4527 +
  4528 + # Replace the output file specification.
  4529 + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  4530 +
  4531 + # Delete the old output files.
  4532 + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  4533 +
  4534 + $show "$link_command"
  4535 + $run eval "$link_command" || exit $?
  4536 +
  4537 + # Now create the wrapper script.
  4538 + $show "creating $output"
  4539 +
  4540 + # Quote the relink command for shipping.
  4541 + if test -n "$relink_command"; then
  4542 + # Preserve any variables that may affect compiler behavior
  4543 + for var in $variables_saved_for_relink; do
  4544 + if eval test -z \"\${$var+set}\"; then
  4545 + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4546 + elif eval var_value=\$$var; test -z "$var_value"; then
  4547 + relink_command="$var=; export $var; $relink_command"
  4548 + else
  4549 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4550 + relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4551 + fi
  4552 + done
  4553 + relink_command="(cd `pwd`; $relink_command)"
  4554 + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4555 + fi
  4556 +
  4557 + # Quote $echo for shipping.
  4558 + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  4559 + case $progpath in
  4560 + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  4561 + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  4562 + esac
  4563 + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4564 + else
  4565 + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4566 + fi
  4567 +
  4568 + # Only actually do things if our run command is non-null.
  4569 + if test -z "$run"; then
  4570 + # win32 will think the script is a binary if it has
  4571 + # a .exe suffix, so we strip it off here.
  4572 + case $output in
  4573 + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  4574 + esac
  4575 + # test for cygwin because mv fails w/o .exe extensions
  4576 + case $host in
  4577 + *cygwin*)
  4578 + exeext=.exe
  4579 + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  4580 + *) exeext= ;;
  4581 + esac
  4582 + case $host in
  4583 + *cygwin* | *mingw* )
  4584 + cwrappersource=`$echo ${objdir}/lt-${output}.c`
  4585 + cwrapper=`$echo ${output}.exe`
  4586 + $rm $cwrappersource $cwrapper
  4587 + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  4588 +
  4589 + cat > $cwrappersource <<EOF
  4590 +
  4591 +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4592 + Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4593 +
  4594 + The $output program cannot be directly executed until all the libtool
  4595 + libraries that it depends on are installed.
  4596 +
  4597 + This wrapper executable should never be moved out of the build directory.
  4598 + If it is, it will not operate correctly.
  4599 +
  4600 + Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4601 + but could eventually absorb all of the scripts functionality and
  4602 + exec $objdir/$outputname directly.
  4603 +*/
  4604 +EOF
  4605 + cat >> $cwrappersource<<"EOF"
  4606 +#include <stdio.h>
  4607 +#include <stdlib.h>
  4608 +#include <unistd.h>
  4609 +#include <malloc.h>
  4610 +#include <stdarg.h>
  4611 +#include <assert.h>
  4612 +
  4613 +#if defined(PATH_MAX)
  4614 +# define LT_PATHMAX PATH_MAX
  4615 +#elif defined(MAXPATHLEN)
  4616 +# define LT_PATHMAX MAXPATHLEN
  4617 +#else
  4618 +# define LT_PATHMAX 1024
  4619 +#endif
  4620 +
  4621 +#ifndef DIR_SEPARATOR
  4622 +#define DIR_SEPARATOR '/'
  4623 +#endif
  4624 +
  4625 +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4626 + defined (__OS2__)
  4627 +#define HAVE_DOS_BASED_FILE_SYSTEM
  4628 +#ifndef DIR_SEPARATOR_2
  4629 +#define DIR_SEPARATOR_2 '\\'
  4630 +#endif
  4631 +#endif
  4632 +
  4633 +#ifndef DIR_SEPARATOR_2
  4634 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4635 +#else /* DIR_SEPARATOR_2 */
  4636 +# define IS_DIR_SEPARATOR(ch) \
  4637 + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4638 +#endif /* DIR_SEPARATOR_2 */
  4639 +
  4640 +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  4641 +#define XFREE(stale) do { \
  4642 + if (stale) { free ((void *) stale); stale = 0; } \
  4643 +} while (0)
  4644 +
  4645 +const char *program_name = NULL;
  4646 +
  4647 +void * xmalloc (size_t num);
  4648 +char * xstrdup (const char *string);
  4649 +char * basename (const char *name);
  4650 +char * fnqualify(const char *path);
  4651 +char * strendzap(char *str, const char *pat);
  4652 +void lt_fatal (const char *message, ...);
  4653 +
  4654 +int
  4655 +main (int argc, char *argv[])
  4656 +{
  4657 + char **newargz;
  4658 + int i;
  4659 +
  4660 + program_name = (char *) xstrdup ((char *) basename (argv[0]));
  4661 + newargz = XMALLOC(char *, argc+2);
  4662 +EOF
  4663 +
  4664 + cat >> $cwrappersource <<EOF
  4665 + newargz[0] = "$SHELL";
  4666 +EOF
  4667 +
  4668 + cat >> $cwrappersource <<"EOF"
  4669 + newargz[1] = fnqualify(argv[0]);
  4670 + /* we know the script has the same name, without the .exe */
  4671 + /* so make sure newargz[1] doesn't end in .exe */
  4672 + strendzap(newargz[1],".exe");
  4673 + for (i = 1; i < argc; i++)
  4674 + newargz[i+1] = xstrdup(argv[i]);
  4675 + newargz[argc+1] = NULL;
  4676 +EOF
  4677 +
  4678 + cat >> $cwrappersource <<EOF
  4679 + execv("$SHELL",newargz);
  4680 +EOF
  4681 +
  4682 + cat >> $cwrappersource <<"EOF"
  4683 +}
  4684 +
  4685 +void *
  4686 +xmalloc (size_t num)
  4687 +{
  4688 + void * p = (void *) malloc (num);
  4689 + if (!p)
  4690 + lt_fatal ("Memory exhausted");
  4691 +
  4692 + return p;
  4693 +}
  4694 +
  4695 +char *
  4696 +xstrdup (const char *string)
  4697 +{
  4698 + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4699 +;
  4700 +}
  4701 +
  4702 +char *
  4703 +basename (const char *name)
  4704 +{
  4705 + const char *base;
  4706 +
  4707 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4708 + /* Skip over the disk name in MSDOS pathnames. */
  4709 + if (isalpha (name[0]) && name[1] == ':')
  4710 + name += 2;
  4711 +#endif
  4712 +
  4713 + for (base = name; *name; name++)
  4714 + if (IS_DIR_SEPARATOR (*name))
  4715 + base = name + 1;
  4716 + return (char *) base;
  4717 +}
  4718 +
  4719 +char *
  4720 +fnqualify(const char *path)
  4721 +{
  4722 + size_t size;
  4723 + char *p;
  4724 + char tmp[LT_PATHMAX + 1];
  4725 +
  4726 + assert(path != NULL);
  4727 +
  4728 + /* Is it qualified already? */
  4729 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4730 + if (isalpha (path[0]) && path[1] == ':')
  4731 + return xstrdup (path);
  4732 +#endif
  4733 + if (IS_DIR_SEPARATOR (path[0]))
  4734 + return xstrdup (path);
  4735 +
  4736 + /* prepend the current directory */
  4737 + /* doesn't handle '~' */
  4738 + if (getcwd (tmp, LT_PATHMAX) == NULL)
  4739 + lt_fatal ("getcwd failed");
  4740 + size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
  4741 + p = XMALLOC(char, size);
  4742 + sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
  4743 + return p;
  4744 +}
  4745 +
  4746 +char *
  4747 +strendzap(char *str, const char *pat)
  4748 +{
  4749 + size_t len, patlen;
  4750 +
  4751 + assert(str != NULL);
  4752 + assert(pat != NULL);
  4753 +
  4754 + len = strlen(str);
  4755 + patlen = strlen(pat);
  4756 +
  4757 + if (patlen <= len)
  4758 + {
  4759 + str += len - patlen;
  4760 + if (strcmp(str, pat) == 0)
  4761 + *str = '\0';
  4762 + }
  4763 + return str;
  4764 +}
  4765 +
  4766 +static void
  4767 +lt_error_core (int exit_status, const char * mode,
  4768 + const char * message, va_list ap)
  4769 +{
  4770 + fprintf (stderr, "%s: %s: ", program_name, mode);
  4771 + vfprintf (stderr, message, ap);
  4772 + fprintf (stderr, ".\n");
  4773 +
  4774 + if (exit_status >= 0)
  4775 + exit (exit_status);
  4776 +}
  4777 +
  4778 +void
  4779 +lt_fatal (const char *message, ...)
  4780 +{
  4781 + va_list ap;
  4782 + va_start (ap, message);
  4783 + lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  4784 + va_end (ap);
  4785 +}
  4786 +EOF
  4787 + # we should really use a build-platform specific compiler
  4788 + # here, but OTOH, the wrappers (shell script and this C one)
  4789 + # are only useful if you want to execute the "real" binary.
  4790 + # Since the "real" binary is built for $host, then this
  4791 + # wrapper might as well be built for $host, too.
  4792 + $run $LTCC -s -o $cwrapper $cwrappersource
  4793 + ;;
  4794 + esac
  4795 + $rm $output
  4796 + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  4797 +
  4798 + $echo > $output "\
  4799 +#! $SHELL
  4800 +
  4801 +# $output - temporary wrapper script for $objdir/$outputname
  4802 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4803 +#
  4804 +# The $output program cannot be directly executed until all the libtool
  4805 +# libraries that it depends on are installed.
  4806 +#
  4807 +# This wrapper script should never be moved out of the build directory.
  4808 +# If it is, it will not operate correctly.
  4809 +
  4810 +# Sed substitution that helps us do robust quoting. It backslashifies
  4811 +# metacharacters that are still active within double-quoted strings.
  4812 +Xsed='${SED} -e 1s/^X//'
  4813 +sed_quote_subst='$sed_quote_subst'
  4814 +
  4815 +# The HP-UX ksh and POSIX shell print the target directory to stdout
  4816 +# if CDPATH is set.
  4817 +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  4818 +
  4819 +relink_command=\"$relink_command\"
  4820 +
  4821 +# This environment variable determines our operation mode.
  4822 +if test \"\$libtool_install_magic\" = \"$magic\"; then
  4823 + # install mode needs the following variable:
  4824 + notinst_deplibs='$notinst_deplibs'
  4825 +else
  4826 + # When we are sourced in execute mode, \$file and \$echo are already set.
  4827 + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4828 + echo=\"$qecho\"
  4829 + file=\"\$0\"
  4830 + # Make sure echo works.
  4831 + if test \"X\$1\" = X--no-reexec; then
  4832 + # Discard the --no-reexec flag, and continue.
  4833 + shift
  4834 + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  4835 + # Yippee, \$echo works!
  4836 + :
  4837 + else
  4838 + # Restart under the correct shell, and then maybe \$echo will work.
  4839 + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  4840 + fi
  4841 + fi\
  4842 +"
  4843 + $echo >> $output "\
  4844 +
  4845 + # Find the directory that this script lives in.
  4846 + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  4847 + test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  4848 +
  4849 + # Follow symbolic links until we get to the real thisdir.
  4850 + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  4851 + while test -n \"\$file\"; do
  4852 + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  4853 +
  4854 + # If there was a directory component, then change thisdir.
  4855 + if test \"x\$destdir\" != \"x\$file\"; then
  4856 + case \"\$destdir\" in
  4857 + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  4858 + *) thisdir=\"\$thisdir/\$destdir\" ;;
  4859 + esac
  4860 + fi
  4861 +
  4862 + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  4863 + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  4864 + done
  4865 +
  4866 + # Try to get the absolute directory name.
  4867 + absdir=\`cd \"\$thisdir\" && pwd\`
  4868 + test -n \"\$absdir\" && thisdir=\"\$absdir\"
  4869 +"
  4870 +
  4871 + if test "$fast_install" = yes; then
  4872 + $echo >> $output "\
  4873 + program=lt-'$outputname'$exeext
  4874 + progdir=\"\$thisdir/$objdir\"
  4875 +
  4876 + if test ! -f \"\$progdir/\$program\" || \\
  4877 + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  4878 + test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  4879 +
  4880 + file=\"\$\$-\$program\"
  4881 +
  4882 + if test ! -d \"\$progdir\"; then
  4883 + $mkdir \"\$progdir\"
  4884 + else
  4885 + $rm \"\$progdir/\$file\"
  4886 + fi"
  4887 +
  4888 + $echo >> $output "\
  4889 +
  4890 + # relink executable if necessary
  4891 + if test -n \"\$relink_command\"; then
  4892 + if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  4893 + else
  4894 + $echo \"\$relink_command_output\" >&2
  4895 + $rm \"\$progdir/\$file\"
  4896 + exit $EXIT_FAILURE
  4897 + fi
  4898 + fi
  4899 +
  4900 + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  4901 + { $rm \"\$progdir/\$program\";
  4902 + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  4903 + $rm \"\$progdir/\$file\"
  4904 + fi"
  4905 + else
  4906 + $echo >> $output "\
  4907 + program='$outputname'
  4908 + progdir=\"\$thisdir/$objdir\"
  4909 +"
  4910 + fi
  4911 +
  4912 + $echo >> $output "\
  4913 +
  4914 + if test -f \"\$progdir/\$program\"; then"
  4915 +
  4916 + # Export our shlibpath_var if we have one.
  4917 + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  4918 + $echo >> $output "\
  4919 + # Add our own library path to $shlibpath_var
  4920 + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  4921 +
  4922 + # Some systems cannot cope with colon-terminated $shlibpath_var
  4923 + # The second colon is a workaround for a bug in BeOS R4 sed
  4924 + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  4925 +
  4926 + export $shlibpath_var
  4927 +"
  4928 + fi
  4929 +
  4930 + # fixup the dll searchpath if we need to.
  4931 + if test -n "$dllsearchpath"; then
  4932 + $echo >> $output "\
  4933 + # Add the dll search path components to the executable PATH
  4934 + PATH=$dllsearchpath:\$PATH
  4935 +"
  4936 + fi
  4937 +
  4938 + $echo >> $output "\
  4939 + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4940 + # Run the actual program with our arguments.
  4941 +"
  4942 + case $host in
  4943 + # Backslashes separate directories on plain windows
  4944 + *-*-mingw | *-*-os2*)
  4945 + $echo >> $output "\
  4946 + exec \$progdir\\\\\$program \${1+\"\$@\"}
  4947 +"
  4948 + ;;
  4949 +
  4950 + *)
  4951 + $echo >> $output "\
  4952 + exec \$progdir/\$program \${1+\"\$@\"}
  4953 +"
  4954 + ;;
  4955 + esac
  4956 + $echo >> $output "\
  4957 + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  4958 + exit $EXIT_FAILURE
  4959 + fi
  4960 + else
  4961 + # The program doesn't exist.
  4962 + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  4963 + \$echo \"This script is just a wrapper for \$program.\" 1>&2
  4964 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  4965 + exit $EXIT_FAILURE
  4966 + fi
  4967 +fi\
  4968 +"
  4969 + chmod +x $output
  4970 + fi
  4971 + exit $EXIT_SUCCESS
  4972 + ;;
  4973 + esac
  4974 +
  4975 + # See if we need to build an old-fashioned archive.
  4976 + for oldlib in $oldlibs; do
  4977 +
  4978 + if test "$build_libtool_libs" = convenience; then
  4979 + oldobjs="$libobjs_save"
  4980 + addlibs="$convenience"
  4981 + build_libtool_libs=no
  4982 + else
  4983 + if test "$build_libtool_libs" = module; then
  4984 + oldobjs="$libobjs_save"
  4985 + build_libtool_libs=no
  4986 + else
  4987 + oldobjs="$old_deplibs $non_pic_objects"
  4988 + fi
  4989 + addlibs="$old_convenience"
  4990 + fi
  4991 +
  4992 + if test -n "$addlibs"; then
  4993 + gentop="$output_objdir/${outputname}x"
  4994 + $show "${rm}r $gentop"
  4995 + $run ${rm}r "$gentop"
  4996 + $show "$mkdir $gentop"
  4997 + $run $mkdir "$gentop"
  4998 + status=$?
  4999 + if test "$status" -ne 0 && test ! -d "$gentop"; then
  5000 + exit $status
  5001 + fi
  5002 + generated="$generated $gentop"
  5003 +
  5004 + # Add in members from convenience archives.
  5005 + for xlib in $addlibs; do
  5006 + # Extract the objects.
  5007 + case $xlib in
  5008 + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  5009 + *) xabs=`pwd`"/$xlib" ;;
  5010 + esac
  5011 + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  5012 + xdir="$gentop/$xlib"
  5013 +
  5014 + $show "${rm}r $xdir"
  5015 + $run ${rm}r "$xdir"
  5016 + $show "$mkdir $xdir"
  5017 + $run $mkdir "$xdir"
  5018 + status=$?
  5019 + if test "$status" -ne 0 && test ! -d "$xdir"; then
  5020 + exit $status
  5021 + fi
  5022 + # We will extract separately just the conflicting names and we will no
  5023 + # longer touch any unique names. It is faster to leave these extract
  5024 + # automatically by $AR in one run.
  5025 + $show "(cd $xdir && $AR x $xabs)"
  5026 + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  5027 + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
  5028 + :
  5029 + else
  5030 + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
  5031 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
  5032 + $AR t "$xabs" | sort | uniq -cd | while read -r count name
  5033 + do
  5034 + i=1
  5035 + while test "$i" -le "$count"
  5036 + do
  5037 + # Put our $i before any first dot (extension)
  5038 + # Never overwrite any file
  5039 + name_to="$name"
  5040 + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
  5041 + do
  5042 + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
  5043 + done
  5044 + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
  5045 + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
  5046 + i=`expr $i + 1`
  5047 + done
  5048 + done
  5049 + fi
  5050 +
  5051 + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  5052 + done
  5053 + fi
  5054 +
  5055 + # Do each command in the archive commands.
  5056 + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  5057 + cmds=$old_archive_from_new_cmds
  5058 + else
  5059 + eval cmds=\"$old_archive_cmds\"
  5060 +
  5061 + if len=`expr "X$cmds" : ".*"` &&
  5062 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  5063 + cmds=$old_archive_cmds
  5064 + else
  5065 + # the command line is too long to link in one step, link in parts
  5066 + $echo "using piecewise archive linking..."
  5067 + save_RANLIB=$RANLIB
  5068 + RANLIB=:
  5069 + objlist=
  5070 + concat_cmds=
  5071 + save_oldobjs=$oldobjs
  5072 + # GNU ar 2.10+ was changed to match POSIX; thus no paths are
  5073 + # encoded into archives. This makes 'ar r' malfunction in
  5074 + # this piecewise linking case whenever conflicting object
  5075 + # names appear in distinct ar calls; check, warn and compensate.
  5076 + if (for obj in $save_oldobjs
  5077 + do
  5078 + $echo "X$obj" | $Xsed -e 's%^.*/%%'
  5079 + done | sort | sort -uc >/dev/null 2>&1); then
  5080 + :
  5081 + else
  5082 + $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
  5083 + $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
  5084 + AR_FLAGS=cq
  5085 + fi
  5086 + # Is there a better way of finding the last object in the list?
  5087 + for obj in $save_oldobjs
  5088 + do
  5089 + last_oldobj=$obj
  5090 + done
  5091 + for obj in $save_oldobjs
  5092 + do
  5093 + oldobjs="$objlist $obj"
  5094 + objlist="$objlist $obj"
  5095 + eval test_cmds=\"$old_archive_cmds\"
  5096 + if len=`expr "X$test_cmds" : ".*"` &&
  5097 + test "$len" -le "$max_cmd_len"; then
  5098 + :
  5099 + else
  5100 + # the above command should be used before it gets too long
  5101 + oldobjs=$objlist
  5102 + if test "$obj" = "$last_oldobj" ; then
  5103 + RANLIB=$save_RANLIB
  5104 + fi
  5105 + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  5106 + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  5107 + objlist=
  5108 + fi
  5109 + done
  5110 + RANLIB=$save_RANLIB
  5111 + oldobjs=$objlist
  5112 + if test "X$oldobjs" = "X" ; then
  5113 + eval cmds=\"\$concat_cmds\"
  5114 + else
  5115 + eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  5116 + fi
  5117 + fi
  5118 + fi
  5119 + save_ifs="$IFS"; IFS='~'
  5120 + for cmd in $cmds; do
  5121 + eval cmd=\"$cmd\"
  5122 + IFS="$save_ifs"
  5123 + $show "$cmd"
  5124 + $run eval "$cmd" || exit $?
  5125 + done
  5126 + IFS="$save_ifs"
  5127 + done
  5128 +
  5129 + if test -n "$generated"; then
  5130 + $show "${rm}r$generated"
  5131 + $run ${rm}r$generated
  5132 + fi
  5133 +
  5134 + # Now create the libtool archive.
  5135 + case $output in
  5136 + *.la)
  5137 + old_library=
  5138 + test "$build_old_libs" = yes && old_library="$libname.$libext"
  5139 + $show "creating $output"
  5140 +
  5141 + # Preserve any variables that may affect compiler behavior
  5142 + for var in $variables_saved_for_relink; do
  5143 + if eval test -z \"\${$var+set}\"; then
  5144 + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  5145 + elif eval var_value=\$$var; test -z "$var_value"; then
  5146 + relink_command="$var=; export $var; $relink_command"
  5147 + else
  5148 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  5149 + relink_command="$var=\"$var_value\"; export $var; $relink_command"
  5150 + fi
  5151 + done
  5152 + # Quote the link command for shipping.
  5153 + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  5154 + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  5155 + if test "$hardcode_automatic" = yes ; then
  5156 + relink_command=
  5157 + fi
  5158 +
  5159 +
  5160 + # Only create the output if not a dry run.
  5161 + if test -z "$run"; then
  5162 + for installed in no yes; do
  5163 + if test "$installed" = yes; then
  5164 + if test -z "$install_libdir"; then
  5165 + break
  5166 + fi
  5167 + output="$output_objdir/$outputname"i
  5168 + # Replace all uninstalled libtool libraries with the installed ones
  5169 + newdependency_libs=
  5170 + for deplib in $dependency_libs; do
  5171 + case $deplib in
  5172 + *.la)
  5173 + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  5174 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  5175 + if test -z "$libdir"; then
  5176 + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  5177 + exit $EXIT_FAILURE
  5178 + fi
  5179 + newdependency_libs="$newdependency_libs $libdir/$name"
  5180 + ;;
  5181 + *) newdependency_libs="$newdependency_libs $deplib" ;;
  5182 + esac
  5183 + done
  5184 + dependency_libs="$newdependency_libs"
  5185 + newdlfiles=
  5186 + for lib in $dlfiles; do
  5187 + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5188 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5189 + if test -z "$libdir"; then
  5190 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5191 + exit $EXIT_FAILURE
  5192 + fi
  5193 + newdlfiles="$newdlfiles $libdir/$name"
  5194 + done
  5195 + dlfiles="$newdlfiles"
  5196 + newdlprefiles=
  5197 + for lib in $dlprefiles; do
  5198 + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5199 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5200 + if test -z "$libdir"; then
  5201 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5202 + exit $EXIT_FAILURE
  5203 + fi
  5204 + newdlprefiles="$newdlprefiles $libdir/$name"
  5205 + done
  5206 + dlprefiles="$newdlprefiles"
  5207 + else
  5208 + newdlfiles=
  5209 + for lib in $dlfiles; do
  5210 + case $lib in
  5211 + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  5212 + *) abs=`pwd`"/$lib" ;;
  5213 + esac
  5214 + newdlfiles="$newdlfiles $abs"
  5215 + done
  5216 + dlfiles="$newdlfiles"
  5217 + newdlprefiles=
  5218 + for lib in $dlprefiles; do
  5219 + case $lib in
  5220 + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  5221 + *) abs=`pwd`"/$lib" ;;
  5222 + esac
  5223 + newdlprefiles="$newdlprefiles $abs"
  5224 + done
  5225 + dlprefiles="$newdlprefiles"
  5226 + fi
  5227 + $rm $output
  5228 + # place dlname in correct position for cygwin
  5229 + tdlname=$dlname
  5230 + case $host,$output,$installed,$module,$dlname in
  5231 + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  5232 + esac
  5233 + $echo > $output "\
  5234 +# $outputname - a libtool library file
  5235 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  5236 +#
  5237 +# Please DO NOT delete this file!
  5238 +# It is necessary for linking the library.
  5239 +
  5240 +# The name that we can dlopen(3).
  5241 +dlname='$tdlname'
  5242 +
  5243 +# Names of this library.
  5244 +library_names='$library_names'
  5245 +
  5246 +# The name of the static archive.
  5247 +old_library='$old_library'
  5248 +
  5249 +# Libraries that this one depends upon.
  5250 +dependency_libs='$dependency_libs'
  5251 +
  5252 +# Version information for $libname.
  5253 +current=$current
  5254 +age=$age
  5255 +revision=$revision
  5256 +
  5257 +# Is this an already installed library?
  5258 +installed=$installed
  5259 +
  5260 +# Should we warn about portability when linking against -modules?
  5261 +shouldnotlink=$module
  5262 +
  5263 +# Files to dlopen/dlpreopen
  5264 +dlopen='$dlfiles'
  5265 +dlpreopen='$dlprefiles'
  5266 +
  5267 +# Directory that this library needs to be installed in:
  5268 +libdir='$install_libdir'"
  5269 + if test "$installed" = no && test "$need_relink" = yes; then
  5270 + $echo >> $output "\
  5271 +relink_command=\"$relink_command\""
  5272 + fi
  5273 + done
  5274 + fi
  5275 +
  5276 + # Do a symbolic link so that the libtool archive can be found in
  5277 + # LD_LIBRARY_PATH before the program is installed.
  5278 + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  5279 + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  5280 + ;;
  5281 + esac
  5282 + exit $EXIT_SUCCESS
  5283 + ;;
  5284 +
  5285 + # libtool install mode
  5286 + install)
  5287 + modename="$modename: install"
  5288 +
  5289 + # There may be an optional sh(1) argument at the beginning of
  5290 + # install_prog (especially on Windows NT).
  5291 + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  5292 + # Allow the use of GNU shtool's install command.
  5293 + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
  5294 + # Aesthetically quote it.
  5295 + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  5296 + case $arg in
  5297 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  5298 + arg="\"$arg\""
  5299 + ;;
  5300 + esac
  5301 + install_prog="$arg "
  5302 + arg="$1"
  5303 + shift
  5304 + else
  5305 + install_prog=
  5306 + arg="$nonopt"
  5307 + fi
  5308 +
  5309 + # The real first argument should be the name of the installation program.
  5310 + # Aesthetically quote it.
  5311 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5312 + case $arg in
  5313 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  5314 + arg="\"$arg\""
  5315 + ;;
  5316 + esac
  5317 + install_prog="$install_prog$arg"
  5318 +
  5319 + # We need to accept at least all the BSD install flags.
  5320 + dest=
  5321 + files=
  5322 + opts=
  5323 + prev=
  5324 + install_type=
  5325 + isdir=no
  5326 + stripme=
  5327 + for arg
  5328 + do
  5329 + if test -n "$dest"; then
  5330 + files="$files $dest"
  5331 + dest="$arg"
  5332 + continue
  5333 + fi
  5334 +
  5335 + case $arg in
  5336 + -d) isdir=yes ;;
  5337 + -f) prev="-f" ;;
  5338 + -g) prev="-g" ;;
  5339 + -m) prev="-m" ;;
  5340 + -o) prev="-o" ;;
  5341 + -s)
  5342 + stripme=" -s"
  5343 + continue
  5344 + ;;
  5345 + -*) ;;
  5346 +
  5347 + *)
  5348 + # If the previous option needed an argument, then skip it.
  5349 + if test -n "$prev"; then
  5350 + prev=
  5351 + else
  5352 + dest="$arg"
  5353 + continue
  5354 + fi
  5355 + ;;
  5356 + esac
  5357 +
  5358 + # Aesthetically quote the argument.
  5359 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5360 + case $arg in
  5361 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  5362 + arg="\"$arg\""
  5363 + ;;
  5364 + esac
  5365 + install_prog="$install_prog $arg"
  5366 + done
  5367 +
  5368 + if test -z "$install_prog"; then
  5369 + $echo "$modename: you must specify an install program" 1>&2
  5370 + $echo "$help" 1>&2
  5371 + exit $EXIT_FAILURE
  5372 + fi
  5373 +
  5374 + if test -n "$prev"; then
  5375 + $echo "$modename: the \`$prev' option requires an argument" 1>&2
  5376 + $echo "$help" 1>&2
  5377 + exit $EXIT_FAILURE
  5378 + fi
  5379 +
  5380 + if test -z "$files"; then
  5381 + if test -z "$dest"; then
  5382 + $echo "$modename: no file or destination specified" 1>&2
  5383 + else
  5384 + $echo "$modename: you must specify a destination" 1>&2
  5385 + fi
  5386 + $echo "$help" 1>&2
  5387 + exit $EXIT_FAILURE
  5388 + fi
  5389 +
  5390 + # Strip any trailing slash from the destination.
  5391 + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  5392 +
  5393 + # Check to see that the destination is a directory.
  5394 + test -d "$dest" && isdir=yes
  5395 + if test "$isdir" = yes; then
  5396 + destdir="$dest"
  5397 + destname=
  5398 + else
  5399 + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  5400 + test "X$destdir" = "X$dest" && destdir=.
  5401 + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  5402 +
  5403 + # Not a directory, so check to see that there is only one file specified.
  5404 + set dummy $files
  5405 + if test "$#" -gt 2; then
  5406 + $echo "$modename: \`$dest' is not a directory" 1>&2
  5407 + $echo "$help" 1>&2
  5408 + exit $EXIT_FAILURE
  5409 + fi
  5410 + fi
  5411 + case $destdir in
  5412 + [\\/]* | [A-Za-z]:[\\/]*) ;;
  5413 + *)
  5414 + for file in $files; do
  5415 + case $file in
  5416 + *.lo) ;;
  5417 + *)
  5418 + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  5419 + $echo "$help" 1>&2
  5420 + exit $EXIT_FAILURE
  5421 + ;;
  5422 + esac
  5423 + done
  5424 + ;;
  5425 + esac
  5426 +
  5427 + # This variable tells wrapper scripts just to set variables rather
  5428 + # than running their programs.
  5429 + libtool_install_magic="$magic"
  5430 +
  5431 + staticlibs=
  5432 + future_libdirs=
  5433 + current_libdirs=
  5434 + for file in $files; do
  5435 +
  5436 + # Do each installation.
  5437 + case $file in
  5438 + *.$libext)
  5439 + # Do the static libraries later.
  5440 + staticlibs="$staticlibs $file"
  5441 + ;;
  5442 +
  5443 + *.la)
  5444 + # Check to see that this really is a libtool archive.
  5445 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5446 + else
  5447 + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  5448 + $echo "$help" 1>&2
  5449 + exit $EXIT_FAILURE
  5450 + fi
  5451 +
  5452 + library_names=
  5453 + old_library=
  5454 + relink_command=
  5455 + # If there is no directory component, then add one.
  5456 + case $file in
  5457 + */* | *\\*) . $file ;;
  5458 + *) . ./$file ;;
  5459 + esac
  5460 +
  5461 + # Add the libdir to current_libdirs if it is the destination.
  5462 + if test "X$destdir" = "X$libdir"; then
  5463 + case "$current_libdirs " in
  5464 + *" $libdir "*) ;;
  5465 + *) current_libdirs="$current_libdirs $libdir" ;;
  5466 + esac
  5467 + else
  5468 + # Note the libdir as a future libdir.
  5469 + case "$future_libdirs " in
  5470 + *" $libdir "*) ;;
  5471 + *) future_libdirs="$future_libdirs $libdir" ;;
  5472 + esac
  5473 + fi
  5474 +
  5475 + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  5476 + test "X$dir" = "X$file/" && dir=
  5477 + dir="$dir$objdir"
  5478 +
  5479 + if test -n "$relink_command"; then
  5480 + # Determine the prefix the user has applied to our future dir.
  5481 + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  5482 +
  5483 + # Don't allow the user to place us outside of our expected
  5484 + # location b/c this prevents finding dependent libraries that
  5485 + # are installed to the same prefix.
  5486 + # At present, this check doesn't affect windows .dll's that
  5487 + # are installed into $libdir/../bin (currently, that works fine)
  5488 + # but it's something to keep an eye on.
  5489 + if test "$inst_prefix_dir" = "$destdir"; then
  5490 + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5491 + exit $EXIT_FAILURE
  5492 + fi
  5493 +
  5494 + if test -n "$inst_prefix_dir"; then
  5495 + # Stick the inst_prefix_dir data into the link command.
  5496 + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5497 + else
  5498 + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  5499 + fi
  5500 +
  5501 + $echo "$modename: warning: relinking \`$file'" 1>&2
  5502 + $show "$relink_command"
  5503 + if $run eval "$relink_command"; then :
  5504 + else
  5505 + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5506 + exit $EXIT_FAILURE
  5507 + fi
  5508 + fi
  5509 +
  5510 + # See the names of the shared library.
  5511 + set dummy $library_names
  5512 + if test -n "$2"; then
  5513 + realname="$2"
  5514 + shift
  5515 + shift
  5516 +
  5517 + srcname="$realname"
  5518 + test -n "$relink_command" && srcname="$realname"T
  5519 +
  5520 + # Install the shared library and build the symlinks.
  5521 + $show "$install_prog $dir/$srcname $destdir/$realname"
  5522 + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  5523 + if test -n "$stripme" && test -n "$striplib"; then
  5524 + $show "$striplib $destdir/$realname"
  5525 + $run eval "$striplib $destdir/$realname" || exit $?
  5526 + fi
  5527 +
  5528 + if test "$#" -gt 0; then
  5529 + # Delete the old symlinks, and create new ones.
  5530 + for linkname
  5531 + do
  5532 + if test "$linkname" != "$realname"; then
  5533 + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5534 + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5535 + fi
  5536 + done
  5537 + fi
  5538 +
  5539 + # Do each command in the postinstall commands.
  5540 + lib="$destdir/$realname"
  5541 + cmds=$postinstall_cmds
  5542 + save_ifs="$IFS"; IFS='~'
  5543 + for cmd in $cmds; do
  5544 + IFS="$save_ifs"
  5545 + eval cmd=\"$cmd\"
  5546 + $show "$cmd"
  5547 + $run eval "$cmd" || exit $?
  5548 + done
  5549 + IFS="$save_ifs"
  5550 + fi
  5551 +
  5552 + # Install the pseudo-library for information purposes.
  5553 + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5554 + instname="$dir/$name"i
  5555 + $show "$install_prog $instname $destdir/$name"
  5556 + $run eval "$install_prog $instname $destdir/$name" || exit $?
  5557 +
  5558 + # Maybe install the static library, too.
  5559 + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  5560 + ;;
  5561 +
  5562 + *.lo)
  5563 + # Install (i.e. copy) a libtool object.
  5564 +
  5565 + # Figure out destination file name, if it wasn't already specified.
  5566 + if test -n "$destname"; then
  5567 + destfile="$destdir/$destname"
  5568 + else
  5569 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5570 + destfile="$destdir/$destfile"
  5571 + fi
  5572 +
  5573 + # Deduce the name of the destination old-style object file.
  5574 + case $destfile in
  5575 + *.lo)
  5576 + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  5577 + ;;
  5578 + *.$objext)
  5579 + staticdest="$destfile"
  5580 + destfile=
  5581 + ;;
  5582 + *)
  5583 + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5584 + $echo "$help" 1>&2
  5585 + exit $EXIT_FAILURE
  5586 + ;;
  5587 + esac
  5588 +
  5589 + # Install the libtool object if requested.
  5590 + if test -n "$destfile"; then
  5591 + $show "$install_prog $file $destfile"
  5592 + $run eval "$install_prog $file $destfile" || exit $?
  5593 + fi
  5594 +
  5595 + # Install the old object if enabled.
  5596 + if test "$build_old_libs" = yes; then
  5597 + # Deduce the name of the old-style object file.
  5598 + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5599 +
  5600 + $show "$install_prog $staticobj $staticdest"
  5601 + $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5602 + fi
  5603 + exit $EXIT_SUCCESS
  5604 + ;;
  5605 +
  5606 + *)
  5607 + # Figure out destination file name, if it wasn't already specified.
  5608 + if test -n "$destname"; then
  5609 + destfile="$destdir/$destname"
  5610 + else
  5611 + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5612 + destfile="$destdir/$destfile"
  5613 + fi
  5614 +
  5615 + # If the file is missing, and there is a .exe on the end, strip it
  5616 + # because it is most likely a libtool script we actually want to
  5617 + # install
  5618 + stripped_ext=""
  5619 + case $file in
  5620 + *.exe)
  5621 + if test ! -f "$file"; then
  5622 + file=`$echo $file|${SED} 's,.exe$,,'`
  5623 + stripped_ext=".exe"
  5624 + fi
  5625 + ;;
  5626 + esac
  5627 +
  5628 + # Do a test to see if this is really a libtool program.
  5629 + case $host in
  5630 + *cygwin*|*mingw*)
  5631 + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  5632 + ;;
  5633 + *)
  5634 + wrapper=$file
  5635 + ;;
  5636 + esac
  5637 + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  5638 + notinst_deplibs=
  5639 + relink_command=
  5640 +
  5641 + # To insure that "foo" is sourced, and not "foo.exe",
  5642 + # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5643 + # which disallows the automatic-append-.exe behavior.
  5644 + case $build in
  5645 + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5646 + *) wrapperdot=${wrapper} ;;
  5647 + esac
  5648 + # If there is no directory component, then add one.
  5649 + case $file in
  5650 + */* | *\\*) . ${wrapperdot} ;;
  5651 + *) . ./${wrapperdot} ;;
  5652 + esac
  5653 +
  5654 + # Check the variables that should have been set.
  5655 + if test -z "$notinst_deplibs"; then
  5656 + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5657 + exit $EXIT_FAILURE
  5658 + fi
  5659 +
  5660 + finalize=yes
  5661 + for lib in $notinst_deplibs; do
  5662 + # Check to see that each library is installed.
  5663 + libdir=
  5664 + if test -f "$lib"; then
  5665 + # If there is no directory component, then add one.
  5666 + case $lib in
  5667 + */* | *\\*) . $lib ;;
  5668 + *) . ./$lib ;;
  5669 + esac
  5670 + fi
  5671 + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  5672 + if test -n "$libdir" && test ! -f "$libfile"; then
  5673 + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  5674 + finalize=no
  5675 + fi
  5676 + done
  5677 +
  5678 + relink_command=
  5679 + # To insure that "foo" is sourced, and not "foo.exe",
  5680 + # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5681 + # which disallows the automatic-append-.exe behavior.
  5682 + case $build in
  5683 + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5684 + *) wrapperdot=${wrapper} ;;
  5685 + esac
  5686 + # If there is no directory component, then add one.
  5687 + case $file in
  5688 + */* | *\\*) . ${wrapperdot} ;;
  5689 + *) . ./${wrapperdot} ;;
  5690 + esac
  5691 +
  5692 + outputname=
  5693 + if test "$fast_install" = no && test -n "$relink_command"; then
  5694 + if test "$finalize" = yes && test -z "$run"; then
  5695 + tmpdir="/tmp"
  5696 + test -n "$TMPDIR" && tmpdir="$TMPDIR"
  5697 + tmpdir="$tmpdir/libtool-$$"
  5698 + save_umask=`umask`
  5699 + umask 0077
  5700 + if $mkdir "$tmpdir"; then
  5701 + umask $save_umask
  5702 + else
  5703 + umask $save_umask
  5704 + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  5705 + continue
  5706 + fi
  5707 + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5708 + outputname="$tmpdir/$file"
  5709 + # Replace the output file specification.
  5710 + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  5711 +
  5712 + $show "$relink_command"
  5713 + if $run eval "$relink_command"; then :
  5714 + else
  5715 + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5716 + ${rm}r "$tmpdir"
  5717 + continue
  5718 + fi
  5719 + file="$outputname"
  5720 + else
  5721 + $echo "$modename: warning: cannot relink \`$file'" 1>&2
  5722 + fi
  5723 + else
  5724 + # Install the binary that we compiled earlier.
  5725 + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  5726 + fi
  5727 + fi
  5728 +
  5729 + # remove .exe since cygwin /usr/bin/install will append another
  5730 + # one anyways
  5731 + case $install_prog,$host in
  5732 + */usr/bin/install*,*cygwin*)
  5733 + case $file:$destfile in
  5734 + *.exe:*.exe)
  5735 + # this is ok
  5736 + ;;
  5737 + *.exe:*)
  5738 + destfile=$destfile.exe
  5739 + ;;
  5740 + *:*.exe)
  5741 + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  5742 + ;;
  5743 + esac
  5744 + ;;
  5745 + esac
  5746 + $show "$install_prog$stripme $file $destfile"
  5747 + $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  5748 + test -n "$outputname" && ${rm}r "$tmpdir"
  5749 + ;;
  5750 + esac
  5751 + done
  5752 +
  5753 + for file in $staticlibs; do
  5754 + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5755 +
  5756 + # Set up the ranlib parameters.
  5757 + oldlib="$destdir/$name"
  5758 +
  5759 + $show "$install_prog $file $oldlib"
  5760 + $run eval "$install_prog \$file \$oldlib" || exit $?
  5761 +
  5762 + if test -n "$stripme" && test -n "$old_striplib"; then
  5763 + $show "$old_striplib $oldlib"
  5764 + $run eval "$old_striplib $oldlib" || exit $?
  5765 + fi
  5766 +
  5767 + # Do each command in the postinstall commands.
  5768 + cmds=$old_postinstall_cmds
  5769 + save_ifs="$IFS"; IFS='~'
  5770 + for cmd in $cmds; do
  5771 + IFS="$save_ifs"
  5772 + eval cmd=\"$cmd\"
  5773 + $show "$cmd"
  5774 + $run eval "$cmd" || exit $?
  5775 + done
  5776 + IFS="$save_ifs"
  5777 + done
  5778 +
  5779 + if test -n "$future_libdirs"; then
  5780 + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  5781 + fi
  5782 +
  5783 + if test -n "$current_libdirs"; then
  5784 + # Maybe just do a dry run.
  5785 + test -n "$run" && current_libdirs=" -n$current_libdirs"
  5786 + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  5787 + else
  5788 + exit $EXIT_SUCCESS
  5789 + fi
  5790 + ;;
  5791 +
  5792 + # libtool finish mode
  5793 + finish)
  5794 + modename="$modename: finish"
  5795 + libdirs="$nonopt"
  5796 + admincmds=
  5797 +
  5798 + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  5799 + for dir
  5800 + do
  5801 + libdirs="$libdirs $dir"
  5802 + done
  5803 +
  5804 + for libdir in $libdirs; do
  5805 + if test -n "$finish_cmds"; then
  5806 + # Do each command in the finish commands.
  5807 + cmds=$finish_cmds
  5808 + save_ifs="$IFS"; IFS='~'
  5809 + for cmd in $cmds; do
  5810 + IFS="$save_ifs"
  5811 + eval cmd=\"$cmd\"
  5812 + $show "$cmd"
  5813 + $run eval "$cmd" || admincmds="$admincmds
  5814 + $cmd"
  5815 + done
  5816 + IFS="$save_ifs"
  5817 + fi
  5818 + if test -n "$finish_eval"; then
  5819 + # Do the single finish_eval.
  5820 + eval cmds=\"$finish_eval\"
  5821 + $run eval "$cmds" || admincmds="$admincmds
  5822 + $cmds"
  5823 + fi
  5824 + done
  5825 + fi
  5826 +
  5827 + # Exit here if they wanted silent mode.
  5828 + test "$show" = : && exit $EXIT_SUCCESS
  5829 +
  5830 + $echo "----------------------------------------------------------------------"
  5831 + $echo "Libraries have been installed in:"
  5832 + for libdir in $libdirs; do
  5833 + $echo " $libdir"
  5834 + done
  5835 + $echo
  5836 + $echo "If you ever happen to want to link against installed libraries"
  5837 + $echo "in a given directory, LIBDIR, you must either use libtool, and"
  5838 + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  5839 + $echo "flag during linking and do at least one of the following:"
  5840 + if test -n "$shlibpath_var"; then
  5841 + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  5842 + $echo " during execution"
  5843 + fi
  5844 + if test -n "$runpath_var"; then
  5845 + $echo " - add LIBDIR to the \`$runpath_var' environment variable"
  5846 + $echo " during linking"
  5847 + fi
  5848 + if test -n "$hardcode_libdir_flag_spec"; then
  5849 + libdir=LIBDIR
  5850 + eval flag=\"$hardcode_libdir_flag_spec\"
  5851 +
  5852 + $echo " - use the \`$flag' linker flag"
  5853 + fi
  5854 + if test -n "$admincmds"; then
  5855 + $echo " - have your system administrator run these commands:$admincmds"
  5856 + fi
  5857 + if test -f /etc/ld.so.conf; then
  5858 + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  5859 + fi
  5860 + $echo
  5861 + $echo "See any operating system documentation about shared libraries for"
  5862 + $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5863 + $echo "----------------------------------------------------------------------"
  5864 + exit $EXIT_SUCCESS
  5865 + ;;
  5866 +
  5867 + # libtool execute mode
  5868 + execute)
  5869 + modename="$modename: execute"
  5870 +
  5871 + # The first argument is the command name.
  5872 + cmd="$nonopt"
  5873 + if test -z "$cmd"; then
  5874 + $echo "$modename: you must specify a COMMAND" 1>&2
  5875 + $echo "$help"
  5876 + exit $EXIT_FAILURE
  5877 + fi
  5878 +
  5879 + # Handle -dlopen flags immediately.
  5880 + for file in $execute_dlfiles; do
  5881 + if test ! -f "$file"; then
  5882 + $echo "$modename: \`$file' is not a file" 1>&2
  5883 + $echo "$help" 1>&2
  5884 + exit $EXIT_FAILURE
  5885 + fi
  5886 +
  5887 + dir=
  5888 + case $file in
  5889 + *.la)
  5890 + # Check to see that this really is a libtool archive.
  5891 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5892 + else
  5893 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5894 + $echo "$help" 1>&2
  5895 + exit $EXIT_FAILURE
  5896 + fi
  5897 +
  5898 + # Read the libtool library.
  5899 + dlname=
  5900 + library_names=
  5901 +
  5902 + # If there is no directory component, then add one.
  5903 + case $file in
  5904 + */* | *\\*) . $file ;;
  5905 + *) . ./$file ;;
  5906 + esac
  5907 +
  5908 + # Skip this library if it cannot be dlopened.
  5909 + if test -z "$dlname"; then
  5910 + # Warn if it was a shared library.
  5911 + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  5912 + continue
  5913 + fi
  5914 +
  5915 + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5916 + test "X$dir" = "X$file" && dir=.
  5917 +
  5918 + if test -f "$dir/$objdir/$dlname"; then
  5919 + dir="$dir/$objdir"
  5920 + else
  5921 + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  5922 + exit $EXIT_FAILURE
  5923 + fi
  5924 + ;;
  5925 +
  5926 + *.lo)
  5927 + # Just add the directory containing the .lo file.
  5928 + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5929 + test "X$dir" = "X$file" && dir=.
  5930 + ;;
  5931 +
  5932 + *)
  5933 + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  5934 + continue
  5935 + ;;
  5936 + esac
  5937 +
  5938 + # Get the absolute pathname.
  5939 + absdir=`cd "$dir" && pwd`
  5940 + test -n "$absdir" && dir="$absdir"
  5941 +
  5942 + # Now add the directory to shlibpath_var.
  5943 + if eval "test -z \"\$$shlibpath_var\""; then
  5944 + eval "$shlibpath_var=\"\$dir\""
  5945 + else
  5946 + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  5947 + fi
  5948 + done
  5949 +
  5950 + # This variable tells wrapper scripts just to set shlibpath_var
  5951 + # rather than running their programs.
  5952 + libtool_execute_magic="$magic"
  5953 +
  5954 + # Check if any of the arguments is a wrapper script.
  5955 + args=
  5956 + for file
  5957 + do
  5958 + case $file in
  5959 + -*) ;;
  5960 + *)
  5961 + # Do a test to see if this is really a libtool program.
  5962 + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5963 + # If there is no directory component, then add one.
  5964 + case $file in
  5965 + */* | *\\*) . $file ;;
  5966 + *) . ./$file ;;
  5967 + esac
  5968 +
  5969 + # Transform arg to wrapped name.
  5970 + file="$progdir/$program"
  5971 + fi
  5972 + ;;
  5973 + esac
  5974 + # Quote arguments (to preserve shell metacharacters).
  5975 + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  5976 + args="$args \"$file\""
  5977 + done
  5978 +
  5979 + if test -z "$run"; then
  5980 + if test -n "$shlibpath_var"; then
  5981 + # Export the shlibpath_var.
  5982 + eval "export $shlibpath_var"
  5983 + fi
  5984 +
  5985 + # Restore saved environment variables
  5986 + if test "${save_LC_ALL+set}" = set; then
  5987 + LC_ALL="$save_LC_ALL"; export LC_ALL
  5988 + fi
  5989 + if test "${save_LANG+set}" = set; then
  5990 + LANG="$save_LANG"; export LANG
  5991 + fi
  5992 +
  5993 + # Now prepare to actually exec the command.
  5994 + exec_cmd="\$cmd$args"
  5995 + else
  5996 + # Display what would be done.
  5997 + if test -n "$shlibpath_var"; then
  5998 + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  5999 + $echo "export $shlibpath_var"
  6000 + fi
  6001 + $echo "$cmd$args"
  6002 + exit $EXIT_SUCCESS
  6003 + fi
  6004 + ;;
  6005 +
  6006 + # libtool clean and uninstall mode
  6007 + clean | uninstall)
  6008 + modename="$modename: $mode"
  6009 + rm="$nonopt"
  6010 + files=
  6011 + rmforce=
  6012 + exit_status=0
  6013 +
  6014 + # This variable tells wrapper scripts just to set variables rather
  6015 + # than running their programs.
  6016 + libtool_install_magic="$magic"
  6017 +
  6018 + for arg
  6019 + do
  6020 + case $arg in
  6021 + -f) rm="$rm $arg"; rmforce=yes ;;
  6022 + -*) rm="$rm $arg" ;;
  6023 + *) files="$files $arg" ;;
  6024 + esac
  6025 + done
  6026 +
  6027 + if test -z "$rm"; then
  6028 + $echo "$modename: you must specify an RM program" 1>&2
  6029 + $echo "$help" 1>&2
  6030 + exit $EXIT_FAILURE
  6031 + fi
  6032 +
  6033 + rmdirs=
  6034 +
  6035 + origobjdir="$objdir"
  6036 + for file in $files; do
  6037 + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  6038 + if test "X$dir" = "X$file"; then
  6039 + dir=.
  6040 + objdir="$origobjdir"
  6041 + else
  6042 + objdir="$dir/$origobjdir"
  6043 + fi
  6044 + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  6045 + test "$mode" = uninstall && objdir="$dir"
  6046 +
  6047 + # Remember objdir for removal later, being careful to avoid duplicates
  6048 + if test "$mode" = clean; then
  6049 + case " $rmdirs " in
  6050 + *" $objdir "*) ;;
  6051 + *) rmdirs="$rmdirs $objdir" ;;
  6052 + esac
  6053 + fi
  6054 +
  6055 + # Don't error if the file doesn't exist and rm -f was used.
  6056 + if (test -L "$file") >/dev/null 2>&1 \
  6057 + || (test -h "$file") >/dev/null 2>&1 \
  6058 + || test -f "$file"; then
  6059 + :
  6060 + elif test -d "$file"; then
  6061 + exit_status=1
  6062 + continue
  6063 + elif test "$rmforce" = yes; then
  6064 + continue
  6065 + fi
  6066 +
  6067 + rmfiles="$file"
  6068 +
  6069 + case $name in
  6070 + *.la)
  6071 + # Possibly a libtool archive, so verify it.
  6072 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6073 + . $dir/$name
  6074 +
  6075 + # Delete the libtool libraries and symlinks.
  6076 + for n in $library_names; do
  6077 + rmfiles="$rmfiles $objdir/$n"
  6078 + done
  6079 + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  6080 + test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  6081 +
  6082 + if test "$mode" = uninstall; then
  6083 + if test -n "$library_names"; then
  6084 + # Do each command in the postuninstall commands.
  6085 + cmds=$postuninstall_cmds
  6086 + save_ifs="$IFS"; IFS='~'
  6087 + for cmd in $cmds; do
  6088 + IFS="$save_ifs"
  6089 + eval cmd=\"$cmd\"
  6090 + $show "$cmd"
  6091 + $run eval "$cmd"
  6092 + if test "$?" -ne 0 && test "$rmforce" != yes; then
  6093 + exit_status=1
  6094 + fi
  6095 + done
  6096 + IFS="$save_ifs"
  6097 + fi
  6098 +
  6099 + if test -n "$old_library"; then
  6100 + # Do each command in the old_postuninstall commands.
  6101 + cmds=$old_postuninstall_cmds
  6102 + save_ifs="$IFS"; IFS='~'
  6103 + for cmd in $cmds; do
  6104 + IFS="$save_ifs"
  6105 + eval cmd=\"$cmd\"
  6106 + $show "$cmd"
  6107 + $run eval "$cmd"
  6108 + if test "$?" -ne 0 && test "$rmforce" != yes; then
  6109 + exit_status=1
  6110 + fi
  6111 + done
  6112 + IFS="$save_ifs"
  6113 + fi
  6114 + # FIXME: should reinstall the best remaining shared library.
  6115 + fi
  6116 + fi
  6117 + ;;
  6118 +
  6119 + *.lo)
  6120 + # Possibly a libtool object, so verify it.
  6121 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6122 +
  6123 + # Read the .lo file
  6124 + . $dir/$name
  6125 +
  6126 + # Add PIC object to the list of files to remove.
  6127 + if test -n "$pic_object" \
  6128 + && test "$pic_object" != none; then
  6129 + rmfiles="$rmfiles $dir/$pic_object"
  6130 + fi
  6131 +
  6132 + # Add non-PIC object to the list of files to remove.
  6133 + if test -n "$non_pic_object" \
  6134 + && test "$non_pic_object" != none; then
  6135 + rmfiles="$rmfiles $dir/$non_pic_object"
  6136 + fi
  6137 + fi
  6138 + ;;
  6139 +
  6140 + *)
  6141 + if test "$mode" = clean ; then
  6142 + noexename=$name
  6143 + case $file in
  6144 + *.exe)
  6145 + file=`$echo $file|${SED} 's,.exe$,,'`
  6146 + noexename=`$echo $name|${SED} 's,.exe$,,'`
  6147 + # $file with .exe has already been added to rmfiles,
  6148 + # add $file without .exe
  6149 + rmfiles="$rmfiles $file"
  6150 + ;;
  6151 + esac
  6152 + # Do a test to see if this is a libtool program.
  6153 + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6154 + relink_command=
  6155 + . $dir/$noexename
  6156 +
  6157 + # note $name still contains .exe if it was in $file originally
  6158 + # as does the version of $file that was added into $rmfiles
  6159 + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  6160 + if test "$fast_install" = yes && test -n "$relink_command"; then
  6161 + rmfiles="$rmfiles $objdir/lt-$name"
  6162 + fi
  6163 + if test "X$noexename" != "X$name" ; then
  6164 + rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  6165 + fi
  6166 + fi
  6167 + fi
  6168 + ;;
  6169 + esac
  6170 + $show "$rm $rmfiles"
  6171 + $run $rm $rmfiles || exit_status=1
  6172 + done
  6173 + objdir="$origobjdir"
  6174 +
  6175 + # Try to remove the ${objdir}s in the directories where we deleted files
  6176 + for dir in $rmdirs; do
  6177 + if test -d "$dir"; then
  6178 + $show "rmdir $dir"
  6179 + $run rmdir $dir >/dev/null 2>&1
  6180 + fi
  6181 + done
  6182 +
  6183 + exit $exit_status
  6184 + ;;
  6185 +
  6186 + "")
  6187 + $echo "$modename: you must specify a MODE" 1>&2
  6188 + $echo "$generic_help" 1>&2
  6189 + exit $EXIT_FAILURE
  6190 + ;;
  6191 + esac
  6192 +
  6193 + if test -z "$exec_cmd"; then
  6194 + $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6195 + $echo "$generic_help" 1>&2
  6196 + exit $EXIT_FAILURE
  6197 + fi
  6198 +fi # test -z "$show_help"
  6199 +
  6200 +if test -n "$exec_cmd"; then
  6201 + eval exec $exec_cmd
  6202 + exit $EXIT_FAILURE
  6203 +fi
  6204 +
  6205 +# We need to display help for each of the modes.
  6206 +case $mode in
  6207 +"") $echo \
  6208 +"Usage: $modename [OPTION]... [MODE-ARG]...
  6209 +
  6210 +Provide generalized library-building support services.
  6211 +
  6212 + --config show all configuration variables
  6213 + --debug enable verbose shell tracing
  6214 +-n, --dry-run display commands without modifying any files
  6215 + --features display basic configuration information and exit
  6216 + --finish same as \`--mode=finish'
  6217 + --help display this help message and exit
  6218 + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  6219 + --quiet same as \`--silent'
  6220 + --silent don't print informational messages
  6221 + --tag=TAG use configuration variables from tag TAG
  6222 + --version print version information
  6223 +
  6224 +MODE must be one of the following:
  6225 +
  6226 + clean remove files from the build directory
  6227 + compile compile a source file into a libtool object
  6228 + execute automatically set library path, then run a program
  6229 + finish complete the installation of libtool libraries
  6230 + install install libraries or executables
  6231 + link create a library or an executable
  6232 + uninstall remove libraries from an installed directory
  6233 +
  6234 +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  6235 +a more detailed description of MODE.
  6236 +
  6237 +Report bugs to <bug-libtool@gnu.org>."
  6238 + exit $EXIT_SUCCESS
  6239 + ;;
  6240 +
  6241 +clean)
  6242 + $echo \
  6243 +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  6244 +
  6245 +Remove files from the build directory.
  6246 +
  6247 +RM is the name of the program to use to delete files associated with each FILE
  6248 +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  6249 +to RM.
  6250 +
  6251 +If FILE is a libtool library, object or program, all the files associated
  6252 +with it are deleted. Otherwise, only FILE itself is deleted using RM."
  6253 + ;;
  6254 +
  6255 +compile)
  6256 + $echo \
  6257 +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  6258 +
  6259 +Compile a source file into a libtool library object.
  6260 +
  6261 +This mode accepts the following additional options:
  6262 +
  6263 + -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  6264 + -prefer-pic try to building PIC objects only
  6265 + -prefer-non-pic try to building non-PIC objects only
  6266 + -static always build a \`.o' file suitable for static linking
  6267 +
  6268 +COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  6269 +from the given SOURCEFILE.
  6270 +
  6271 +The output file name is determined by removing the directory component from
  6272 +SOURCEFILE, then substituting the C source code suffix \`.c' with the
  6273 +library object suffix, \`.lo'."
  6274 + ;;
  6275 +
  6276 +execute)
  6277 + $echo \
  6278 +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  6279 +
  6280 +Automatically set library path, then run a program.
  6281 +
  6282 +This mode accepts the following additional options:
  6283 +
  6284 + -dlopen FILE add the directory containing FILE to the library path
  6285 +
  6286 +This mode sets the library path environment variable according to \`-dlopen'
  6287 +flags.
  6288 +
  6289 +If any of the ARGS are libtool executable wrappers, then they are translated
  6290 +into their corresponding uninstalled binary, and any of their required library
  6291 +directories are added to the library path.
  6292 +
  6293 +Then, COMMAND is executed, with ARGS as arguments."
  6294 + ;;
  6295 +
  6296 +finish)
  6297 + $echo \
  6298 +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  6299 +
  6300 +Complete the installation of libtool libraries.
  6301 +
  6302 +Each LIBDIR is a directory that contains libtool libraries.
  6303 +
  6304 +The commands that this mode executes may require superuser privileges. Use
  6305 +the \`--dry-run' option if you just want to see what would be executed."
  6306 + ;;
  6307 +
  6308 +install)
  6309 + $echo \
  6310 +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  6311 +
  6312 +Install executables or libraries.
  6313 +
  6314 +INSTALL-COMMAND is the installation command. The first component should be
  6315 +either the \`install' or \`cp' program.
  6316 +
  6317 +The rest of the components are interpreted as arguments to that command (only
  6318 +BSD-compatible install options are recognized)."
  6319 + ;;
  6320 +
  6321 +link)
  6322 + $echo \
  6323 +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  6324 +
  6325 +Link object files or libraries together to form another library, or to
  6326 +create an executable program.
  6327 +
  6328 +LINK-COMMAND is a command using the C compiler that you would use to create
  6329 +a program from several object files.
  6330 +
  6331 +The following components of LINK-COMMAND are treated specially:
  6332 +
  6333 + -all-static do not do any dynamic linking at all
  6334 + -avoid-version do not add a version suffix if possible
  6335 + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  6336 + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  6337 + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  6338 + -export-symbols SYMFILE
  6339 + try to export only the symbols listed in SYMFILE
  6340 + -export-symbols-regex REGEX
  6341 + try to export only the symbols matching REGEX
  6342 + -LLIBDIR search LIBDIR for required installed libraries
  6343 + -lNAME OUTPUT-FILE requires the installed library libNAME
  6344 + -module build a library that can dlopened
  6345 + -no-fast-install disable the fast-install mode
  6346 + -no-install link a not-installable executable
  6347 + -no-undefined declare that a library does not refer to external symbols
  6348 + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  6349 + -objectlist FILE Use a list of object files found in FILE to specify objects
  6350 + -precious-files-regex REGEX
  6351 + don't remove output files matching REGEX
  6352 + -release RELEASE specify package release information
  6353 + -rpath LIBDIR the created library will eventually be installed in LIBDIR
  6354 + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  6355 + -static do not do any dynamic linking of libtool libraries
  6356 + -version-info CURRENT[:REVISION[:AGE]]
  6357 + specify library version info [each variable defaults to 0]
  6358 +
  6359 +All other options (arguments beginning with \`-') are ignored.
  6360 +
  6361 +Every other argument is treated as a filename. Files ending in \`.la' are
  6362 +treated as uninstalled libtool libraries, other files are standard or library
  6363 +object files.
  6364 +
  6365 +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  6366 +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  6367 +required, except when creating a convenience library.
  6368 +
  6369 +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  6370 +using \`ar' and \`ranlib', or on Windows using \`lib'.
  6371 +
  6372 +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  6373 +is created, otherwise an executable program is created."
  6374 + ;;
  6375 +
  6376 +uninstall)
  6377 + $echo \
  6378 +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  6379 +
  6380 +Remove libraries from an installation directory.
  6381 +
  6382 +RM is the name of the program to use to delete files associated with each FILE
  6383 +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  6384 +to RM.
  6385 +
  6386 +If FILE is a libtool library, all the files associated with it are deleted.
  6387 +Otherwise, only FILE itself is deleted using RM."
  6388 + ;;
  6389 +
  6390 +*)
  6391 + $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6392 + $echo "$help" 1>&2
  6393 + exit $EXIT_FAILURE
  6394 + ;;
  6395 +esac
  6396 +
  6397 +$echo
  6398 +$echo "Try \`$modename --help' for more information about other modes."
  6399 +
  6400 +exit $EXIT_SUCCESS
  6401 +
  6402 +# The TAGs below are defined such that we never get into a situation
  6403 +# in which we disable both kinds of libraries. Given conflicting
  6404 +# choices, we go for a static library, that is the most portable,
  6405 +# since we can't tell whether shared libraries were disabled because
  6406 +# the user asked for that or because the platform doesn't support
  6407 +# them. This is particularly important on AIX, because we don't
  6408 +# support having both static and shared libraries enabled at the same
  6409 +# time on that platform, so we default to a shared-only configuration.
  6410 +# If a disable-shared tag is given, we'll fallback to a static-only
  6411 +# configuration. But we'll never go from static-only to shared-only.
  6412 +
  6413 +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  6414 +build_libtool_libs=no
  6415 +build_old_libs=yes
  6416 +# ### END LIBTOOL TAG CONFIG: disable-shared
  6417 +
  6418 +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
  6419 +build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
  6420 +# ### END LIBTOOL TAG CONFIG: disable-static
  6421 +
  6422 +# Local Variables:
  6423 +# mode:shell-script
  6424 +# sh-indentation:2
  6425 +# End:
... ...