IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ticket #385: pslib-0.6-build_tidy.patch

File pslib-0.6-build_tidy.patch, 299.4 KB (added by jhoblitt, 21 years ago)

patch to add autogen.sh, tidy configure.ac, and remove unneeded files

  • deleted file pslib/config.guess

    ---------------------
    PatchSet 227 
    Date: 2005/04/27 01:16:44
    Author: jhoblitt
    Branch: HEAD
    Tag: (none) 
    Log:
    remove unneeded files
    
    Members: 
    	NEWS:1.1->1.2(DEAD) 
    	config.guess:1.1->1.2(DEAD) 
    	config.sub:1.1->1.2(DEAD) 
    	depcomp:1.1->1.2(DEAD) 
    	install-sh:1.1->1.2(DEAD) 
    	ltmain.sh:1.1->1.2(DEAD) 
    	missing:1.1->1.2(DEAD) 
    	mkinstalldirs:1.1->1.2(DEAD) 
    
    ---------------------
    PatchSet 228 
    Date: 2005/04/27 01:23:15
    Author: jhoblitt
    Branch: HEAD
    Tag: (none) 
    Log:
    add autogen.sh
    tidy AC & AM initialization
    tidy list of AC processed files
    
    Members: 
    	autogen.sh:INITIAL->1.1 
    	configure.ac:1.1->1.2 
    
    + -  
    1 #! /bin/sh
    2 # Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    5 
    6 timestamp='2004-08-11'
    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, 2002, 2003, 2004
    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  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
    110  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
    111 dummy=$tmp/dummy ;
    112 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
    113 case $CC_FOR_BUILD,$HOST_CC,$CC in
    114  ,,)    echo "int x;" > $dummy.c ;
    115         for c in cc gcc c89 c99 ; do
    116           if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
    117              CC_FOR_BUILD="$c"; break ;
    118           fi ;
    119         done ;
    120         if test x"$CC_FOR_BUILD" = x ; then
    121           CC_FOR_BUILD=no_compiler_found ;
    122         fi
    123         ;;
    124  ,,*)   CC_FOR_BUILD=$CC ;;
    125  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    126 esac ;'
    127 
    128 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    129 # (ghazi@noc.rutgers.edu 1994-08-24)
    130 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
    131         PATH=$PATH:/.attbin ; export PATH
    132 fi
    133 
    134 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    135 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    136 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    137 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    138 
    139 case "${UNAME_MACHINE}" in
    140     i?86)
    141         test -z "$VENDOR" && VENDOR=pc
    142         ;;
    143     *)
    144         test -z "$VENDOR" && VENDOR=unknown
    145         ;;
    146 esac
    147 test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
    148 
    149 # Note: order is significant - the case branches are not exclusive.
    150 
    151 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    152     *:NetBSD:*:*)
    153         # NetBSD (nbsd) targets should (where applicable) match one or
    154         # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
    155         # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
    156         # switched to ELF, *-*-netbsd* would select the old
    157         # object file format.  This provides both forward
    158         # compatibility and a consistent mechanism for selecting the
    159         # object file format.
    160         #
    161         # Note: NetBSD doesn't particularly care about the vendor
    162         # portion of the name.  We always set it to "unknown".
    163         sysctl="sysctl -n hw.machine_arch"
    164         UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
    165             /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
    166         case "${UNAME_MACHINE_ARCH}" in
    167             armeb) machine=armeb-unknown ;;
    168             arm*) machine=arm-unknown ;;
    169             sh3el) machine=shl-unknown ;;
    170             sh3eb) machine=sh-unknown ;;
    171             *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
    172         esac
    173         # The Operating System including object format, if it has switched
    174         # to ELF recently, or will in the future.
    175         case "${UNAME_MACHINE_ARCH}" in
    176             arm*|i386|m68k|ns32k|sh3*|sparc|vax)
    177                 eval $set_cc_for_build
    178                 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    179                         | grep __ELF__ >/dev/null
    180                 then
    181                     # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
    182                     # Return netbsd for either.  FIX?
    183                     os=netbsd
    184                 else
    185                     os=netbsdelf
    186                 fi
    187                 ;;
    188             *)
    189                 os=netbsd
    190                 ;;
    191         esac
    192         # The OS release
    193         # Debian GNU/NetBSD machines have a different userland, and
    194         # thus, need a distinct triplet. However, they do not need
    195         # kernel version information, so it can be replaced with a
    196         # suitable tag, in the style of linux-gnu.
    197         case "${UNAME_VERSION}" in
    198             Debian*)
    199                 release='-gnu'
    200                 ;;
    201             *)
    202                 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    203                 ;;
    204         esac
    205         # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
    206         # contains redundant information, the shorter form:
    207         # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    208         echo "${machine}-${os}${release}"
    209         exit 0 ;;
    210     amd64:OpenBSD:*:*)
    211         echo x86_64-unknown-openbsd${UNAME_RELEASE}
    212         exit 0 ;;
    213     amiga:OpenBSD:*:*)
    214         echo m68k-unknown-openbsd${UNAME_RELEASE}
    215         exit 0 ;;
    216     arc:OpenBSD:*:*)
    217         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    218         exit 0 ;;
    219     cats:OpenBSD:*:*)
    220         echo arm-unknown-openbsd${UNAME_RELEASE}
    221         exit 0 ;;
    222     hp300:OpenBSD:*:*)
    223         echo m68k-unknown-openbsd${UNAME_RELEASE}
    224         exit 0 ;;
    225     luna88k:OpenBSD:*:*)
    226         echo m88k-unknown-openbsd${UNAME_RELEASE}
    227         exit 0 ;;
    228     mac68k:OpenBSD:*:*)
    229         echo m68k-unknown-openbsd${UNAME_RELEASE}
    230         exit 0 ;;
    231     macppc:OpenBSD:*:*)
    232         echo powerpc-unknown-openbsd${UNAME_RELEASE}
    233         exit 0 ;;
    234     mvme68k:OpenBSD:*:*)
    235         echo m68k-unknown-openbsd${UNAME_RELEASE}
    236         exit 0 ;;
    237     mvme88k:OpenBSD:*:*)
    238         echo m88k-unknown-openbsd${UNAME_RELEASE}
    239         exit 0 ;;
    240     mvmeppc:OpenBSD:*:*)
    241         echo powerpc-unknown-openbsd${UNAME_RELEASE}
    242         exit 0 ;;
    243     pmax:OpenBSD:*:*)
    244         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    245         exit 0 ;;
    246     sgi:OpenBSD:*:*)
    247         echo mipseb-unknown-openbsd${UNAME_RELEASE}
    248         exit 0 ;;
    249     sun3:OpenBSD:*:*)
    250         echo m68k-unknown-openbsd${UNAME_RELEASE}
    251         exit 0 ;;
    252     wgrisc:OpenBSD:*:*)
    253         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    254         exit 0 ;;
    255     *:OpenBSD:*:*)
    256         echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
    257         exit 0 ;;
    258     *:ekkoBSD:*:*)
    259         echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
    260         exit 0 ;;
    261     macppc:MirBSD:*:*)
    262         echo powerppc-unknown-mirbsd${UNAME_RELEASE}
    263         exit 0 ;;
    264     *:MirBSD:*:*)
    265         echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
    266         exit 0 ;;
    267     alpha:OSF1:*:*)
    268         case $UNAME_RELEASE in
    269         *4.0)
    270                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    271                 ;;
    272         *5.*)
    273                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
    274                 ;;
    275         esac
    276         # According to Compaq, /usr/sbin/psrinfo has been available on
    277         # OSF/1 and Tru64 systems produced since 1995.  I hope that
    278         # covers most systems running today.  This code pipes the CPU
    279         # types through head -n 1, so we only detect the type of CPU 0.
    280         ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
    281         case "$ALPHA_CPU_TYPE" in
    282             "EV4 (21064)")
    283                 UNAME_MACHINE="alpha" ;;
    284             "EV4.5 (21064)")
    285                 UNAME_MACHINE="alpha" ;;
    286             "LCA4 (21066/21068)")
    287                 UNAME_MACHINE="alpha" ;;
    288             "EV5 (21164)")
    289                 UNAME_MACHINE="alphaev5" ;;
    290             "EV5.6 (21164A)")
    291                 UNAME_MACHINE="alphaev56" ;;
    292             "EV5.6 (21164PC)")
    293                 UNAME_MACHINE="alphapca56" ;;
    294             "EV5.7 (21164PC)")
    295                 UNAME_MACHINE="alphapca57" ;;
    296             "EV6 (21264)")
    297                 UNAME_MACHINE="alphaev6" ;;
    298             "EV6.7 (21264A)")
    299                 UNAME_MACHINE="alphaev67" ;;
    300             "EV6.8CB (21264C)")
    301                 UNAME_MACHINE="alphaev68" ;;
    302             "EV6.8AL (21264B)")
    303                 UNAME_MACHINE="alphaev68" ;;
    304             "EV6.8CX (21264D)")
    305                 UNAME_MACHINE="alphaev68" ;;
    306             "EV6.9A (21264/EV69A)")
    307                 UNAME_MACHINE="alphaev69" ;;
    308             "EV7 (21364)")
    309                 UNAME_MACHINE="alphaev7" ;;
    310             "EV7.9 (21364A)")
    311                 UNAME_MACHINE="alphaev79" ;;
    312         esac
    313         # A Pn.n version is a patched version.
    314         # A Vn.n version is a released version.
    315         # A Tn.n version is a released field test version.
    316         # A Xn.n version is an unreleased experimental baselevel.
    317         # 1.2 uses "1.2" for uname -r.
    318         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    319         exit 0 ;;
    320     Alpha\ *:Windows_NT*:*)
    321         # How do we know it's Interix rather than the generic POSIX subsystem?
    322         # Should we change UNAME_MACHINE based on the output of uname instead
    323         # of the specific Alpha model?
    324         echo alpha-pc-interix
    325         exit 0 ;;
    326     21064:Windows_NT:50:3)
    327         echo alpha-dec-winnt3.5
    328         exit 0 ;;
    329     Amiga*:UNIX_System_V:4.0:*)
    330         echo m68k-unknown-sysv4
    331         exit 0;;
    332     *:[Aa]miga[Oo][Ss]:*:*)
    333         echo ${UNAME_MACHINE}-unknown-amigaos
    334         exit 0 ;;
    335     *:[Mm]orph[Oo][Ss]:*:*)
    336         echo ${UNAME_MACHINE}-unknown-morphos
    337         exit 0 ;;
    338     *:OS/390:*:*)
    339         echo i370-ibm-openedition
    340         exit 0 ;;
    341     *:OS400:*:*)
    342         echo powerpc-ibm-os400
    343         exit 0 ;;
    344     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    345         echo arm-acorn-riscix${UNAME_RELEASE}
    346         exit 0;;
    347     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    348         echo hppa1.1-hitachi-hiuxmpp
    349         exit 0;;
    350     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    351         # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
    352         if test "`(/bin/universe) 2>/dev/null`" = att ; then
    353                 echo pyramid-pyramid-sysv3
    354         else
    355                 echo pyramid-pyramid-bsd
    356         fi
    357         exit 0 ;;
    358     NILE*:*:*:dcosx)
    359         echo pyramid-pyramid-svr4
    360         exit 0 ;;
    361     DRS?6000:unix:4.0:6*)
    362         echo sparc-icl-nx6
    363         exit 0 ;;
    364     DRS?6000:UNIX_SV:4.2*:7*)
    365         case `/usr/bin/uname -p` in
    366             sparc) echo sparc-icl-nx7 && exit 0 ;;
    367         esac ;;
    368     sun4H:SunOS:5.*:*)
    369         echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    370         exit 0 ;;
    371     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    372         echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    373         exit 0 ;;
    374     i86pc:SunOS:5.*:*)
    375         echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    376         exit 0 ;;
    377     sun4*:SunOS:6*:*)
    378         # According to config.sub, this is the proper way to canonicalize
    379         # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
    380         # it's likely to be more like Solaris than SunOS4.
    381         echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    382         exit 0 ;;
    383     sun4*:SunOS:*:*)
    384         case "`/usr/bin/arch -k`" in
    385             Series*|S4*)
    386                 UNAME_RELEASE=`uname -v`
    387                 ;;
    388         esac
    389         # Japanese Language versions have a version number like `4.1.3-JL'.
    390         echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    391         exit 0 ;;
    392     sun3*:SunOS:*:*)
    393         echo m68k-sun-sunos${UNAME_RELEASE}
    394         exit 0 ;;
    395     sun*:*:4.2BSD:*)
    396         UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    397         test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
    398         case "`/bin/arch`" in
    399             sun3)
    400                 echo m68k-sun-sunos${UNAME_RELEASE}
    401                 ;;
    402             sun4)
    403                 echo sparc-sun-sunos${UNAME_RELEASE}
    404                 ;;
    405         esac
    406         exit 0 ;;
    407     aushp:SunOS:*:*)
    408         echo sparc-auspex-sunos${UNAME_RELEASE}
    409         exit 0 ;;
    410     # The situation for MiNT is a little confusing.  The machine name
    411     # can be virtually everything (everything which is not
    412     # "atarist" or "atariste" at least should have a processor
    413     # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
    414     # to the lowercase version "mint" (or "freemint").  Finally
    415     # the system name "TOS" denotes a system which is actually not
    416     # MiNT.  But MiNT is downward compatible to TOS, so this should
    417     # be no problem.
    418     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    419         echo m68k-atari-mint${UNAME_RELEASE}
    420         exit 0 ;;
    421     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    422         echo m68k-atari-mint${UNAME_RELEASE}
    423         exit 0 ;;
    424     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    425         echo m68k-atari-mint${UNAME_RELEASE}
    426         exit 0 ;;
    427     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    428         echo m68k-milan-mint${UNAME_RELEASE}
    429         exit 0 ;;
    430     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    431         echo m68k-hades-mint${UNAME_RELEASE}
    432         exit 0 ;;
    433     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    434         echo m68k-unknown-mint${UNAME_RELEASE}
    435         exit 0 ;;
    436     m68k:machten:*:*)
    437         echo m68k-apple-machten${UNAME_RELEASE}
    438         exit 0 ;;
    439     powerpc:machten:*:*)
    440         echo powerpc-apple-machten${UNAME_RELEASE}
    441         exit 0 ;;
    442     RISC*:Mach:*:*)
    443         echo mips-dec-mach_bsd4.3
    444         exit 0 ;;
    445     RISC*:ULTRIX:*:*)
    446         echo mips-dec-ultrix${UNAME_RELEASE}
    447         exit 0 ;;
    448     VAX*:ULTRIX*:*:*)
    449         echo vax-dec-ultrix${UNAME_RELEASE}
    450         exit 0 ;;
    451     2020:CLIX:*:* | 2430:CLIX:*:*)
    452         echo clipper-intergraph-clix${UNAME_RELEASE}
    453         exit 0 ;;
    454     mips:*:*:UMIPS | mips:*:*:RISCos)
    455         eval $set_cc_for_build
    456         sed 's/^        //' << EOF >$dummy.c
    457 #ifdef __cplusplus
    458 #include <stdio.h>  /* for printf() prototype */
    459         int main (int argc, char *argv[]) {
    460 #else
    461         int main (argc, argv) int argc; char *argv[]; {
    462 #endif
    463         #if defined (host_mips) && defined (MIPSEB)
    464         #if defined (SYSTYPE_SYSV)
    465           printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
    466         #endif
    467         #if defined (SYSTYPE_SVR4)
    468           printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
    469         #endif
    470         #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
    471           printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
    472         #endif
    473         #endif
    474           exit (-1);
    475         }
    476 EOF
    477         $CC_FOR_BUILD -o $dummy $dummy.c \
    478           && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    479           && exit 0
    480         echo mips-mips-riscos${UNAME_RELEASE}
    481         exit 0 ;;
    482     Motorola:PowerMAX_OS:*:*)
    483         echo powerpc-motorola-powermax
    484         exit 0 ;;
    485     Motorola:*:4.3:PL8-*)
    486         echo powerpc-harris-powermax
    487         exit 0 ;;
    488     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
    489         echo powerpc-harris-powermax
    490         exit 0 ;;
    491     Night_Hawk:Power_UNIX:*:*)
    492         echo powerpc-harris-powerunix
    493         exit 0 ;;
    494     m88k:CX/UX:7*:*)
    495         echo m88k-harris-cxux7
    496         exit 0 ;;
    497     m88k:*:4*:R4*)
    498         echo m88k-motorola-sysv4
    499         exit 0 ;;
    500     m88k:*:3*:R3*)
    501         echo m88k-motorola-sysv3
    502         exit 0 ;;
    503     AViiON:dgux:*:*)
    504         # DG/UX returns AViiON for all architectures
    505         UNAME_PROCESSOR=`/usr/bin/uname -p`
    506         if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
    507         then
    508             if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
    509                [ ${TARGET_BINARY_INTERFACE}x = x ]
    510             then
    511                 echo m88k-dg-dgux${UNAME_RELEASE}
    512             else
    513                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
    514             fi
    515         else
    516             echo i586-dg-dgux${UNAME_RELEASE}
    517         fi
    518         exit 0 ;;
    519     M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    520         echo m88k-dolphin-sysv3
    521         exit 0 ;;
    522     M88*:*:R3*:*)
    523         # Delta 88k system running SVR3
    524         echo m88k-motorola-sysv3
    525         exit 0 ;;
    526     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    527         echo m88k-tektronix-sysv3
    528         exit 0 ;;
    529     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    530         echo m68k-tektronix-bsd
    531         exit 0 ;;
    532     *:IRIX*:*:*)
    533         echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    534         exit 0 ;;
    535     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    536         echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
    537         exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
    538     i*86:AIX:*:*)
    539         echo i386-ibm-aix
    540         exit 0 ;;
    541     ia64:AIX:*:*)
    542         if [ -x /usr/bin/oslevel ] ; then
    543                 IBM_REV=`/usr/bin/oslevel`
    544         else
    545                 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    546         fi
    547         echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
    548         exit 0 ;;
    549     *:AIX:2:3)
    550         if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    551                 eval $set_cc_for_build
    552                 sed 's/^                //' << EOF >$dummy.c
    553                 #include <sys/systemcfg.h>
    554 
    555                 main()
    556                         {
    557                         if (!__power_pc())
    558                                 exit(1);
    559                         puts("powerpc-ibm-aix3.2.5");
    560                         exit(0);
    561                         }
    562 EOF
    563                 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
    564                 echo rs6000-ibm-aix3.2.5
    565         elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    566                 echo rs6000-ibm-aix3.2.4
    567         else
    568                 echo rs6000-ibm-aix3.2
    569         fi
    570         exit 0 ;;
    571     *:AIX:*:[45])
    572         IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    573         if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
    574                 IBM_ARCH=rs6000
    575         else
    576                 IBM_ARCH=powerpc
    577         fi
    578         if [ -x /usr/bin/oslevel ] ; then
    579                 IBM_REV=`/usr/bin/oslevel`
    580         else
    581                 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    582         fi
    583         echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    584         exit 0 ;;
    585     *:AIX:*:*)
    586         echo rs6000-ibm-aix
    587         exit 0 ;;
    588     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    589         echo romp-ibm-bsd4.4
    590         exit 0 ;;
    591     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    592         echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    593         exit 0 ;;                           # report: romp-ibm BSD 4.3
    594     *:BOSX:*:*)
    595         echo rs6000-bull-bosx
    596         exit 0 ;;
    597     DPX/2?00:B.O.S.:*:*)
    598         echo m68k-bull-sysv3
    599         exit 0 ;;
    600     9000/[34]??:4.3bsd:1.*:*)
    601         echo m68k-hp-bsd
    602         exit 0 ;;
    603     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    604         echo m68k-hp-bsd4.4
    605         exit 0 ;;
    606     9000/[34678]??:HP-UX:*:*)
    607         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    608         case "${UNAME_MACHINE}" in
    609             9000/31? )            HP_ARCH=m68000 ;;
    610             9000/[34]?? )         HP_ARCH=m68k ;;
    611             9000/[678][0-9][0-9])
    612                 if [ -x /usr/bin/getconf ]; then
    613                     sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    614                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    615                     case "${sc_cpu_version}" in
    616                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    617                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
    618                       532)                      # CPU_PA_RISC2_0
    619                         case "${sc_kernel_bits}" in
    620                           32) HP_ARCH="hppa2.0n" ;;
    621                           64) HP_ARCH="hppa2.0w" ;;
    622                           '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
    623                         esac ;;
    624                     esac
    625                 fi
    626                 if [ "${HP_ARCH}" = "" ]; then
    627                     eval $set_cc_for_build
    628                     sed 's/^              //' << EOF >$dummy.c
    629 
    630               #define _HPUX_SOURCE
    631               #include <stdlib.h>
    632               #include <unistd.h>
    633 
    634               int main ()
    635               {
    636               #if defined(_SC_KERNEL_BITS)
    637                   long bits = sysconf(_SC_KERNEL_BITS);
    638               #endif
    639                   long cpu  = sysconf (_SC_CPU_VERSION);
    640 
    641                   switch (cpu)
    642                 {
    643                 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    644                 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    645                 case CPU_PA_RISC2_0:
    646               #if defined(_SC_KERNEL_BITS)
    647                     switch (bits)
    648                         {
    649                         case 64: puts ("hppa2.0w"); break;
    650                         case 32: puts ("hppa2.0n"); break;
    651                         default: puts ("hppa2.0"); break;
    652                         } break;
    653               #else  /* !defined(_SC_KERNEL_BITS) */
    654                     puts ("hppa2.0"); break;
    655               #endif
    656                 default: puts ("hppa1.0"); break;
    657                 }
    658                   exit (0);
    659               }
    660 EOF
    661                     (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
    662                     test -z "$HP_ARCH" && HP_ARCH=hppa
    663                 fi ;;
    664         esac
    665         if [ ${HP_ARCH} = "hppa2.0w" ]
    666         then
    667             # avoid double evaluation of $set_cc_for_build
    668             test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
    669             if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
    670             then
    671                 HP_ARCH="hppa2.0w"
    672             else
    673                 HP_ARCH="hppa64"
    674             fi
    675         fi
    676         echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    677         exit 0 ;;
    678     ia64:HP-UX:*:*)
    679         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    680         echo ia64-hp-hpux${HPUX_REV}
    681         exit 0 ;;
    682     3050*:HI-UX:*:*)
    683         eval $set_cc_for_build
    684         sed 's/^        //' << EOF >$dummy.c
    685         #include <unistd.h>
    686         int
    687         main ()
    688         {
    689           long cpu = sysconf (_SC_CPU_VERSION);
    690           /* The order matters, because CPU_IS_HP_MC68K erroneously returns
    691              true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
    692              results, however.  */
    693           if (CPU_IS_PA_RISC (cpu))
    694             {
    695               switch (cpu)
    696                 {
    697                   case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
    698                   case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
    699                   case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
    700                   default: puts ("hppa-hitachi-hiuxwe2"); break;
    701                 }
    702             }
    703           else if (CPU_IS_HP_MC68K (cpu))
    704             puts ("m68k-hitachi-hiuxwe2");
    705           else puts ("unknown-hitachi-hiuxwe2");
    706           exit (0);
    707         }
    708 EOF
    709         $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
    710         echo unknown-hitachi-hiuxwe2
    711         exit 0 ;;
    712     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    713         echo hppa1.1-hp-bsd
    714         exit 0 ;;
    715     9000/8??:4.3bsd:*:*)
    716         echo hppa1.0-hp-bsd
    717         exit 0 ;;
    718     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
    719         echo hppa1.0-hp-mpeix
    720         exit 0 ;;
    721     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    722         echo hppa1.1-hp-osf
    723         exit 0 ;;
    724     hp8??:OSF1:*:*)
    725         echo hppa1.0-hp-osf
    726         exit 0 ;;
    727     i*86:OSF1:*:*)
    728         if [ -x /usr/sbin/sysversion ] ; then
    729             echo ${UNAME_MACHINE}-unknown-osf1mk
    730         else
    731             echo ${UNAME_MACHINE}-unknown-osf1
    732         fi
    733         exit 0 ;;
    734     parisc*:Lites*:*:*)
    735         echo hppa1.1-hp-lites
    736         exit 0 ;;
    737     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    738         echo c1-convex-bsd
    739         exit 0 ;;
    740     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    741         if getsysinfo -f scalar_acc
    742         then echo c32-convex-bsd
    743         else echo c2-convex-bsd
    744         fi
    745         exit 0 ;;
    746     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    747         echo c34-convex-bsd
    748         exit 0 ;;
    749     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    750         echo c38-convex-bsd
    751         exit 0 ;;
    752     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    753         echo c4-convex-bsd
    754         exit 0 ;;
    755     CRAY*Y-MP:*:*:*)
    756         echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    757         exit 0 ;;
    758     CRAY*[A-Z]90:*:*:*)
    759         echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
    760         | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    761               -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
    762               -e 's/\.[^.]*$/.X/'
    763         exit 0 ;;
    764     CRAY*TS:*:*:*)
    765         echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    766         exit 0 ;;
    767     CRAY*T3E:*:*:*)
    768         echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    769         exit 0 ;;
    770     CRAY*SV1:*:*:*)
    771         echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    772         exit 0 ;;
    773     *:UNICOS/mp:*:*)
    774         echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    775         exit 0 ;;
    776     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    777         FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    778         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    779         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    780         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    781         exit 0 ;;
    782     5000:UNIX_System_V:4.*:*)
    783         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    784         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
    785         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    786         exit 0 ;;
    787     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    788         echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    789         exit 0 ;;
    790     sparc*:BSD/OS:*:*)
    791         echo sparc-unknown-bsdi${UNAME_RELEASE}
    792         exit 0 ;;
    793     *:BSD/OS:*:*)
    794         echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
    795         exit 0 ;;
    796     *:FreeBSD:*:*)
    797         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    798         exit 0 ;;
    799     i*:CYGWIN*:*)
    800         echo ${UNAME_MACHINE}-pc-cygwin
    801         exit 0 ;;
    802     i*:MINGW*:*)
    803         echo ${UNAME_MACHINE}-pc-mingw32
    804         exit 0 ;;
    805     i*:PW*:*)
    806         echo ${UNAME_MACHINE}-pc-pw32
    807         exit 0 ;;
    808     x86:Interix*:[34]*)
    809         echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
    810         exit 0 ;;
    811     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    812         echo i${UNAME_MACHINE}-pc-mks
    813         exit 0 ;;
    814     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    815         # How do we know it's Interix rather than the generic POSIX subsystem?
    816         # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    817         # UNAME_MACHINE based on the output of uname instead of i386?
    818         echo i586-pc-interix
    819         exit 0 ;;
    820     i*:UWIN*:*)
    821         echo ${UNAME_MACHINE}-pc-uwin
    822         exit 0 ;;
    823     p*:CYGWIN*:*)
    824         echo powerpcle-unknown-cygwin
    825         exit 0 ;;
    826     prep*:SunOS:5.*:*)
    827         echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    828         exit 0 ;;
    829     *:GNU:*:*)
    830         # the GNU system
    831         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    832         exit 0 ;;
    833     *:GNU/*:*:*)
    834         # other systems with GNU libc and userland
    835         echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
    836         exit 0 ;;
    837     i*86:Minix:*:*)
    838         echo ${UNAME_MACHINE}-pc-minix
    839         exit 0 ;;
    840     arm*:Linux:*:*)
    841         echo ${UNAME_MACHINE}-${VENDOR}-linux
    842         exit 0 ;;
    843     cris:Linux:*:*)
    844         echo cris-axis-linux
    845         exit 0 ;;
    846     ia64:Linux:*:*)
    847         echo ${UNAME_MACHINE}-${VENDOR}-linux
    848         exit 0 ;;
    849     m32r*:Linux:*:*)
    850         echo ${UNAME_MACHINE}-${VENDOR}-linux
    851         exit 0 ;;
    852     m68*:Linux:*:*)
    853         echo ${UNAME_MACHINE}-${VENDOR}-linux
    854         exit 0 ;;
    855     mips:Linux:*:*)
    856         eval $set_cc_for_build
    857         sed 's/^        //' << EOF >$dummy.c
    858         #undef CPU
    859         #undef mips
    860         #undef mipsel
    861         #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
    862         CPU=mipsel
    863         #else
    864         #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
    865         CPU=mips
    866         #else
    867         CPU=
    868         #endif
    869         #endif
    870 EOF
    871         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    872         test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
    873         ;;
    874     mips64:Linux:*:*)
    875         eval $set_cc_for_build
    876         sed 's/^        //' << EOF >$dummy.c
    877         #undef CPU
    878         #undef mips64
    879         #undef mips64el
    880         #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
    881         CPU=mips64el
    882         #else
    883         #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
    884         CPU=mips64
    885         #else
    886         CPU=
    887         #endif
    888         #endif
    889 EOF
    890         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    891         test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
    892         ;;
    893     ppc:Linux:*:*)
    894         echo powerpc-${VENDOR}-linux
    895         exit 0 ;;
    896     ppc64:Linux:*:*)
    897         echo powerpc64-${VENDOR}-linux
    898         exit 0 ;;
    899     alpha:Linux:*:*)
    900         case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
    901           EV5)   UNAME_MACHINE=alphaev5 ;;
    902           EV56)  UNAME_MACHINE=alphaev56 ;;
    903           PCA56) UNAME_MACHINE=alphapca56 ;;
    904           PCA57) UNAME_MACHINE=alphapca56 ;;
    905           EV6)   UNAME_MACHINE=alphaev6 ;;
    906           EV67)  UNAME_MACHINE=alphaev67 ;;
    907           EV68*) UNAME_MACHINE=alphaev68 ;;
    908         esac
    909         objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
    910         if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
    911         echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
    912         exit 0 ;;
    913     parisc:Linux:*:* | hppa:Linux:*:*)
    914         # Look for CPU level
    915         case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    916           PA7*) echo hppa1.1-${VENDOR}-linux ;;
    917           PA8*) echo hppa2.0-${VENDOR}-linux ;;
    918           *)    echo hppa-${VENDOR}-linux ;;
    919         esac
    920         exit 0 ;;
    921     parisc64:Linux:*:* | hppa64:Linux:*:*)
    922         echo hppa64-${VENDOR}-linux
    923         exit 0 ;;
    924     s390:Linux:*:* | s390x:Linux:*:*)
    925         echo ${UNAME_MACHINE}-ibm-linux
    926         exit 0 ;;
    927     sh64*:Linux:*:*)
    928         echo ${UNAME_MACHINE}-${VENDOR}-linux
    929         exit 0 ;;
    930     sh*:Linux:*:*)
    931         echo ${UNAME_MACHINE}-${VENDOR}-linux
    932         exit 0 ;;
    933     sparc:Linux:*:* | sparc64:Linux:*:*)
    934         echo ${UNAME_MACHINE}-${VENDOR}-linux
    935         exit 0 ;;
    936     x86_64:Linux:*:*)
    937         echo x86_64-${VENDOR}-linux
    938         exit 0 ;;
    939     i*86:Linux:*:*)
    940         # The BFD linker knows what the default object file format is, so
    941         # first see if it will tell us. cd to the root directory to prevent
    942         # problems with other programs or directories called `ld' in the path.
    943         # Set LC_ALL=C to ensure ld outputs messages in English.
    944         ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
    945                          | sed -ne '/supported targets:/!d
    946                                     s/[         ][      ]*/ /g
    947                                     s/.*supported targets: *//
    948                                     s/ .*//
    949                                     p'`
    950         case "$ld_supported_targets" in
    951           elf32-i386)
    952                 TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux"
    953                 ;;
    954           a.out-i386-linux)
    955                 echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
    956                 exit 0 ;;
    957           coff-i386)
    958                 echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
    959                 exit 0 ;;
    960           "")
    961                 # Either a pre-BFD a.out linker (linuxoldld) or
    962                 # one that does not give us useful --help.
    963                 echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
    964                 exit 0 ;;
    965         esac
    966         # Determine whether the default compiler is a.out or elf
    967         eval $set_cc_for_build
    968         sed 's/^        //' << EOF >$dummy.c
    969         #include <features.h>
    970         #ifdef __ELF__
    971         # ifdef __GLIBC__
    972         #  if __GLIBC__ >= 2
    973         LIBC=gnu
    974         #  else
    975         LIBC=gnulibc1
    976         #  endif
    977         # else
    978         LIBC=gnulibc1
    979         # endif
    980         #else
    981         #ifdef __INTEL_COMPILER
    982         LIBC=gnu
    983         #else
    984         LIBC=gnuaout
    985         #endif
    986         #endif
    987         #ifdef __dietlibc__
    988         LIBC=dietlibc
    989         #endif
    990 EOF
    991         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    992         test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
    993         test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
    994         ;;
    995     i*86:DYNIX/ptx:4*:*)
    996         # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
    997         # earlier versions are messed up and put the nodename in both
    998         # sysname and nodename.
    999         echo i386-sequent-sysv4
    1000         exit 0 ;;
    1001     i*86:UNIX_SV:4.2MP:2.*)
    1002         # Unixware is an offshoot of SVR4, but it has its own version
    1003         # number series starting with 2...
    1004         # I am not positive that other SVR4 systems won't match this,
    1005         # I just have to hope.  -- rms.
    1006         # Use sysv4.2uw... so that sysv4* matches it.
    1007         echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    1008         exit 0 ;;
    1009     i*86:OS/2:*:*)
    1010         # If we were able to find `uname', then EMX Unix compatibility
    1011         # is probably installed.
    1012         echo ${UNAME_MACHINE}-pc-os2-emx
    1013         exit 0 ;;
    1014     i*86:XTS-300:*:STOP)
    1015         echo ${UNAME_MACHINE}-unknown-stop
    1016         exit 0 ;;
    1017     i*86:atheos:*:*)
    1018         echo ${UNAME_MACHINE}-unknown-atheos
    1019         exit 0 ;;
    1020         i*86:syllable:*:*)
    1021         echo ${UNAME_MACHINE}-pc-syllable
    1022         exit 0 ;;
    1023     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    1024         echo i386-unknown-lynxos${UNAME_RELEASE}
    1025         exit 0 ;;
    1026     i*86:*DOS:*:*)
    1027         echo ${UNAME_MACHINE}-pc-msdosdjgpp
    1028         exit 0 ;;
    1029     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    1030         UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
    1031         if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    1032                 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
    1033         else
    1034                 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
    1035         fi
    1036         exit 0 ;;
    1037     i*86:*:5:[78]*)
    1038         case `/bin/uname -X | grep "^Machine"` in
    1039             *486*)           UNAME_MACHINE=i486 ;;
    1040             *Pentium)        UNAME_MACHINE=i586 ;;
    1041             *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
    1042         esac
    1043         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
    1044         exit 0 ;;
    1045     i*86:*:3.2:*)
    1046         if test -f /usr/options/cb.name; then
    1047                 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
    1048                 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
    1049         elif /bin/uname -X 2>/dev/null >/dev/null ; then
    1050                 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
    1051                 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
    1052                 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
    1053                         && UNAME_MACHINE=i586
    1054                 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
    1055                         && UNAME_MACHINE=i686
    1056                 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
    1057                         && UNAME_MACHINE=i686
    1058                 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
    1059         else
    1060                 echo ${UNAME_MACHINE}-pc-sysv32
    1061         fi
    1062         exit 0 ;;
    1063     pc:*:*:*)
    1064         # Left here for compatibility:
    1065         # uname -m prints for DJGPP always 'pc', but it prints nothing about
    1066         # the processor, so we play safe by assuming i386.
    1067         echo i386-pc-msdosdjgpp
    1068         exit 0 ;;
    1069     Intel:Mach:3*:*)
    1070         echo i386-pc-mach3
    1071         exit 0 ;;
    1072     paragon:*:*:*)
    1073         echo i860-intel-osf1
    1074         exit 0 ;;
    1075     i860:*:4.*:*) # i860-SVR4
    1076         if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
    1077           echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
    1078         else # Add other i860-SVR4 vendors below as they are discovered.
    1079           echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    1080         fi
    1081         exit 0 ;;
    1082     mini*:CTIX:SYS*5:*)
    1083         # "miniframe"
    1084         echo m68010-convergent-sysv
    1085         exit 0 ;;
    1086     mc68k:UNIX:SYSTEM5:3.51m)
    1087         echo m68k-convergent-sysv
    1088         exit 0 ;;
    1089     M680?0:D-NIX:5.3:*)
    1090         echo m68k-diab-dnix
    1091         exit 0 ;;
    1092     M68*:*:R3V[5678]*:*)
    1093         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    1094     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
    1095         OS_REL=''
    1096         test -r /etc/.relid \
    1097         && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    1098         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1099           && echo i486-ncr-sysv4.3${OS_REL} && exit 0
    1100         /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1101           && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
    1102     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    1103         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1104           && echo i486-ncr-sysv4 && exit 0 ;;
    1105     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    1106         echo m68k-unknown-lynxos${UNAME_RELEASE}
    1107         exit 0 ;;
    1108     mc68030:UNIX_System_V:4.*:*)
    1109         echo m68k-atari-sysv4
    1110         exit 0 ;;
    1111     TSUNAMI:LynxOS:2.*:*)
    1112         echo sparc-unknown-lynxos${UNAME_RELEASE}
    1113         exit 0 ;;
    1114     rs6000:LynxOS:2.*:*)
    1115         echo rs6000-unknown-lynxos${UNAME_RELEASE}
    1116         exit 0 ;;
    1117     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
    1118         echo powerpc-unknown-lynxos${UNAME_RELEASE}
    1119         exit 0 ;;
    1120     SM[BE]S:UNIX_SV:*:*)
    1121         echo mips-dde-sysv${UNAME_RELEASE}
    1122         exit 0 ;;
    1123     RM*:ReliantUNIX-*:*:*)
    1124         echo mips-sni-sysv4
    1125         exit 0 ;;
    1126     RM*:SINIX-*:*:*)
    1127         echo mips-sni-sysv4
    1128         exit 0 ;;
    1129     *:SINIX-*:*:*)
    1130         if uname -p 2>/dev/null >/dev/null ; then
    1131                 UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1132                 echo ${UNAME_MACHINE}-sni-sysv4
    1133         else
    1134                 echo ns32k-sni-sysv
    1135         fi
    1136         exit 0 ;;
    1137     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    1138                       # says <Richard.M.Bartel@ccMail.Census.GOV>
    1139         echo i586-unisys-sysv4
    1140         exit 0 ;;
    1141     *:UNIX_System_V:4*:FTX*)
    1142         # From Gerald Hewes <hewes@openmarket.com>.
    1143         # How about differentiating between stratus architectures? -djm
    1144         echo hppa1.1-stratus-sysv4
    1145         exit 0 ;;
    1146     *:*:*:FTX*)
    1147         # From seanf@swdc.stratus.com.
    1148         echo i860-stratus-sysv4
    1149         exit 0 ;;
    1150     *:VOS:*:*)
    1151         # From Paul.Green@stratus.com.
    1152         echo hppa1.1-stratus-vos
    1153         exit 0 ;;
    1154     mc68*:A/UX:*:*)
    1155         echo m68k-apple-aux${UNAME_RELEASE}
    1156         exit 0 ;;
    1157     news*:NEWS-OS:6*:*)
    1158         echo mips-sony-newsos6
    1159         exit 0 ;;
    1160     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    1161         if [ -d /usr/nec ]; then
    1162                 echo mips-nec-sysv${UNAME_RELEASE}
    1163         else
    1164                 echo mips-unknown-sysv${UNAME_RELEASE}
    1165         fi
    1166         exit 0 ;;
    1167     BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
    1168         echo powerpc-be-beos
    1169         exit 0 ;;
    1170     BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
    1171         echo powerpc-apple-beos
    1172         exit 0 ;;
    1173     BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
    1174         echo i586-pc-beos
    1175         exit 0 ;;
    1176     SX-4:SUPER-UX:*:*)
    1177         echo sx4-nec-superux${UNAME_RELEASE}
    1178         exit 0 ;;
    1179     SX-5:SUPER-UX:*:*)
    1180         echo sx5-nec-superux${UNAME_RELEASE}
    1181         exit 0 ;;
    1182     SX-6:SUPER-UX:*:*)
    1183         echo sx6-nec-superux${UNAME_RELEASE}
    1184         exit 0 ;;
    1185     Power*:Rhapsody:*:*)
    1186         echo powerpc-apple-rhapsody${UNAME_RELEASE}
    1187         exit 0 ;;
    1188     *:Rhapsody:*:*)
    1189         echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
    1190         exit 0 ;;
    1191     *:Darwin:*:*)
    1192         UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1193         case $UNAME_PROCESSOR in
    1194             *86) UNAME_PROCESSOR=i686 ;;
    1195             unknown) UNAME_PROCESSOR=powerpc ;;
    1196         esac
    1197         echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    1198         exit 0 ;;
    1199     *:procnto*:*:* | *:QNX:[0123456789]*:*)
    1200         UNAME_PROCESSOR=`uname -p`
    1201         if test "$UNAME_PROCESSOR" = "x86"; then
    1202                 UNAME_PROCESSOR=i386
    1203                 UNAME_MACHINE=pc
    1204         fi
    1205         echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
    1206         exit 0 ;;
    1207     *:QNX:*:4*)
    1208         echo i386-pc-qnx
    1209         exit 0 ;;
    1210     NSR-?:NONSTOP_KERNEL:*:*)
    1211         echo nsr-tandem-nsk${UNAME_RELEASE}
    1212         exit 0 ;;
    1213     *:NonStop-UX:*:*)
    1214         echo mips-compaq-nonstopux
    1215         exit 0 ;;
    1216     BS2000:POSIX*:*:*)
    1217         echo bs2000-siemens-sysv
    1218         exit 0 ;;
    1219     DS/*:UNIX_System_V:*:*)
    1220         echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
    1221         exit 0 ;;
    1222     *:Plan9:*:*)
    1223         # "uname -m" is not consistent, so use $cputype instead. 386
    1224         # is converted to i386 for consistency with other x86
    1225         # operating systems.
    1226         if test "$cputype" = "386"; then
    1227             UNAME_MACHINE=i386
    1228         else
    1229             UNAME_MACHINE="$cputype"
    1230         fi
    1231         echo ${UNAME_MACHINE}-unknown-plan9
    1232         exit 0 ;;
    1233     *:TOPS-10:*:*)
    1234         echo pdp10-unknown-tops10
    1235         exit 0 ;;
    1236     *:TENEX:*:*)
    1237         echo pdp10-unknown-tenex
    1238         exit 0 ;;
    1239     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
    1240         echo pdp10-dec-tops20
    1241         exit 0 ;;
    1242     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
    1243         echo pdp10-xkl-tops20
    1244         exit 0 ;;
    1245     *:TOPS-20:*:*)
    1246         echo pdp10-unknown-tops20
    1247         exit 0 ;;
    1248     *:ITS:*:*)
    1249         echo pdp10-unknown-its
    1250         exit 0 ;;
    1251     SEI:*:*:SEIUX)
    1252         echo mips-sei-seiux${UNAME_RELEASE}
    1253         exit 0 ;;
    1254     *:DragonFly:*:*)
    1255         echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    1256         exit 0 ;;
    1257     *:*VMS:*:*)
    1258         UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1259         case "${UNAME_MACHINE}" in
    1260             A*) echo alpha-dec-vms && exit 0 ;;
    1261             I*) echo ia64-dec-vms && exit 0 ;;
    1262             V*) echo vax-dec-vms && exit 0 ;;
    1263         esac
    1264 esac
    1265 
    1266 #echo '(No uname command or uname output not recognized.)' 1>&2
    1267 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
    1268 
    1269 eval $set_cc_for_build
    1270 cat >$dummy.c <<EOF
    1271 #ifdef _SEQUENT_
    1272 # include <sys/types.h>
    1273 # include <sys/utsname.h>
    1274 #endif
    1275 main ()
    1276 {
    1277 #if defined (sony)
    1278 #if defined (MIPSEB)
    1279   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
    1280      I don't know....  */
    1281   printf ("mips-sony-bsd\n"); exit (0);
    1282 #else
    1283 #include <sys/param.h>
    1284   printf ("m68k-sony-newsos%s\n",
    1285 #ifdef NEWSOS4
    1286           "4"
    1287 #else
    1288           ""
    1289 #endif
    1290          ); exit (0);
    1291 #endif
    1292 #endif
    1293 
    1294 #if defined (__arm) && defined (__acorn) && defined (__unix)
    1295   printf ("arm-acorn-riscix"); exit (0);
    1296 #endif
    1297 
    1298 #if defined (hp300) && !defined (hpux)
    1299   printf ("m68k-hp-bsd\n"); exit (0);
    1300 #endif
    1301 
    1302 #if defined (NeXT)
    1303 #if !defined (__ARCHITECTURE__)
    1304 #define __ARCHITECTURE__ "m68k"
    1305 #endif
    1306   int version;
    1307   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
    1308   if (version < 4)
    1309     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
    1310   else
    1311     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
    1312   exit (0);
    1313 #endif
    1314 
    1315 #if defined (MULTIMAX) || defined (n16)
    1316 #if defined (UMAXV)
    1317   printf ("ns32k-encore-sysv\n"); exit (0);
    1318 #else
    1319 #if defined (CMU)
    1320   printf ("ns32k-encore-mach\n"); exit (0);
    1321 #else
    1322   printf ("ns32k-encore-bsd\n"); exit (0);
    1323 #endif
    1324 #endif
    1325 #endif
    1326 
    1327 #if defined (__386BSD__)
    1328   printf ("i386-pc-bsd\n"); exit (0);
    1329 #endif
    1330 
    1331 #if defined (sequent)
    1332 #if defined (i386)
    1333   printf ("i386-sequent-dynix\n"); exit (0);
    1334 #endif
    1335 #if defined (ns32000)
    1336   printf ("ns32k-sequent-dynix\n"); exit (0);
    1337 #endif
    1338 #endif
    1339 
    1340 #if defined (_SEQUENT_)
    1341     struct utsname un;
    1342 
    1343     uname(&un);
    1344 
    1345     if (strncmp(un.version, "V2", 2) == 0) {
    1346         printf ("i386-sequent-ptx2\n"); exit (0);
    1347     }
    1348     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
    1349         printf ("i386-sequent-ptx1\n"); exit (0);
    1350     }
    1351     printf ("i386-sequent-ptx\n"); exit (0);
    1352 
    1353 #endif
    1354 
    1355 #if defined (vax)
    1356 # if !defined (ultrix)
    1357 #  include <sys/param.h>
    1358 #  if defined (BSD)
    1359 #   if BSD == 43
    1360       printf ("vax-dec-bsd4.3\n"); exit (0);
    1361 #   else
    1362 #    if BSD == 199006
    1363       printf ("vax-dec-bsd4.3reno\n"); exit (0);
    1364 #    else
    1365       printf ("vax-dec-bsd\n"); exit (0);
    1366 #    endif
    1367 #   endif
    1368 #  else
    1369     printf ("vax-dec-bsd\n"); exit (0);
    1370 #  endif
    1371 # else
    1372     printf ("vax-dec-ultrix\n"); exit (0);
    1373 # endif
    1374 #endif
    1375 
    1376 #if defined (alliant) && defined (i860)
    1377   printf ("i860-alliant-bsd\n"); exit (0);
    1378 #endif
    1379 
    1380   exit (1);
    1381 }
    1382 EOF
    1383 
    1384 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
    1385 
    1386 # Apollos put the system type in the environment.
    1387 
    1388 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
    1389 
    1390 # Convex versions that predate uname can use getsysinfo(1)
    1391 
    1392 if [ -x /usr/convex/getsysinfo ]
    1393 then
    1394     case `getsysinfo -f cpu_type` in
    1395     c1*)
    1396         echo c1-convex-bsd
    1397         exit 0 ;;
    1398     c2*)
    1399         if getsysinfo -f scalar_acc
    1400         then echo c32-convex-bsd
    1401         else echo c2-convex-bsd
    1402         fi
    1403         exit 0 ;;
    1404     c34*)
    1405         echo c34-convex-bsd
    1406         exit 0 ;;
    1407     c38*)
    1408         echo c38-convex-bsd
    1409         exit 0 ;;
    1410     c4*)
    1411         echo c4-convex-bsd
    1412         exit 0 ;;
    1413     esac
    1414 fi
    1415 
    1416 cat >&2 <<EOF
    1417 $0: unable to guess system type
    1418 
    1419 This script, last modified $timestamp, has failed to recognize
    1420 the operating system you are using. It is advised that you
    1421 download the most up to date version of the config scripts from
    1422 
    1423     ftp://ftp.gnu.org/pub/gnu/config/
    1424 
    1425 If the version you run ($0) is already up to date, please
    1426 send the following data and any information you think might be
    1427 pertinent to <config-patches@gnu.org> in order to provide the needed
    1428 information to handle your system.
    1429 
    1430 config.guess timestamp = $timestamp
    1431 
    1432 uname -m = `(uname -m) 2>/dev/null || echo unknown`
    1433 uname -r = `(uname -r) 2>/dev/null || echo unknown`
    1434 uname -s = `(uname -s) 2>/dev/null || echo unknown`
    1435 uname -v = `(uname -v) 2>/dev/null || echo unknown`
    1436 
    1437 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
    1438 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
    1439 
    1440 hostinfo               = `(hostinfo) 2>/dev/null`
    1441 /bin/universe          = `(/bin/universe) 2>/dev/null`
    1442 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
    1443 /bin/arch              = `(/bin/arch) 2>/dev/null`
    1444 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
    1445 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
    1446 
    1447 UNAME_MACHINE = ${UNAME_MACHINE}
    1448 UNAME_RELEASE = ${UNAME_RELEASE}
    1449 UNAME_SYSTEM  = ${UNAME_SYSTEM}
    1450 UNAME_VERSION = ${UNAME_VERSION}
    1451 EOF
    1452 
    1453 exit 1
    1454 
    1455 # Local variables:
    1456 # eval: (add-hook 'write-file-hooks 'time-stamp)
    1457 # time-stamp-start: "timestamp='"
    1458 # time-stamp-format: "%:y-%02m-%02d"
    1459 # time-stamp-end: "'"
    1460 # End:
  • deleted file pslib/config.sub

    + -  
    1 #! /bin/sh
    2 # Configuration validation subroutine script.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    5 
    6 timestamp='2004-06-24'
    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, 2002, 2003, 2004
    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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
    122   kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
    123     os=-$maybe_os
    124     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    125     ;;
    126   *)
    127     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    128     if [ $basic_machine != $1 ]
    129     then os=`echo $1 | sed 's/.*-/-/'`
    130     else os=; fi
    131     ;;
    132 esac
    133 
    134 ### Let's recognize common machines as not being operating systems so
    135 ### that things like config.sub decstation-3100 work.  We also
    136 ### recognize some manufacturers as not being operating systems, so we
    137 ### can provide default operating systems below.
    138 case $os in
    139         -sun*os*)
    140                 # Prevent following clause from handling this invalid input.
    141                 ;;
    142         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
    143         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
    144         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
    145         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
    146         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    147         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    148         -apple | -axis | -knuth | -cray)
    149                 os=
    150                 basic_machine=$1
    151                 ;;
    152         -sim | -cisco | -oki | -wec | -winbond)
    153                 os=
    154                 basic_machine=$1
    155                 ;;
    156         -scout)
    157                 ;;
    158         -wrs)
    159                 os=-vxworks
    160                 basic_machine=$1
    161                 ;;
    162         -chorusos*)
    163                 os=-chorusos
    164                 basic_machine=$1
    165                 ;;
    166         -chorusrdb)
    167                 os=-chorusrdb
    168                 basic_machine=$1
    169                 ;;
    170         -hiux*)
    171                 os=-hiuxwe2
    172                 ;;
    173         -sco5)
    174                 os=-sco3.2v5
    175                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    176                 ;;
    177         -sco4)
    178                 os=-sco3.2v4
    179                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    180                 ;;
    181         -sco3.2.[4-9]*)
    182                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
    183                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    184                 ;;
    185         -sco3.2v[4-9]*)
    186                 # Don't forget version if it is 3.2v4 or newer.
    187                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    188                 ;;
    189         -sco*)
    190                 os=-sco3.2v2
    191                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    192                 ;;
    193         -udk*)
    194                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    195                 ;;
    196         -isc)
    197                 os=-isc2.2
    198                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    199                 ;;
    200         -clix*)
    201                 basic_machine=clipper-intergraph
    202                 ;;
    203         -isc*)
    204                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    205                 ;;
    206         -lynx*)
    207                 os=-lynxos
    208                 ;;
    209         -ptx*)
    210                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
    211                 ;;
    212         -windowsnt*)
    213                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
    214                 ;;
    215         -psos*)
    216                 os=-psos
    217                 ;;
    218         -mint | -mint[0-9]*)
    219                 basic_machine=m68k-atari
    220                 os=-mint
    221                 ;;
    222 esac
    223 
    224 # Decode aliases for certain CPU-COMPANY combinations.
    225 case $basic_machine in
    226         # Recognize the basic CPU types without company name.
    227         # Some are omitted here because they have special meanings below.
    228         1750a | 580 \
    229         | a29k \
    230         | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
    231         | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    232         | am33_2.0 \
    233         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
    234         | c4x | clipper \
    235         | d10v | d30v | dlx | dsp16xx \
    236         | fr30 | frv \
    237         | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    238         | i370 | i860 | i960 | ia64 \
    239         | ip2k | iq2000 \
    240         | m32r | m32rle | m68000 | m68k | m88k | mcore \
    241         | mips | mipsbe | mipseb | mipsel | mipsle \
    242         | mips16 \
    243         | mips64 | mips64el \
    244         | mips64vr | mips64vrel \
    245         | mips64orion | mips64orionel \
    246         | mips64vr4100 | mips64vr4100el \
    247         | mips64vr4300 | mips64vr4300el \
    248         | mips64vr5000 | mips64vr5000el \
    249         | mipsisa32 | mipsisa32el \
    250         | mipsisa32r2 | mipsisa32r2el \
    251         | mipsisa64 | mipsisa64el \
    252         | mipsisa64r2 | mipsisa64r2el \
    253         | mipsisa64sb1 | mipsisa64sb1el \
    254         | mipsisa64sr71k | mipsisa64sr71kel \
    255         | mipstx39 | mipstx39el \
    256         | mn10200 | mn10300 \
    257         | msp430 \
    258         | ns16k | ns32k \
    259         | openrisc | or32 \
    260         | pdp10 | pdp11 | pj | pjl \
    261         | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
    262         | pyramid \
    263         | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
    264         | sh64 | sh64le \
    265         | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
    266         | strongarm \
    267         | tahoe | thumb | tic4x | tic80 | tron \
    268         | v850 | v850e \
    269         | we32k \
    270         | x86 | xscale | xstormy16 | xtensa \
    271         | z8k)
    272                 basic_machine=$basic_machine-unknown
    273                 ;;
    274         m6811 | m68hc11 | m6812 | m68hc12)
    275                 # Motorola 68HC11/12.
    276                 basic_machine=$basic_machine-unknown
    277                 os=-none
    278                 ;;
    279         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
    280                 ;;
    281 
    282         # We use `pc' rather than `unknown'
    283         # because (1) that's what they normally are, and
    284         # (2) the word "unknown" tends to confuse beginning users.
    285         i*86 | x86_64)
    286           basic_machine=$basic_machine-pc
    287           ;;
    288         # Object if more than one company name word.
    289         *-*-*)
    290                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
    291                 exit 1
    292                 ;;
    293         # Recognize the basic CPU types with company name.
    294         580-* \
    295         | a29k-* \
    296         | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
    297         | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
    298         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
    299         | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    300         | avr-* \
    301         | bs2000-* \
    302         | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
    303         | clipper-* | craynv-* | cydra-* \
    304         | d10v-* | d30v-* | dlx-* \
    305         | elxsi-* \
    306         | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
    307         | h8300-* | h8500-* \
    308         | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    309         | i*86-* | i860-* | i960-* | ia64-* \
    310         | ip2k-* | iq2000-* \
    311         | m32r-* | m32rle-* \
    312         | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    313         | m88110-* | m88k-* | mcore-* \
    314         | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    315         | mips16-* \
    316         | mips64-* | mips64el-* \
    317         | mips64vr-* | mips64vrel-* \
    318         | mips64orion-* | mips64orionel-* \
    319         | mips64vr4100-* | mips64vr4100el-* \
    320         | mips64vr4300-* | mips64vr4300el-* \
    321         | mips64vr5000-* | mips64vr5000el-* \
    322         | mipsisa32-* | mipsisa32el-* \
    323         | mipsisa32r2-* | mipsisa32r2el-* \
    324         | mipsisa64-* | mipsisa64el-* \
    325         | mipsisa64r2-* | mipsisa64r2el-* \
    326         | mipsisa64sb1-* | mipsisa64sb1el-* \
    327         | mipsisa64sr71k-* | mipsisa64sr71kel-* \
    328         | mipstx39-* | mipstx39el-* \
    329         | mmix-* \
    330         | msp430-* \
    331         | none-* | np1-* | ns16k-* | ns32k-* \
    332         | orion-* \
    333         | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
    334         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
    335         | pyramid-* \
    336         | romp-* | rs6000-* \
    337         | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
    338         | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    339         | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
    340         | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
    341         | tahoe-* | thumb-* \
    342         | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
    343         | tron-* \
    344         | v850-* | v850e-* | vax-* \
    345         | we32k-* \
    346         | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
    347         | xtensa-* \
    348         | ymp-* \
    349         | z8k-*)
    350                 ;;
    351         # Recognize the various machine names and aliases which stand
    352         # for a CPU type and a company and sometimes even an OS.
    353         386bsd)
    354                 basic_machine=i386-unknown
    355                 os=-bsd
    356                 ;;
    357         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
    358                 basic_machine=m68000-att
    359                 ;;
    360         3b*)
    361                 basic_machine=we32k-att
    362                 ;;
    363         a29khif)
    364                 basic_machine=a29k-amd
    365                 os=-udi
    366                 ;;
    367         abacus)
    368                 basic_machine=abacus-unknown
    369                 ;;
    370         adobe68k)
    371                 basic_machine=m68010-adobe
    372                 os=-scout
    373                 ;;
    374         alliant | fx80)
    375                 basic_machine=fx80-alliant
    376                 ;;
    377         altos | altos3068)
    378                 basic_machine=m68k-altos
    379                 ;;
    380         am29k)
    381                 basic_machine=a29k-none
    382                 os=-bsd
    383                 ;;
    384         amd64)
    385                 basic_machine=x86_64-pc
    386                 ;;
    387         amd64-*)
    388                 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
    389                 ;;
    390         amdahl)
    391                 basic_machine=580-amdahl
    392                 os=-sysv
    393                 ;;
    394         amiga | amiga-*)
    395                 basic_machine=m68k-unknown
    396                 ;;
    397         amigaos | amigados)
    398                 basic_machine=m68k-unknown
    399                 os=-amigaos
    400                 ;;
    401         amigaunix | amix)
    402                 basic_machine=m68k-unknown
    403                 os=-sysv4
    404                 ;;
    405         apollo68)
    406                 basic_machine=m68k-apollo
    407                 os=-sysv
    408                 ;;
    409         apollo68bsd)
    410                 basic_machine=m68k-apollo
    411                 os=-bsd
    412                 ;;
    413         aux)
    414                 basic_machine=m68k-apple
    415                 os=-aux
    416                 ;;
    417         balance)
    418                 basic_machine=ns32k-sequent
    419                 os=-dynix
    420                 ;;
    421         c90)
    422                 basic_machine=c90-cray
    423                 os=-unicos
    424                 ;;
    425         convex-c1)
    426                 basic_machine=c1-convex
    427                 os=-bsd
    428                 ;;
    429         convex-c2)
    430                 basic_machine=c2-convex
    431                 os=-bsd
    432                 ;;
    433         convex-c32)
    434                 basic_machine=c32-convex
    435                 os=-bsd
    436                 ;;
    437         convex-c34)
    438                 basic_machine=c34-convex
    439                 os=-bsd
    440                 ;;
    441         convex-c38)
    442                 basic_machine=c38-convex
    443                 os=-bsd
    444                 ;;
    445         cray | j90)
    446                 basic_machine=j90-cray
    447                 os=-unicos
    448                 ;;
    449         craynv)
    450                 basic_machine=craynv-cray
    451                 os=-unicosmp
    452                 ;;
    453         cr16c)
    454                 basic_machine=cr16c-unknown
    455                 os=-elf
    456                 ;;
    457         crds | unos)
    458                 basic_machine=m68k-crds
    459                 ;;
    460         cris | cris-* | etrax*)
    461                 basic_machine=cris-axis
    462                 ;;
    463         crx)
    464                 basic_machine=crx-unknown
    465                 os=-elf
    466                 ;;
    467         da30 | da30-*)
    468                 basic_machine=m68k-da30
    469                 ;;
    470         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    471                 basic_machine=mips-dec
    472                 ;;
    473         decsystem10* | dec10*)
    474                 basic_machine=pdp10-dec
    475                 os=-tops10
    476                 ;;
    477         decsystem20* | dec20*)
    478                 basic_machine=pdp10-dec
    479                 os=-tops20
    480                 ;;
    481         delta | 3300 | motorola-3300 | motorola-delta \
    482               | 3300-motorola | delta-motorola)
    483                 basic_machine=m68k-motorola
    484                 ;;
    485         delta88)
    486                 basic_machine=m88k-motorola
    487                 os=-sysv3
    488                 ;;
    489         dpx20 | dpx20-*)
    490                 basic_machine=rs6000-bull
    491                 os=-bosx
    492                 ;;
    493         dpx2* | dpx2*-bull)
    494                 basic_machine=m68k-bull
    495                 os=-sysv3
    496                 ;;
    497         ebmon29k)
    498                 basic_machine=a29k-amd
    499                 os=-ebmon
    500                 ;;
    501         elxsi)
    502                 basic_machine=elxsi-elxsi
    503                 os=-bsd
    504                 ;;
    505         encore | umax | mmax)
    506                 basic_machine=ns32k-encore
    507                 ;;
    508         es1800 | OSE68k | ose68k | ose | OSE)
    509                 basic_machine=m68k-ericsson
    510                 os=-ose
    511                 ;;
    512         fx2800)
    513                 basic_machine=i860-alliant
    514                 ;;
    515         genix)
    516                 basic_machine=ns32k-ns
    517                 ;;
    518         gmicro)
    519                 basic_machine=tron-gmicro
    520                 os=-sysv
    521                 ;;
    522         go32)
    523                 basic_machine=i386-pc
    524                 os=-go32
    525                 ;;
    526         h3050r* | hiux*)
    527                 basic_machine=hppa1.1-hitachi
    528                 os=-hiuxwe2
    529                 ;;
    530         h8300hms)
    531                 basic_machine=h8300-hitachi
    532                 os=-hms
    533                 ;;
    534         h8300xray)
    535                 basic_machine=h8300-hitachi
    536                 os=-xray
    537                 ;;
    538         h8500hms)
    539                 basic_machine=h8500-hitachi
    540                 os=-hms
    541                 ;;
    542         harris)
    543                 basic_machine=m88k-harris
    544                 os=-sysv3
    545                 ;;
    546         hp300-*)
    547                 basic_machine=m68k-hp
    548                 ;;
    549         hp300bsd)
    550                 basic_machine=m68k-hp
    551                 os=-bsd
    552                 ;;
    553         hp300hpux)
    554                 basic_machine=m68k-hp
    555                 os=-hpux
    556                 ;;
    557         hp3k9[0-9][0-9] | hp9[0-9][0-9])
    558                 basic_machine=hppa1.0-hp
    559                 ;;
    560         hp9k2[0-9][0-9] | hp9k31[0-9])
    561                 basic_machine=m68000-hp
    562                 ;;
    563         hp9k3[2-9][0-9])
    564                 basic_machine=m68k-hp
    565                 ;;
    566         hp9k6[0-9][0-9] | hp6[0-9][0-9])
    567                 basic_machine=hppa1.0-hp
    568                 ;;
    569         hp9k7[0-79][0-9] | hp7[0-79][0-9])
    570                 basic_machine=hppa1.1-hp
    571                 ;;
    572         hp9k78[0-9] | hp78[0-9])
    573                 # FIXME: really hppa2.0-hp
    574                 basic_machine=hppa1.1-hp
    575                 ;;
    576         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
    577                 # FIXME: really hppa2.0-hp
    578                 basic_machine=hppa1.1-hp
    579                 ;;
    580         hp9k8[0-9][13679] | hp8[0-9][13679])
    581                 basic_machine=hppa1.1-hp
    582                 ;;
    583         hp9k8[0-9][0-9] | hp8[0-9][0-9])
    584                 basic_machine=hppa1.0-hp
    585                 ;;
    586         hppa-next)
    587                 os=-nextstep3
    588                 ;;
    589         hppaosf)
    590                 basic_machine=hppa1.1-hp
    591                 os=-osf
    592                 ;;
    593         hppro)
    594                 basic_machine=hppa1.1-hp
    595                 os=-proelf
    596                 ;;
    597         i370-ibm* | ibm*)
    598                 basic_machine=i370-ibm
    599                 ;;
    600 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
    601         i*86v32)
    602                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    603                 os=-sysv32
    604                 ;;
    605         i*86v4*)
    606                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    607                 os=-sysv4
    608                 ;;
    609         i*86v)
    610                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    611                 os=-sysv
    612                 ;;
    613         i*86sol2)
    614                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    615                 os=-solaris2
    616                 ;;
    617         i386mach)
    618                 basic_machine=i386-mach
    619                 os=-mach
    620                 ;;
    621         i386-vsta | vsta)
    622                 basic_machine=i386-unknown
    623                 os=-vsta
    624                 ;;
    625         iris | iris4d)
    626                 basic_machine=mips-sgi
    627                 case $os in
    628                     -irix*)
    629                         ;;
    630                     *)
    631                         os=-irix4
    632                         ;;
    633                 esac
    634                 ;;
    635         isi68 | isi)
    636                 basic_machine=m68k-isi
    637                 os=-sysv
    638                 ;;
    639         m88k-omron*)
    640                 basic_machine=m88k-omron
    641                 ;;
    642         magnum | m3230)
    643                 basic_machine=mips-mips
    644                 os=-sysv
    645                 ;;
    646         merlin)
    647                 basic_machine=ns32k-utek
    648                 os=-sysv
    649                 ;;
    650         mingw32)
    651                 basic_machine=i386-pc
    652                 os=-mingw32
    653                 ;;
    654         miniframe)
    655                 basic_machine=m68000-convergent
    656                 ;;
    657         *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
    658                 basic_machine=m68k-atari
    659                 os=-mint
    660                 ;;
    661         mips3*-*)
    662                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
    663                 ;;
    664         mips3*)
    665                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    666                 ;;
    667         monitor)
    668                 basic_machine=m68k-rom68k
    669                 os=-coff
    670                 ;;
    671         morphos)
    672                 basic_machine=powerpc-unknown
    673                 os=-morphos
    674                 ;;
    675         msdos)
    676                 basic_machine=i386-pc
    677                 os=-msdos
    678                 ;;
    679         mvs)
    680                 basic_machine=i370-ibm
    681                 os=-mvs
    682                 ;;
    683         ncr3000)
    684                 basic_machine=i486-ncr
    685                 os=-sysv4
    686                 ;;
    687         netbsd386)
    688                 basic_machine=i386-unknown
    689                 os=-netbsd
    690                 ;;
    691         netwinder)
    692                 basic_machine=armv4l-rebel
    693                 os=-linux
    694                 ;;
    695         news | news700 | news800 | news900)
    696                 basic_machine=m68k-sony
    697                 os=-newsos
    698                 ;;
    699         news1000)
    700                 basic_machine=m68030-sony
    701                 os=-newsos
    702                 ;;
    703         news-3600 | risc-news)
    704                 basic_machine=mips-sony
    705                 os=-newsos
    706                 ;;
    707         necv70)
    708                 basic_machine=v70-nec
    709                 os=-sysv
    710                 ;;
    711         next | m*-next )
    712                 basic_machine=m68k-next
    713                 case $os in
    714                     -nextstep* )
    715                         ;;
    716                     -ns2*)
    717                       os=-nextstep2
    718                         ;;
    719                     *)
    720                       os=-nextstep3
    721                         ;;
    722                 esac
    723                 ;;
    724         nh3000)
    725                 basic_machine=m68k-harris
    726                 os=-cxux
    727                 ;;
    728         nh[45]000)
    729                 basic_machine=m88k-harris
    730                 os=-cxux
    731                 ;;
    732         nindy960)
    733                 basic_machine=i960-intel
    734                 os=-nindy
    735                 ;;
    736         mon960)
    737                 basic_machine=i960-intel
    738                 os=-mon960
    739                 ;;
    740         nonstopux)
    741                 basic_machine=mips-compaq
    742                 os=-nonstopux
    743                 ;;
    744         np1)
    745                 basic_machine=np1-gould
    746                 ;;
    747         nsr-tandem)
    748                 basic_machine=nsr-tandem
    749                 ;;
    750         op50n-* | op60c-*)
    751                 basic_machine=hppa1.1-oki
    752                 os=-proelf
    753                 ;;
    754         or32 | or32-*)
    755                 basic_machine=or32-unknown
    756                 os=-coff
    757                 ;;
    758         os400)
    759                 basic_machine=powerpc-ibm
    760                 os=-os400
    761                 ;;
    762         OSE68000 | ose68000)
    763                 basic_machine=m68000-ericsson
    764                 os=-ose
    765                 ;;
    766         os68k)
    767                 basic_machine=m68k-none
    768                 os=-os68k
    769                 ;;
    770         pa-hitachi)
    771                 basic_machine=hppa1.1-hitachi
    772                 os=-hiuxwe2
    773                 ;;
    774         paragon)
    775                 basic_machine=i860-intel
    776                 os=-osf
    777                 ;;
    778         pbd)
    779                 basic_machine=sparc-tti
    780                 ;;
    781         pbb)
    782                 basic_machine=m68k-tti
    783                 ;;
    784         pc532 | pc532-*)
    785                 basic_machine=ns32k-pc532
    786                 ;;
    787         pentium | p5 | k5 | k6 | nexgen | viac3)
    788                 basic_machine=i586-pc
    789                 ;;
    790         pentiumpro | p6 | 6x86 | athlon | athlon_*)
    791                 basic_machine=i686-pc
    792                 ;;
    793         pentiumii | pentium2 | pentiumiii | pentium3)
    794                 basic_machine=i686-pc
    795                 ;;
    796         pentium4)
    797                 basic_machine=i786-pc
    798                 ;;
    799         pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    800                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    801                 ;;
    802         pentiumpro-* | p6-* | 6x86-* | athlon-*)
    803                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    804                 ;;
    805         pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    806                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    807                 ;;
    808         pentium4-*)
    809                 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    810                 ;;
    811         pn)
    812                 basic_machine=pn-gould
    813                 ;;
    814         power)  basic_machine=power-ibm
    815                 ;;
    816         ppc)    basic_machine=powerpc-unknown
    817                 ;;
    818         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    819                 ;;
    820         ppcle | powerpclittle | ppc-le | powerpc-little)
    821                 basic_machine=powerpcle-unknown
    822                 ;;
    823         ppcle-* | powerpclittle-*)
    824                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
    825                 ;;
    826         ppc64)  basic_machine=powerpc64-unknown
    827                 ;;
    828         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
    829                 ;;
    830         ppc64le | powerpc64little | ppc64-le | powerpc64-little)
    831                 basic_machine=powerpc64le-unknown
    832                 ;;
    833         ppc64le-* | powerpc64little-*)
    834                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
    835                 ;;
    836         ps2)
    837                 basic_machine=i386-ibm
    838                 ;;
    839         pw32)
    840                 basic_machine=i586-unknown
    841                 os=-pw32
    842                 ;;
    843         rom68k)
    844                 basic_machine=m68k-rom68k
    845                 os=-coff
    846                 ;;
    847         rm[46]00)
    848                 basic_machine=mips-siemens
    849                 ;;
    850         rtpc | rtpc-*)
    851                 basic_machine=romp-ibm
    852                 ;;
    853         s390 | s390-*)
    854                 basic_machine=s390-ibm
    855                 ;;
    856         s390x | s390x-*)
    857                 basic_machine=s390x-ibm
    858                 ;;
    859         sa29200)
    860                 basic_machine=a29k-amd
    861                 os=-udi
    862                 ;;
    863         sb1)
    864                 basic_machine=mipsisa64sb1-unknown
    865                 ;;
    866         sb1el)
    867                 basic_machine=mipsisa64sb1el-unknown
    868                 ;;
    869         sei)
    870                 basic_machine=mips-sei
    871                 os=-seiux
    872                 ;;
    873         sequent)
    874                 basic_machine=i386-sequent
    875                 ;;
    876         sh)
    877                 basic_machine=sh-hitachi
    878                 os=-hms
    879                 ;;
    880         sh64)
    881                 basic_machine=sh64-unknown
    882                 ;;
    883         sparclite-wrs | simso-wrs)
    884                 basic_machine=sparclite-wrs
    885                 os=-vxworks
    886                 ;;
    887         sps7)
    888                 basic_machine=m68k-bull
    889                 os=-sysv2
    890                 ;;
    891         spur)
    892                 basic_machine=spur-unknown
    893                 ;;
    894         st2000)
    895                 basic_machine=m68k-tandem
    896                 ;;
    897         stratus)
    898                 basic_machine=i860-stratus
    899                 os=-sysv4
    900                 ;;
    901         sun2)
    902                 basic_machine=m68000-sun
    903                 ;;
    904         sun2os3)
    905                 basic_machine=m68000-sun
    906                 os=-sunos3
    907                 ;;
    908         sun2os4)
    909                 basic_machine=m68000-sun
    910                 os=-sunos4
    911                 ;;
    912         sun3os3)
    913                 basic_machine=m68k-sun
    914                 os=-sunos3
    915                 ;;
    916         sun3os4)
    917                 basic_machine=m68k-sun
    918                 os=-sunos4
    919                 ;;
    920         sun4os3)
    921                 basic_machine=sparc-sun
    922                 os=-sunos3
    923                 ;;
    924         sun4os4)
    925                 basic_machine=sparc-sun
    926                 os=-sunos4
    927                 ;;
    928         sun4sol2)
    929                 basic_machine=sparc-sun
    930                 os=-solaris2
    931                 ;;
    932         sun3 | sun3-*)
    933                 basic_machine=m68k-sun
    934                 ;;
    935         sun4)
    936                 basic_machine=sparc-sun
    937                 ;;
    938         sun386 | sun386i | roadrunner)
    939                 basic_machine=i386-sun
    940                 ;;
    941         sv1)
    942                 basic_machine=sv1-cray
    943                 os=-unicos
    944                 ;;
    945         symmetry)
    946                 basic_machine=i386-sequent
    947                 os=-dynix
    948                 ;;
    949         t3e)
    950                 basic_machine=alphaev5-cray
    951                 os=-unicos
    952                 ;;
    953         t90)
    954                 basic_machine=t90-cray
    955                 os=-unicos
    956                 ;;
    957         tic54x | c54x*)
    958                 basic_machine=tic54x-unknown
    959                 os=-coff
    960                 ;;
    961         tic55x | c55x*)
    962                 basic_machine=tic55x-unknown
    963                 os=-coff
    964                 ;;
    965         tic6x | c6x*)
    966                 basic_machine=tic6x-unknown
    967                 os=-coff
    968                 ;;
    969         tx39)
    970                 basic_machine=mipstx39-unknown
    971                 ;;
    972         tx39el)
    973                 basic_machine=mipstx39el-unknown
    974                 ;;
    975         toad1)
    976                 basic_machine=pdp10-xkl
    977                 os=-tops20
    978                 ;;
    979         tower | tower-32)
    980                 basic_machine=m68k-ncr
    981                 ;;
    982         tpf)
    983                 basic_machine=s390x-ibm
    984                 os=-tpf
    985                 ;;
    986         udi29k)
    987                 basic_machine=a29k-amd
    988                 os=-udi
    989                 ;;
    990         ultra3)
    991                 basic_machine=a29k-nyu
    992                 os=-sym1
    993                 ;;
    994         v810 | necv810)
    995                 basic_machine=v810-nec
    996                 os=-none
    997                 ;;
    998         vaxv)
    999                 basic_machine=vax-dec
    1000                 os=-sysv
    1001                 ;;
    1002         vms)
    1003                 basic_machine=vax-dec
    1004                 os=-vms
    1005                 ;;
    1006         vpp*|vx|vx-*)
    1007                 basic_machine=f301-fujitsu
    1008                 ;;
    1009         vxworks960)
    1010                 basic_machine=i960-wrs
    1011                 os=-vxworks
    1012                 ;;
    1013         vxworks68)
    1014                 basic_machine=m68k-wrs
    1015                 os=-vxworks
    1016                 ;;
    1017         vxworks29k)
    1018                 basic_machine=a29k-wrs
    1019                 os=-vxworks
    1020                 ;;
    1021         w65*)
    1022                 basic_machine=w65-wdc
    1023                 os=-none
    1024                 ;;
    1025         w89k-*)
    1026                 basic_machine=hppa1.1-winbond
    1027                 os=-proelf
    1028                 ;;
    1029         xps | xps100)
    1030                 basic_machine=xps100-honeywell
    1031                 ;;
    1032         ymp)
    1033                 basic_machine=ymp-cray
    1034                 os=-unicos
    1035                 ;;
    1036         z8k-*-coff)
    1037                 basic_machine=z8k-unknown
    1038                 os=-sim
    1039                 ;;
    1040         none)
    1041                 basic_machine=none-none
    1042                 os=-none
    1043                 ;;
    1044 
    1045 # Here we handle the default manufacturer of certain CPU types.  It is in
    1046 # some cases the only manufacturer, in others, it is the most popular.
    1047         w89k)
    1048                 basic_machine=hppa1.1-winbond
    1049                 ;;
    1050         op50n)
    1051                 basic_machine=hppa1.1-oki
    1052                 ;;
    1053         op60c)
    1054                 basic_machine=hppa1.1-oki
    1055                 ;;
    1056         romp)
    1057                 basic_machine=romp-ibm
    1058                 ;;
    1059         mmix)
    1060                 basic_machine=mmix-knuth
    1061                 ;;
    1062         rs6000)
    1063                 basic_machine=rs6000-ibm
    1064                 ;;
    1065         vax)
    1066                 basic_machine=vax-dec
    1067                 ;;
    1068         pdp10)
    1069                 # there are many clones, so DEC is not a safe bet
    1070                 basic_machine=pdp10-unknown
    1071                 ;;
    1072         pdp11)
    1073                 basic_machine=pdp11-dec
    1074                 ;;
    1075         we32k)
    1076                 basic_machine=we32k-att
    1077                 ;;
    1078         sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
    1079                 basic_machine=sh-unknown
    1080                 ;;
    1081         sh64)
    1082                 basic_machine=sh64-unknown
    1083                 ;;
    1084         sparc | sparcv8 | sparcv9 | sparcv9b)
    1085                 basic_machine=sparc-sun
    1086                 ;;
    1087         cydra)
    1088                 basic_machine=cydra-cydrome
    1089                 ;;
    1090         orion)
    1091                 basic_machine=orion-highlevel
    1092                 ;;
    1093         orion105)
    1094                 basic_machine=clipper-highlevel
    1095                 ;;
    1096         mac | mpw | mac-mpw)
    1097                 basic_machine=m68k-apple
    1098                 ;;
    1099         pmac | pmac-mpw)
    1100                 basic_machine=powerpc-apple
    1101                 ;;
    1102         *-unknown)
    1103                 # Make sure to match an already-canonicalized machine name.
    1104                 ;;
    1105         *)
    1106                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
    1107                 exit 1
    1108                 ;;
    1109 esac
    1110 
    1111 # Here we canonicalize certain aliases for manufacturers.
    1112 case $basic_machine in
    1113         *-digital*)
    1114                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
    1115                 ;;
    1116         *-commodore*)
    1117                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
    1118                 ;;
    1119         *)
    1120                 ;;
    1121 esac
    1122 
    1123 # Decode manufacturer-specific aliases for certain operating systems.
    1124 
    1125 if [ x"$os" != x"" ]
    1126 then
    1127 case $os in
    1128         # First match some system type aliases
    1129         # that might get confused with valid system types.
    1130         # -solaris* is a basic system type, with this one exception.
    1131         -solaris1 | -solaris1.*)
    1132                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
    1133                 ;;
    1134         -solaris)
    1135                 os=-solaris2
    1136                 ;;
    1137         -svr4*)
    1138                 os=-sysv4
    1139                 ;;
    1140         -unixware*)
    1141                 os=-sysv4.2uw
    1142                 ;;
    1143         -gnu/linux*)
    1144                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
    1145                 ;;
    1146         # First accept the basic system types.
    1147         # The portable systems comes first.
    1148         # Each alternative MUST END IN A *, to match a version number.
    1149         # -sysv* is not here because it comes later, after sysvr4.
    1150         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
    1151               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
    1152               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
    1153               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1154               | -aos* \
    1155               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    1156               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1157               | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
    1158               | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    1159               | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    1160               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    1161               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1162               | -chorusos* | -chorusrdb* \
    1163               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1164               | -mingw32* | -linux* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
    1165               | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    1166               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
    1167               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
    1168               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    1169               | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    1170               | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
    1171         # Remember, each alternative MUST END IN *, to match a version number.
    1172                 ;;
    1173         -qnx*)
    1174                 case $basic_machine in
    1175                     x86-* | i*86-*)
    1176                         ;;
    1177                     *)
    1178                         os=-nto$os
    1179                         ;;
    1180                 esac
    1181                 ;;
    1182         -nto-qnx*)
    1183                 ;;
    1184         -nto*)
    1185                 os=`echo $os | sed -e 's|nto|nto-qnx|'`
    1186                 ;;
    1187         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1188               | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
    1189               | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    1190                 ;;
    1191         -mac*)
    1192                 os=`echo $os | sed -e 's|mac|macos|'`
    1193                 ;;
    1194         -linux-dietlibc)
    1195                 os=-linux-dietlibc
    1196                 ;;
    1197         -sunos5*)
    1198                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
    1199                 ;;
    1200         -sunos6*)
    1201                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
    1202                 ;;
    1203         -opened*)
    1204                 os=-openedition
    1205                 ;;
    1206         -os400*)
    1207                 os=-os400
    1208                 ;;
    1209         -wince*)
    1210                 os=-wince
    1211                 ;;
    1212         -osfrose*)
    1213                 os=-osfrose
    1214                 ;;
    1215         -osf*)
    1216                 os=-osf
    1217                 ;;
    1218         -utek*)
    1219                 os=-bsd
    1220                 ;;
    1221         -dynix*)
    1222                 os=-bsd
    1223                 ;;
    1224         -acis*)
    1225                 os=-aos
    1226                 ;;
    1227         -atheos*)
    1228                 os=-atheos
    1229                 ;;
    1230         -syllable*)
    1231                 os=-syllable
    1232                 ;;
    1233         -386bsd)
    1234                 os=-bsd
    1235                 ;;
    1236         -ctix* | -uts*)
    1237                 os=-sysv
    1238                 ;;
    1239         -nova*)
    1240                 os=-rtmk-nova
    1241                 ;;
    1242         -ns2 )
    1243                 os=-nextstep2
    1244                 ;;
    1245         -nsk*)
    1246                 os=-nsk
    1247                 ;;
    1248         # Preserve the version number of sinix5.
    1249         -sinix5.*)
    1250                 os=`echo $os | sed -e 's|sinix|sysv|'`
    1251                 ;;
    1252         -sinix*)
    1253                 os=-sysv4
    1254                 ;;
    1255         -tpf*)
    1256                 os=-tpf
    1257                 ;;
    1258         -triton*)
    1259                 os=-sysv3
    1260                 ;;
    1261         -oss*)
    1262                 os=-sysv3
    1263                 ;;
    1264         -svr4)
    1265                 os=-sysv4
    1266                 ;;
    1267         -svr3)
    1268                 os=-sysv3
    1269                 ;;
    1270         -sysvr4)
    1271                 os=-sysv4
    1272                 ;;
    1273         # This must come after -sysvr4.
    1274         -sysv*)
    1275                 ;;
    1276         -ose*)
    1277                 os=-ose
    1278                 ;;
    1279         -es1800*)
    1280                 os=-ose
    1281                 ;;
    1282         -xenix)
    1283                 os=-xenix
    1284                 ;;
    1285         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    1286                 os=-mint
    1287                 ;;
    1288         -aros*)
    1289                 os=-aros
    1290                 ;;
    1291         -kaos*)
    1292                 os=-kaos
    1293                 ;;
    1294         -none)
    1295                 ;;
    1296         *)
    1297                 # Get rid of the `-' at the beginning of $os.
    1298                 os=`echo $os | sed 's/[^-]*-//'`
    1299                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
    1300                 exit 1
    1301                 ;;
    1302 esac
    1303 else
    1304 
    1305 # Here we handle the default operating systems that come with various machines.
    1306 # The value should be what the vendor currently ships out the door with their
    1307 # machine or put another way, the most popular os provided with the machine.
    1308 
    1309 # Note that if you're going to try to match "-MANUFACTURER" here (say,
    1310 # "-sun"), then you have to tell the case statement up towards the top
    1311 # that MANUFACTURER isn't an operating system.  Otherwise, code above
    1312 # will signal an error saying that MANUFACTURER isn't an operating
    1313 # system, and we'll never get to this point.
    1314 
    1315 case $basic_machine in
    1316         *-acorn)
    1317                 os=-riscix1.2
    1318                 ;;
    1319         arm*-rebel)
    1320                 os=-linux
    1321                 ;;
    1322         arm*-semi)
    1323                 os=-aout
    1324                 ;;
    1325     c4x-* | tic4x-*)
    1326         os=-coff
    1327         ;;
    1328         # This must come before the *-dec entry.
    1329         pdp10-*)
    1330                 os=-tops20
    1331                 ;;
    1332         pdp11-*)
    1333                 os=-none
    1334                 ;;
    1335         *-dec | vax-*)
    1336                 os=-ultrix4.2
    1337                 ;;
    1338         m68*-apollo)
    1339                 os=-domain
    1340                 ;;
    1341         i386-sun)
    1342                 os=-sunos4.0.2
    1343                 ;;
    1344         m68000-sun)
    1345                 os=-sunos3
    1346                 # This also exists in the configure program, but was not the
    1347                 # default.
    1348                 # os=-sunos4
    1349                 ;;
    1350         m68*-cisco)
    1351                 os=-aout
    1352                 ;;
    1353         mips*-cisco)
    1354                 os=-elf
    1355                 ;;
    1356         mips*-*)
    1357                 os=-elf
    1358                 ;;
    1359         or32-*)
    1360                 os=-coff
    1361                 ;;
    1362         *-tti)  # must be before sparc entry or we get the wrong os.
    1363                 os=-sysv3
    1364                 ;;
    1365         sparc-* | *-sun)
    1366                 os=-sunos4.1.1
    1367                 ;;
    1368         *-be)
    1369                 os=-beos
    1370                 ;;
    1371         *-ibm)
    1372                 os=-aix
    1373                 ;;
    1374         *-knuth)
    1375                 os=-mmixware
    1376                 ;;
    1377         *-wec)
    1378                 os=-proelf
    1379                 ;;
    1380         *-winbond)
    1381                 os=-proelf
    1382                 ;;
    1383         *-oki)
    1384                 os=-proelf
    1385                 ;;
    1386         *-hp)
    1387                 os=-hpux
    1388                 ;;
    1389         *-hitachi)
    1390                 os=-hiux
    1391                 ;;
    1392         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
    1393                 os=-sysv
    1394                 ;;
    1395         *-cbm)
    1396                 os=-amigaos
    1397                 ;;
    1398         *-dg)
    1399                 os=-dgux
    1400                 ;;
    1401         *-dolphin)
    1402                 os=-sysv3
    1403                 ;;
    1404         m68k-ccur)
    1405                 os=-rtu
    1406                 ;;
    1407         m88k-omron*)
    1408                 os=-luna
    1409                 ;;
    1410         *-next )
    1411                 os=-nextstep
    1412                 ;;
    1413         *-sequent)
    1414                 os=-ptx
    1415                 ;;
    1416         *-crds)
    1417                 os=-unos
    1418                 ;;
    1419         *-ns)
    1420                 os=-genix
    1421                 ;;
    1422         i370-*)
    1423                 os=-mvs
    1424                 ;;
    1425         *-next)
    1426                 os=-nextstep3
    1427                 ;;
    1428         *-gould)
    1429                 os=-sysv
    1430                 ;;
    1431         *-highlevel)
    1432                 os=-bsd
    1433                 ;;
    1434         *-encore)
    1435                 os=-bsd
    1436                 ;;
    1437         *-sgi)
    1438                 os=-irix
    1439                 ;;
    1440         *-siemens)
    1441                 os=-sysv4
    1442                 ;;
    1443         *-masscomp)
    1444                 os=-rtu
    1445                 ;;
    1446         f30[01]-fujitsu | f700-fujitsu)
    1447                 os=-uxpv
    1448                 ;;
    1449         *-rom68k)
    1450                 os=-coff
    1451                 ;;
    1452         *-*bug)
    1453                 os=-coff
    1454                 ;;
    1455         *-apple)
    1456                 os=-macos
    1457                 ;;
    1458         *-atari*)
    1459                 os=-mint
    1460                 ;;
    1461         *)
    1462                 os=-none
    1463                 ;;
    1464 esac
    1465 fi
    1466 
    1467 # Here we handle the case where we know the os, and the CPU type, but not the
    1468 # manufacturer.  We pick the logical manufacturer.
    1469 vendor=unknown
    1470 case $basic_machine in
    1471         *-unknown)
    1472                 case $os in
    1473                         -riscix*)
    1474                                 vendor=acorn
    1475                                 ;;
    1476                         -sunos*)
    1477                                 vendor=sun
    1478                                 ;;
    1479                         -aix*)
    1480                                 vendor=ibm
    1481                                 ;;
    1482                         -beos*)
    1483                                 vendor=be
    1484                                 ;;
    1485                         -hpux*)
    1486                                 vendor=hp
    1487                                 ;;
    1488                         -mpeix*)
    1489                                 vendor=hp
    1490                                 ;;
    1491                         -hiux*)
    1492                                 vendor=hitachi
    1493                                 ;;
    1494                         -unos*)
    1495                                 vendor=crds
    1496                                 ;;
    1497                         -dgux*)
    1498                                 vendor=dg
    1499                                 ;;
    1500                         -luna*)
    1501                                 vendor=omron
    1502                                 ;;
    1503                         -genix*)
    1504                                 vendor=ns
    1505                                 ;;
    1506                         -mvs* | -opened*)
    1507                                 vendor=ibm
    1508                                 ;;
    1509                         -os400*)
    1510                                 vendor=ibm
    1511                                 ;;
    1512                         -ptx*)
    1513                                 vendor=sequent
    1514                                 ;;
    1515                         -tpf*)
    1516                                 vendor=ibm
    1517                                 ;;
    1518                         -vxsim* | -vxworks* | -windiss*)
    1519                                 vendor=wrs
    1520                                 ;;
    1521                         -aux*)
    1522                                 vendor=apple
    1523                                 ;;
    1524                         -hms*)
    1525                                 vendor=hitachi
    1526                                 ;;
    1527                         -mpw* | -macos*)
    1528                                 vendor=apple
    1529                                 ;;
    1530                         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    1531                                 vendor=atari
    1532                                 ;;
    1533                         -vos*)
    1534                                 vendor=stratus
    1535                                 ;;
    1536                 esac
    1537                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
    1538                 ;;
    1539 esac
    1540 
    1541 echo $basic_machine$os
    1542 exit 0
    1543 
    1544 # Local variables:
    1545 # eval: (add-hook 'write-file-hooks 'time-stamp)
    1546 # time-stamp-start: "timestamp='"
    1547 # time-stamp-format: "%:y-%02m-%02d"
    1548 # time-stamp-end: "'"
    1549 # End:
  • deleted file pslib/depcomp

    + -  
    1 #! /bin/sh
    2 
    3 # depcomp - compile a program generating dependencies as side-effects
    4 # Copyright 1999, 2000 Free Software Foundation, Inc.
    5 
    6 # This program is free software; you can redistribute it and/or modify
    7 # it under the terms of the GNU General Public License as published by
    8 # the Free Software Foundation; either version 2, or (at your option)
    9 # any later version.
    10 
    11 # This program is distributed in the hope that it will be useful,
    12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14 # GNU General Public License for more details.
    15 
    16 # You should have received a copy of the GNU General Public License
    17 # along with this program; if not, write to the Free Software
    18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    19 # 02111-1307, USA.
    20 
    21 # As a special exception to the GNU General Public License, if you
    22 # distribute this file as part of a program that contains a
    23 # configuration script generated by Autoconf, you may include it under
    24 # the same distribution terms that you use for the rest of that program.
    25 
    26 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
    27 
    28 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
    29   echo "depcomp: Variables source, object and depmode must be set" 1>&2
    30   exit 1
    31 fi
    32 # `libtool' can also be set to `yes' or `no'.
    33 
    34 depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
    35 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
    36 
    37 rm -f "$tmpdepfile"
    38 
    39 # Some modes work just like other modes, but use different flags.  We
    40 # parameterize here, but still list the modes in the big case below,
    41 # to make depend.m4 easier to write.  Note that we *cannot* use a case
    42 # here, because this file can only contain one case statement.
    43 if test "$depmode" = hp; then
    44   # HP compiler uses -M and no extra arg.
    45   gccflag=-M
    46   depmode=gcc
    47 fi
    48 
    49 if test "$depmode" = dashXmstdout; then
    50    # This is just like dashmstdout with a different argument.
    51    dashmflag=-xM
    52    depmode=dashmstdout
    53 fi
    54 
    55 case "$depmode" in
    56 gcc3)
    57 ## gcc 3 implements dependency tracking that does exactly what
    58 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
    59 ## it if -MD -MP comes after the -MF stuff.  Hmm.
    60   "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
    61   stat=$?
    62   if test $stat -eq 0; then :
    63   else
    64     rm -f "$tmpdepfile"
    65     exit $stat
    66   fi
    67   mv "$tmpdepfile" "$depfile"
    68   ;;
    69 
    70 gcc)
    71 ## There are various ways to get dependency output from gcc.  Here's
    72 ## why we pick this rather obscure method:
    73 ## - Don't want to use -MD because we'd like the dependencies to end
    74 ##   up in a subdir.  Having to rename by hand is ugly.
    75 ##   (We might end up doing this anyway to support other compilers.)
    76 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
    77 ##   -MM, not -M (despite what the docs say).
    78 ## - Using -M directly means running the compiler twice (even worse
    79 ##   than renaming).
    80   if test -z "$gccflag"; then
    81     gccflag=-MD,
    82   fi
    83   "$@" -Wp,"$gccflag$tmpdepfile"
    84   stat=$?
    85   if test $stat -eq 0; then :
    86   else
    87     rm -f "$tmpdepfile"
    88     exit $stat
    89   fi
    90   rm -f "$depfile"
    91   echo "$object : \\" > "$depfile"
    92   alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
    93 ## The second -e expression handles DOS-style file names with drive letters.
    94   sed -e 's/^[^:]*: / /' \
    95       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
    96 ## This next piece of magic avoids the `deleted header file' problem.
    97 ## The problem is that when a header file which appears in a .P file
    98 ## is deleted, the dependency causes make to die (because there is
    99 ## typically no way to rebuild the header).  We avoid this by adding
    100 ## dummy dependencies for each header file.  Too bad gcc doesn't do
    101 ## this for us directly.
    102   tr ' ' '
    103 ' < "$tmpdepfile" |
    104 ## Some versions of gcc put a space before the `:'.  On the theory
    105 ## that the space means something, we add a space to the output as
    106 ## well.
    107 ## Some versions of the HPUX 10.20 sed can't process this invocation
    108 ## correctly.  Breaking it into two sed invocations is a workaround.
    109     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
    110   rm -f "$tmpdepfile"
    111   ;;
    112 
    113 hp)
    114   # This case exists only to let depend.m4 do its work.  It works by
    115   # looking at the text of this script.  This case will never be run,
    116   # since it is checked for above.
    117   exit 1
    118   ;;
    119 
    120 sgi)
    121   if test "$libtool" = yes; then
    122     "$@" "-Wp,-MDupdate,$tmpdepfile"
    123   else
    124     "$@" -MDupdate "$tmpdepfile"
    125   fi
    126   stat=$?
    127   if test $stat -eq 0; then :
    128   else
    129     rm -f "$tmpdepfile"
    130     exit $stat
    131   fi
    132   rm -f "$depfile"
    133 
    134   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
    135     echo "$object : \\" > "$depfile"
    136 
    137     # Clip off the initial element (the dependent).  Don't try to be
    138     # clever and replace this with sed code, as IRIX sed won't handle
    139     # lines with more than a fixed number of characters (4096 in
    140     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
    141     # the IRIX cc adds comments like `#:fec' to the end of the
    142     # dependency line.
    143     tr ' ' '
    144 ' < "$tmpdepfile" \
    145     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
    146     tr '
    147 ' ' ' >> $depfile
    148     echo >> $depfile
    149 
    150     # The second pass generates a dummy entry for each header file.
    151     tr ' ' '
    152 ' < "$tmpdepfile" \
    153    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    154    >> $depfile
    155   else
    156     # The sourcefile does not contain any dependencies, so just
    157     # store a dummy comment line, to avoid errors with the Makefile
    158     # "include basename.Plo" scheme.
    159     echo "#dummy" > "$depfile"
    160   fi
    161   rm -f "$tmpdepfile"
    162   ;;
    163 
    164 aix)
    165   # The C for AIX Compiler uses -M and outputs the dependencies
    166   # in a .u file.  This file always lives in the current directory.
    167   # Also, the AIX compiler puts `$object:' at the start of each line;
    168   # $object doesn't have directory information.
    169   stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
    170   tmpdepfile="$stripped.u"
    171   outname="$stripped.o"
    172   if test "$libtool" = yes; then
    173     "$@" -Wc,-M
    174   else
    175     "$@" -M
    176   fi
    177 
    178   stat=$?
    179   if test $stat -eq 0; then :
    180   else
    181     rm -f "$tmpdepfile"
    182     exit $stat
    183   fi
    184 
    185   if test -f "$tmpdepfile"; then
    186     # Each line is of the form `foo.o: dependent.h'.
    187     # Do two passes, one to just change these to
    188     # `$object: dependent.h' and one to simply `dependent.h:'.
    189     sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
    190     sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
    191   else
    192     # The sourcefile does not contain any dependencies, so just
    193     # store a dummy comment line, to avoid errors with the Makefile
    194     # "include basename.Plo" scheme.
    195     echo "#dummy" > "$depfile"
    196   fi
    197   rm -f "$tmpdepfile"
    198   ;;
    199 
    200 icc)
    201   # Must come before tru64.
    202 
    203   # Intel's C compiler understands `-MD -MF file'.  However
    204   #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
    205   # will fill foo.d with something like
    206   #    foo.o: sub/foo.c
    207   #    foo.o: sub/foo.h
    208   # which is wrong.  We want:
    209   #    sub/foo.o: sub/foo.c
    210   #    sub/foo.o: sub/foo.h
    211   #    sub/foo.c:
    212   #    sub/foo.h:
    213 
    214   "$@" -MD -MF "$tmpdepfile"
    215   stat=$?
    216   if test $stat -eq 0; then :
    217   else
    218     rm -f "$tmpdepfile"
    219     exit $stat
    220   fi
    221   rm -f "$depfile"
    222   # Each line is of the form `foo.o: dependent.h'.
    223   # Do two passes, one to just change these to
    224   # `$object: dependent.h' and one to simply `dependent.h:'.
    225   sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
    226   sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
    227   rm -f "$tmpdepfile"
    228   ;;
    229 
    230 tru64)
    231    # The Tru64 AIX compiler uses -MD to generate dependencies as a side
    232    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
    233    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
    234    # dependencies in `foo.d' instead, so we check for that too.
    235    # Subdirectories are respected.
    236 
    237    tmpdepfile1="$object.d"
    238    tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
    239    if test "$libtool" = yes; then
    240       "$@" -Wc,-MD
    241    else
    242       "$@" -MD
    243    fi
    244 
    245    stat=$?
    246    if test $stat -eq 0; then :
    247    else
    248       rm -f "$tmpdepfile1" "$tmpdepfile2"
    249       exit $stat
    250    fi
    251 
    252    if test -f "$tmpdepfile1"; then
    253       tmpdepfile="$tmpdepfile1"
    254    else
    255       tmpdepfile="$tmpdepfile2"
    256    fi
    257    if test -f "$tmpdepfile"; then
    258       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    259       # That's a space and a tab in the [].
    260       sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    261    else
    262       echo "#dummy" > "$depfile"
    263    fi
    264    rm -f "$tmpdepfile"
    265    ;;
    266 
    267 #nosideeffect)
    268   # This comment above is used by automake to tell side-effect
    269   # dependency tracking mechanisms from slower ones.
    270 
    271 dashmstdout)
    272   # Important note: in order to support this mode, a compiler *must*
    273   # always write the proprocessed file to stdout, regardless of -o,
    274   # because we must use -o when running libtool.
    275   test -z "$dashmflag" && dashmflag=-M
    276   ( IFS=" "
    277     case " $* " in
    278     *" --mode=compile "*) # this is libtool, let us make it quiet
    279       for arg
    280       do # cycle over the arguments
    281         case "$arg" in
    282         "--mode=compile")
    283           # insert --quiet before "--mode=compile"
    284           set fnord "$@" --quiet
    285           shift # fnord
    286           ;;
    287         esac
    288         set fnord "$@" "$arg"
    289         shift # fnord
    290         shift # "$arg"
    291       done
    292       ;;
    293     esac
    294     "$@" $dashmflag | sed 's:^[^:]*\:[  ]*:'"$object"'\: :' > "$tmpdepfile"
    295   ) &
    296   proc=$!
    297   "$@"
    298   stat=$?
    299   wait "$proc"
    300   if test "$stat" != 0; then exit $stat; fi
    301   rm -f "$depfile"
    302   cat < "$tmpdepfile" > "$depfile"
    303   tr ' ' '
    304 ' < "$tmpdepfile" | \
    305 ## Some versions of the HPUX 10.20 sed can't process this invocation
    306 ## correctly.  Breaking it into two sed invocations is a workaround.
    307     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
    308   rm -f "$tmpdepfile"
    309   ;;
    310 
    311 dashXmstdout)
    312   # This case only exists to satisfy depend.m4.  It is never actually
    313   # run, as this mode is specially recognized in the preamble.
    314   exit 1
    315   ;;
    316 
    317 makedepend)
    318   # X makedepend
    319   (
    320     shift
    321     cleared=no
    322     for arg in "$@"; do
    323       case $cleared in no)
    324         set ""; shift
    325         cleared=yes
    326       esac
    327       case "$arg" in
    328         -D*|-I*)
    329           set fnord "$@" "$arg"; shift;;
    330         -*)
    331           ;;
    332         *)
    333           set fnord "$@" "$arg"; shift;;
    334       esac
    335     done
    336     obj_suffix="`echo $object | sed 's/^.*\././'`"
    337     touch "$tmpdepfile"
    338     ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
    339   ) &
    340   proc=$!
    341   "$@"
    342   stat=$?
    343   wait "$proc"
    344   if test "$stat" != 0; then exit $stat; fi
    345   rm -f "$depfile"
    346   cat < "$tmpdepfile" > "$depfile"
    347   tail +3 "$tmpdepfile" | tr ' ' '
    348 ' | \
    349 ## Some versions of the HPUX 10.20 sed can't process this invocation
    350 ## correctly.  Breaking it into two sed invocations is a workaround.
    351     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
    352   rm -f "$tmpdepfile" "$tmpdepfile".bak
    353   ;;
    354 
    355 cpp)
    356   # Important note: in order to support this mode, a compiler *must*
    357   # always write the proprocessed file to stdout, regardless of -o,
    358   # because we must use -o when running libtool.
    359   ( IFS=" "
    360     case " $* " in
    361     *" --mode=compile "*)
    362       for arg
    363       do # cycle over the arguments
    364         case $arg in
    365         "--mode=compile")
    366           # insert --quiet before "--mode=compile"
    367           set fnord "$@" --quiet
    368           shift # fnord
    369           ;;
    370         esac
    371         set fnord "$@" "$arg"
    372         shift # fnord
    373         shift # "$arg"
    374       done
    375       ;;
    376     esac
    377     "$@" -E |
    378     sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
    379     sed '$ s: \\$::' > "$tmpdepfile"
    380   ) &
    381   proc=$!
    382   "$@"
    383   stat=$?
    384   wait "$proc"
    385   if test "$stat" != 0; then exit $stat; fi
    386   rm -f "$depfile"
    387   echo "$object : \\" > "$depfile"
    388   cat < "$tmpdepfile" >> "$depfile"
    389   sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
    390   rm -f "$tmpdepfile"
    391   ;;
    392 
    393 msvisualcpp)
    394   # Important note: in order to support this mode, a compiler *must*
    395   # always write the proprocessed file to stdout, regardless of -o,
    396   # because we must use -o when running libtool.
    397   ( IFS=" "
    398     case " $* " in
    399     *" --mode=compile "*)
    400       for arg
    401       do # cycle over the arguments
    402         case $arg in
    403         "--mode=compile")
    404           # insert --quiet before "--mode=compile"
    405           set fnord "$@" --quiet
    406           shift # fnord
    407           ;;
    408         esac
    409         set fnord "$@" "$arg"
    410         shift # fnord
    411         shift # "$arg"
    412       done
    413       ;;
    414     esac
    415     "$@" -E |
    416     sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
    417   ) &
    418   proc=$!
    419   "$@"
    420   stat=$?
    421   wait "$proc"
    422   if test "$stat" != 0; then exit $stat; fi
    423   rm -f "$depfile"
    424   echo "$object : \\" > "$depfile"
    425   . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"
    426   echo "        " >> "$depfile"
    427   . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
    428   rm -f "$tmpdepfile"
    429   ;;
    430 
    431 none)
    432   exec "$@"
    433   ;;
    434 
    435 *)
    436   echo "Unknown depmode $depmode" 1>&2
    437   exit 1
    438   ;;
    439 esac
    440 
    441 exit 0
  • deleted file pslib/install-sh

    + -  
    1 #!/bin/sh
    2 #
    3 # install - install a program, script, or datafile
    4 # This comes from X11R5 (mit/util/scripts/install.sh).
    5 #
    6 # Copyright 1991 by the Massachusetts Institute of Technology
    7 #
    8 # Permission to use, copy, modify, distribute, and sell this software and its
    9 # documentation for any purpose is hereby granted without fee, provided that
    10 # the above copyright notice appear in all copies and that both that
    11 # copyright notice and this permission notice appear in supporting
    12 # documentation, and that the name of M.I.T. not be used in advertising or
    13 # publicity pertaining to distribution of the software without specific,
    14 # written prior permission.  M.I.T. makes no representations about the
    15 # suitability of this software for any purpose.  It is provided "as is"
    16 # without express or implied warranty.
    17 #
    18 # Calling this script install-sh is preferred over install.sh, to prevent
    19 # `make' implicit rules from creating a file called install from it
    20 # when there is no Makefile.
    21 #
    22 # This script is compatible with the BSD install script, but was written
    23 # from scratch.  It can only install one file at a time, a restriction
    24 # shared with many OS's install programs.
    25 
    26 
    27 # set DOITPROG to echo to test this script
    28 
    29 # Don't use :- since 4.3BSD and earlier shells don't like it.
    30 doit="${DOITPROG-}"
    31 
    32 
    33 # put in absolute paths if you don't have them in your path; or use env. vars.
    34 
    35 mvprog="${MVPROG-mv}"
    36 cpprog="${CPPROG-cp}"
    37 chmodprog="${CHMODPROG-chmod}"
    38 chownprog="${CHOWNPROG-chown}"
    39 chgrpprog="${CHGRPPROG-chgrp}"
    40 stripprog="${STRIPPROG-strip}"
    41 rmprog="${RMPROG-rm}"
    42 mkdirprog="${MKDIRPROG-mkdir}"
    43 
    44 transformbasename=""
    45 transform_arg=""
    46 instcmd="$mvprog"
    47 chmodcmd="$chmodprog 0755"
    48 chowncmd=""
    49 chgrpcmd=""
    50 stripcmd=""
    51 rmcmd="$rmprog -f"
    52 mvcmd="$mvprog"
    53 src=""
    54 dst=""
    55 dir_arg=""
    56 
    57 while [ x"$1" != x ]; do
    58     case $1 in
    59         -c) instcmd=$cpprog
    60             shift
    61             continue;;
    62 
    63         -d) dir_arg=true
    64             shift
    65             continue;;
    66 
    67         -m) chmodcmd="$chmodprog $2"
    68             shift
    69             shift
    70             continue;;
    71 
    72         -o) chowncmd="$chownprog $2"
    73             shift
    74             shift
    75             continue;;
    76 
    77         -g) chgrpcmd="$chgrpprog $2"
    78             shift
    79             shift
    80             continue;;
    81 
    82         -s) stripcmd=$stripprog
    83             shift
    84             continue;;
    85 
    86         -t=*) transformarg=`echo $1 | sed 's/-t=//'`
    87             shift
    88             continue;;
    89 
    90         -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
    91             shift
    92             continue;;
    93 
    94         *)  if [ x"$src" = x ]
    95             then
    96                 src=$1
    97             else
    98                 # this colon is to work around a 386BSD /bin/sh bug
    99                 :
    100                 dst=$1
    101             fi
    102             shift
    103             continue;;
    104     esac
    105 done
    106 
    107 if [ x"$src" = x ]
    108 then
    109         echo "$0: no input file specified" >&2
    110         exit 1
    111 else
    112         :
    113 fi
    114 
    115 if [ x"$dir_arg" != x ]; then
    116         dst=$src
    117         src=""
    118 
    119         if [ -d "$dst" ]; then
    120                 instcmd=:
    121                 chmodcmd=""
    122         else
    123                 instcmd=$mkdirprog
    124         fi
    125 else
    126 
    127 # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
    128 # might cause directories to be created, which would be especially bad
    129 # if $src (and thus $dsttmp) contains '*'.
    130 
    131         if [ -f "$src" ] || [ -d "$src" ]
    132         then
    133                 :
    134         else
    135                 echo "$0: $src does not exist" >&2
    136                 exit 1
    137         fi
    138 
    139         if [ x"$dst" = x ]
    140         then
    141                 echo "$0: no destination specified" >&2
    142                 exit 1
    143         else
    144                 :
    145         fi
    146 
    147 # If destination is a directory, append the input filename; if your system
    148 # does not like double slashes in filenames, you may need to add some logic
    149 
    150         if [ -d "$dst" ]
    151         then
    152                 dst=$dst/`basename "$src"`
    153         else
    154                 :
    155         fi
    156 fi
    157 
    158 ## this sed command emulates the dirname command
    159 dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
    160 
    161 # Make sure that the destination directory exists.
    162 #  this part is taken from Noah Friedman's mkinstalldirs script
    163 
    164 # Skip lots of stat calls in the usual case.
    165 if [ ! -d "$dstdir" ]; then
    166 defaultIFS='
    167         '
    168 IFS="${IFS-$defaultIFS}"
    169 
    170 oIFS=$IFS
    171 # Some sh's can't handle IFS=/ for some reason.
    172 IFS='%'
    173 set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
    174 IFS=$oIFS
    175 
    176 pathcomp=''
    177 
    178 while [ $# -ne 0 ] ; do
    179         pathcomp=$pathcomp$1
    180         shift
    181 
    182         if [ ! -d "$pathcomp" ] ;
    183         then
    184                 $mkdirprog "$pathcomp"
    185         else
    186                 :
    187         fi
    188 
    189         pathcomp=$pathcomp/
    190 done
    191 fi
    192 
    193 if [ x"$dir_arg" != x ]
    194 then
    195         $doit $instcmd "$dst" &&
    196 
    197         if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
    198         if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
    199         if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
    200         if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
    201 else
    202 
    203 # If we're going to rename the final executable, determine the name now.
    204 
    205         if [ x"$transformarg" = x ]
    206         then
    207                 dstfile=`basename "$dst"`
    208         else
    209                 dstfile=`basename "$dst" $transformbasename |
    210                         sed $transformarg`$transformbasename
    211         fi
    212 
    213 # don't allow the sed command to completely eliminate the filename
    214 
    215         if [ x"$dstfile" = x ]
    216         then
    217                 dstfile=`basename "$dst"`
    218         else
    219                 :
    220         fi
    221 
    222 # Make a couple of temp file names in the proper directory.
    223 
    224         dsttmp=$dstdir/#inst.$$#
    225         rmtmp=$dstdir/#rm.$$#
    226 
    227 # Trap to clean up temp files at exit.
    228 
    229         trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
    230         trap '(exit $?); exit' 1 2 13 15
    231 
    232 # Move or copy the file name to the temp name
    233 
    234         $doit $instcmd "$src" "$dsttmp" &&
    235 
    236 # and set any options; do chmod last to preserve setuid bits
    237 
    238 # If any of these fail, we abort the whole thing.  If we want to
    239 # ignore errors from any of these, just make sure not to ignore
    240 # errors from the above "$doit $instcmd $src $dsttmp" command.
    241 
    242         if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
    243         if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
    244         if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
    245         if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
    246 
    247 # Now remove or move aside any old file at destination location.  We try this
    248 # two ways since rm can't unlink itself on some systems and the destination
    249 # file might be busy for other reasons.  In this case, the final cleanup
    250 # might fail but the new file should still install successfully.
    251 
    252 {
    253         if [ -f "$dstdir/$dstfile" ]
    254         then
    255                 $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
    256                 $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
    257                 {
    258                   echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
    259                   (exit 1); exit
    260                 }
    261         else
    262                 :
    263         fi
    264 } &&
    265 
    266 # Now rename the file to the real destination.
    267 
    268         $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
    269 
    270 fi &&
    271 
    272 # The final little trick to "correctly" pass the exit status to the exit trap.
    273 
    274 {
    275         (exit 0); exit
    276 }
  • deleted file pslib/ltmain.sh

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

    + -  
    1 #! /bin/sh
    2 # Common stub for a few missing GNU programs while installing.
    3 # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
    4 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
    5 
    6 # This program is free software; you can redistribute it and/or modify
    7 # it under the terms of the GNU General Public License as published by
    8 # the Free Software Foundation; either version 2, or (at your option)
    9 # any later version.
    10 
    11 # This program is distributed in the hope that it will be useful,
    12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14 # GNU General Public License for more details.
    15 
    16 # You should have received a copy of the GNU General Public License
    17 # along with this program; if not, write to the Free Software
    18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    19 # 02111-1307, USA.
    20 
    21 # As a special exception to the GNU General Public License, if you
    22 # distribute this file as part of a program that contains a
    23 # configuration script generated by Autoconf, you may include it under
    24 # the same distribution terms that you use for the rest of that program.
    25 
    26 if test $# -eq 0; then
    27   echo 1>&2 "Try \`$0 --help' for more information"
    28   exit 1
    29 fi
    30 
    31 run=:
    32 
    33 # In the cases where this matters, `missing' is being run in the
    34 # srcdir already.
    35 if test -f configure.ac; then
    36   configure_ac=configure.ac
    37 else
    38   configure_ac=configure.in
    39 fi
    40 
    41 case "$1" in
    42 --run)
    43   # Try to run requested program, and just exit if it succeeds.
    44   run=
    45   shift
    46   "$@" && exit 0
    47   ;;
    48 esac
    49 
    50 # If it does not exist, or fails to run (possibly an outdated version),
    51 # try to emulate it.
    52 case "$1" in
    53 
    54   -h|--h|--he|--hel|--help)
    55     echo "\
    56 $0 [OPTION]... PROGRAM [ARGUMENT]...
    57 
    58 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
    59 error status if there is no known handling for PROGRAM.
    60 
    61 Options:
    62   -h, --help      display this help and exit
    63   -v, --version   output version information and exit
    64   --run           try to run the given command, and emulate it if it fails
    65 
    66 Supported PROGRAM values:
    67   aclocal      touch file \`aclocal.m4'
    68   autoconf     touch file \`configure'
    69   autoheader   touch file \`config.h.in'
    70   automake     touch all \`Makefile.in' files
    71   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
    72   flex         create \`lex.yy.c', if possible, from existing .c
    73   help2man     touch the output file
    74   lex          create \`lex.yy.c', if possible, from existing .c
    75   makeinfo     touch the output file
    76   tar          try tar, gnutar, gtar, then tar without non-portable flags
    77   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
    78     ;;
    79 
    80   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
    81     echo "missing 0.4 - GNU automake"
    82     ;;
    83 
    84   -*)
    85     echo 1>&2 "$0: Unknown \`$1' option"
    86     echo 1>&2 "Try \`$0 --help' for more information"
    87     exit 1
    88     ;;
    89 
    90   aclocal*)
    91     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    92        # We have it, but it failed.
    93        exit 1
    94     fi
    95 
    96     echo 1>&2 "\
    97 WARNING: \`$1' is missing on your system.  You should only need it if
    98          you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
    99          to install the \`Automake' and \`Perl' packages.  Grab them from
    100          any GNU archive site."
    101     touch aclocal.m4
    102     ;;
    103 
    104   autoconf)
    105     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    106        # We have it, but it failed.
    107        exit 1
    108     fi
    109 
    110     echo 1>&2 "\
    111 WARNING: \`$1' is missing on your system.  You should only need it if
    112          you modified \`${configure_ac}'.  You might want to install the
    113          \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
    114          archive site."
    115     touch configure
    116     ;;
    117 
    118   autoheader)
    119     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    120        # We have it, but it failed.
    121        exit 1
    122     fi
    123 
    124     echo 1>&2 "\
    125 WARNING: \`$1' is missing on your system.  You should only need it if
    126          you modified \`acconfig.h' or \`${configure_ac}'.  You might want
    127          to install the \`Autoconf' and \`GNU m4' packages.  Grab them
    128          from any GNU archive site."
    129     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
    130     test -z "$files" && files="config.h"
    131     touch_files=
    132     for f in $files; do
    133       case "$f" in
    134       *:*) touch_files="$touch_files "`echo "$f" |
    135                                        sed -e 's/^[^:]*://' -e 's/:.*//'`;;
    136       *) touch_files="$touch_files $f.in";;
    137       esac
    138     done
    139     touch $touch_files
    140     ;;
    141 
    142   automake*)
    143     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    144        # We have it, but it failed.
    145        exit 1
    146     fi
    147 
    148     echo 1>&2 "\
    149 WARNING: \`$1' is missing on your system.  You should only need it if
    150          you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
    151          You might want to install the \`Automake' and \`Perl' packages.
    152          Grab them from any GNU archive site."
    153     find . -type f -name Makefile.am -print |
    154            sed 's/\.am$/.in/' |
    155            while read f; do touch "$f"; done
    156     ;;
    157 
    158   autom4te)
    159     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    160        # We have it, but it failed.
    161        exit 1
    162     fi
    163 
    164     echo 1>&2 "\
    165 WARNING: \`$1' is needed, and you do not seem to have it handy on your
    166          system.  You might have modified some files without having the
    167          proper tools for further handling them.
    168          You can get \`$1Help2man' as part of \`Autoconf' from any GNU
    169          archive site."
    170 
    171     file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
    172     test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
    173     if test -f "$file"; then
    174         touch $file
    175     else
    176         test -z "$file" || exec >$file
    177         echo "#! /bin/sh"
    178         echo "# Created by GNU Automake missing as a replacement of"
    179         echo "#  $ $@"
    180         echo "exit 0"
    181         chmod +x $file
    182         exit 1
    183     fi
    184     ;;
    185 
    186   bison|yacc)
    187     echo 1>&2 "\
    188 WARNING: \`$1' is missing on your system.  You should only need it if
    189          you modified a \`.y' file.  You may need the \`Bison' package
    190          in order for those modifications to take effect.  You can get
    191          \`Bison' from any GNU archive site."
    192     rm -f y.tab.c y.tab.h
    193     if [ $# -ne 1 ]; then
    194         eval LASTARG="\${$#}"
    195         case "$LASTARG" in
    196         *.y)
    197             SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
    198             if [ -f "$SRCFILE" ]; then
    199                  cp "$SRCFILE" y.tab.c
    200             fi
    201             SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
    202             if [ -f "$SRCFILE" ]; then
    203                  cp "$SRCFILE" y.tab.h
    204             fi
    205           ;;
    206         esac
    207     fi
    208     if [ ! -f y.tab.h ]; then
    209         echo >y.tab.h
    210     fi
    211     if [ ! -f y.tab.c ]; then
    212         echo 'main() { return 0; }' >y.tab.c
    213     fi
    214     ;;
    215 
    216   lex|flex)
    217     echo 1>&2 "\
    218 WARNING: \`$1' is missing on your system.  You should only need it if
    219          you modified a \`.l' file.  You may need the \`Flex' package
    220          in order for those modifications to take effect.  You can get
    221          \`Flex' from any GNU archive site."
    222     rm -f lex.yy.c
    223     if [ $# -ne 1 ]; then
    224         eval LASTARG="\${$#}"
    225         case "$LASTARG" in
    226         *.l)
    227             SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
    228             if [ -f "$SRCFILE" ]; then
    229                  cp "$SRCFILE" lex.yy.c
    230             fi
    231           ;;
    232         esac
    233     fi
    234     if [ ! -f lex.yy.c ]; then
    235         echo 'main() { return 0; }' >lex.yy.c
    236     fi
    237     ;;
    238 
    239   help2man)
    240     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    241        # We have it, but it failed.
    242        exit 1
    243     fi
    244 
    245     echo 1>&2 "\
    246 WARNING: \`$1' is missing on your system.  You should only need it if
    247          you modified a dependency of a manual page.  You may need the
    248          \`Help2man' package in order for those modifications to take
    249          effect.  You can get \`Help2man' from any GNU archive site."
    250 
    251     file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
    252     if test -z "$file"; then
    253         file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
    254     fi
    255     if [ -f "$file" ]; then
    256         touch $file
    257     else
    258         test -z "$file" || exec >$file
    259         echo ".ab help2man is required to generate this page"
    260         exit 1
    261     fi
    262     ;;
    263 
    264   makeinfo)
    265     if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
    266        # We have makeinfo, but it failed.
    267        exit 1
    268     fi
    269 
    270     echo 1>&2 "\
    271 WARNING: \`$1' is missing on your system.  You should only need it if
    272          you modified a \`.texi' or \`.texinfo' file, or any other file
    273          indirectly affecting the aspect of the manual.  The spurious
    274          call might also be the consequence of using a buggy \`make' (AIX,
    275          DU, IRIX).  You might want to install the \`Texinfo' package or
    276          the \`GNU make' package.  Grab either from any GNU archive site."
    277     file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
    278     if test -z "$file"; then
    279       file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
    280       file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
    281     fi
    282     touch $file
    283     ;;
    284 
    285   tar)
    286     shift
    287     if test -n "$run"; then
    288       echo 1>&2 "ERROR: \`tar' requires --run"
    289       exit 1
    290     fi
    291 
    292     # We have already tried tar in the generic part.
    293     # Look for gnutar/gtar before invocation to avoid ugly error
    294     # messages.
    295     if (gnutar --version > /dev/null 2>&1); then
    296        gnutar "$@" && exit 0
    297     fi
    298     if (gtar --version > /dev/null 2>&1); then
    299        gtar "$@" && exit 0
    300     fi
    301     firstarg="$1"
    302     if shift; then
    303         case "$firstarg" in
    304         *o*)
    305             firstarg=`echo "$firstarg" | sed s/o//`
    306             tar "$firstarg" "$@" && exit 0
    307             ;;
    308         esac
    309         case "$firstarg" in
    310         *h*)
    311             firstarg=`echo "$firstarg" | sed s/h//`
    312             tar "$firstarg" "$@" && exit 0
    313             ;;
    314         esac
    315     fi
    316 
    317     echo 1>&2 "\
    318 WARNING: I can't seem to be able to run \`tar' with the given arguments.
    319          You may want to install GNU tar or Free paxutils, or check the
    320          command line arguments."
    321     exit 1
    322     ;;
    323 
    324   *)
    325     echo 1>&2 "\
    326 WARNING: \`$1' is needed, and you do not seem to have it handy on your
    327          system.  You might have modified some files without having the
    328          proper tools for further handling them.  Check the \`README' file,
    329          it often tells you about the needed prerequirements for installing
    330          this package.  You may also peek at any GNU archive site, in case
    331          some other package would contain this missing \`$1' program."
    332     exit 1
    333     ;;
    334 esac
    335 
    336 exit 0
  • deleted file pslib/mkinstalldirs

    + -  
    1 #! /bin/sh
    2 # mkinstalldirs --- make directory hierarchy
    3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
    4 # Created: 1993-05-16
    5 # Public domain
    6 
    7 errstatus=0
    8 dirmode=""
    9 
    10 usage="\
    11 Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
    12 
    13 # process command line arguments
    14 while test $# -gt 0 ; do
    15    case "${1}" in
    16      -h | --help | --h* )                       # -h for help
    17         echo "${usage}" 1>&2; exit 0 ;;
    18      -m )                                       # -m PERM arg
    19         shift
    20         test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
    21         dirmode="${1}"
    22         shift ;;
    23      -- ) shift; break ;;                       # stop option processing
    24      -* ) echo "${usage}" 1>&2; exit 1 ;;       # unknown option
    25      * )  break ;;                              # first non-opt arg
    26    esac
    27 done
    28 
    29 for file
    30 do
    31   if test -d "$file"; then
    32     shift
    33   else
    34     break
    35   fi
    36 done
    37 
    38 case $# in
    39 0) exit 0 ;;
    40 esac
    41 
    42 case $dirmode in
    43 '')
    44   if mkdir -p -- . 2>/dev/null; then
    45     echo "mkdir -p -- $*"
    46     exec mkdir -p -- "$@"
    47   fi ;;
    48 *)
    49   if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
    50     echo "mkdir -m $dirmode -p -- $*"
    51     exec mkdir -m "$dirmode" -p -- "$@"
    52   fi ;;
    53 esac
    54 
    55 for file
    56 do
    57    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    58    shift
    59 
    60    pathcomp=
    61    for d
    62    do
    63      pathcomp="$pathcomp$d"
    64      case "$pathcomp" in
    65        -* ) pathcomp=./$pathcomp ;;
    66      esac
    67 
    68      if test ! -d "$pathcomp"; then
    69         echo "mkdir $pathcomp"
    70 
    71         mkdir "$pathcomp" || lasterr=$?
    72 
    73         if test ! -d "$pathcomp"; then
    74           errstatus=$lasterr
    75         else
    76           if test ! -z "$dirmode"; then
    77              echo "chmod $dirmode $pathcomp"
    78 
    79              lasterr=""
    80              chmod "$dirmode" "$pathcomp" || lasterr=$?
    81 
    82              if test ! -z "$lasterr"; then
    83                errstatus=$lasterr
    84              fi
    85           fi
    86         fi
    87      fi
    88 
    89      pathcomp="$pathcomp/"
    90    done
    91 done
    92 
    93 exit $errstatus
    94 
    95 # Local Variables:
    96 # mode: shell-script
    97 # sh-indentation: 3
    98 # End:
    99 # mkinstalldirs ends here
  • new file pslib/autogen.sh

    - +  
     1#!/bin/sh
     2# Run this to generate all the initial makefiles, etc.
     3
     4srcdir=`dirname $0`
     5test -z "$srcdir" && srcdir=.
     6
     7ORIGDIR=`pwd`
     8cd $srcdir
     9
     10PROJECT=pslib
     11TEST_TYPE=-f
     12FILE=pslib.pc.in
     13
     14DIE=0
     15
     16LIBTOOLIZE=libtoolize
     17ACLOCAL=aclocal-1.6
     18AUTOHEADER=autoheader
     19AUTOMAKE=automake-1.6
     20AUTOCONF=autoconf
     21
     22($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
     23        echo
     24        echo "You must have $LIBTOOlIZE installed to compile $PROJECT."
     25        echo "Download the appropriate package for your distribution,"
     26        echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
     27        DIE=1
     28}
     29
     30($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || {
     31        echo
     32        echo "You must have $ACLOCAL installed to compile $PROJECT."
     33        echo "Download the appropriate package for your distribution,"
     34        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
     35        DIE=1
     36}
     37
     38($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 || {
     39        echo
     40        echo "You must have $AUTOHEADER installed to compile $PROJECT."
     41        echo "Download the appropriate package for your distribution,"
     42        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
     43        DIE=1
     44}
     45
     46($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
     47        echo
     48        echo "You must have $AUTOMAKE installed to compile $PROJECT."
     49        echo "Download the appropriate package for your distribution,"
     50        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
     51        DIE=1
     52}
     53
     54($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
     55        echo
     56        echo "You must have $AUTOCONF installed to compile $PROJECT."
     57        echo "Download the appropriate package for your distribution,"
     58        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
     59        DIE=1
     60}
     61
     62if test "$DIE" -eq 1; then
     63        exit 1
     64fi
     65
     66test $TEST_TYPE $FILE || {
     67        echo "You must run this script in the top-level $PROJECT directory"
     68        exit 1
     69}
     70
     71if test -z "$*"; then
     72        echo "I am going to run ./configure with no arguments - if you wish "
     73        echo "to pass any to it, please specify them on the $0 command line."
     74fi
     75
     76$LIBTOOLIZE --copy --force || echo "$LIBTOOlIZE failed"
     77$ACLOCAL || echo "$ACLOCAL failed"
     78$AUTOHEADER || echo "$AUTOHEADER failed"
     79$AUTOMAKE --add-missing --force-missing --copy || echo "$AUTOMAKE failed"
     80$AUTOCONF || echo "$AUTOCONF failed"
     81
     82cd $ORIGDIR
     83
     84run_configure=true
     85for arg in $*; do
     86    case $arg in
     87        --no-configure)
     88            run_configure=false
     89            ;;
     90        *)
     91            ;;
     92    esac
     93done
     94
     95if $run_configure; then
     96    $srcdir/configure --enable-maintainer-mode "$@"
     97    echo
     98    echo "Now type 'make' to compile $PROJECT."
     99else
     100    echo
     101    echo "Now run 'configure' and 'make' to compile $PROJECT."
     102fi
  • pslib/configure.

    diff -u pslib/configure.ac:1.1 pslib/configure.ac:1.2
    old new  
    1 AC_INIT([pslib],[0.6.0],[http://www.pan-starrs.org/bugzilla])
     1AC_PREREQ(2.59)
     2
     3AC_INIT([pslib],[0.6.0],[http://pan-starrs.ifa.hawaii.edu/bugzilla])
     4AC_CONFIG_SRCDIR([pslib.pc.in])
    25AC_CANONICAL_TARGET
     6
     7AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2])
    38AM_CONFIG_HEADER(src/config.h)
    4 AM_INIT_AUTOMAKE(1.6)
     9AM_MAINTAINER_MODE
    510
    611PSLIB_LT_VERSION="0:5:0"
    712AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
     
    226231AC_SUBST(PSLIB_LIBS,[$PSLIB_LIBS])
    227232AC_SUBST(PSLIB_CFLAGS,[$PSLIB_CFLAGS])
    228233
    229 AC_CONFIG_FILES([ Makefile ])
    230 AC_CONFIG_FILES([ src/Makefile ])
    231 AC_CONFIG_FILES([ src/astronomy/Makefile ])
    232 AC_CONFIG_FILES([ src/collections/Makefile ])
    233 AC_CONFIG_FILES([ src/dataManip/Makefile ])
    234 AC_CONFIG_FILES([ src/dataIO/Makefile ])
    235 AC_CONFIG_FILES([ src/image/Makefile ])
    236 AC_CONFIG_FILES([ src/sysUtils/Makefile ])
     234AC_CONFIG_FILES([
     235  Makefile
     236  src/Makefile
     237  src/astronomy/Makefile
     238  src/collections/Makefile
     239  src/dataManip/Makefile
     240  src/dataIO/Makefile
     241  src/image/Makefile
     242  src/sysUtils/Makefile
     243  test/Makefile
     244  test/astronomy/Makefile
     245  test/collections/Makefile
     246  test/dataManip/Makefile
     247  test/dataIO/Makefile
     248  test/image/Makefile
     249  test/sysUtils/Makefile
     250  etc/pslib/Makefile
     251  etc/Makefile
     252  pslib-config
     253  pslib.pc
     254  Doxyfile
     255])
    237256
    238257if test "$SWIG_REQ" == "yes"
    239258then
    240259  AC_CONFIG_FILES([ swig/Makefile ])
    241260fi
    242261
    243 AC_CONFIG_FILES([ test/Makefile ])
    244 AC_CONFIG_FILES([ test/astronomy/Makefile ])
    245 AC_CONFIG_FILES([ test/collections/Makefile ])
    246 AC_CONFIG_FILES([ test/dataManip/Makefile ])
    247 AC_CONFIG_FILES([ test/dataIO/Makefile ])
    248 AC_CONFIG_FILES([ test/image/Makefile ])
    249 AC_CONFIG_FILES([ test/sysUtils/Makefile ])
    250 AC_CONFIG_FILES([ etc/pslib/Makefile ])
    251 AC_CONFIG_FILES([ etc/Makefile ])
    252 AC_CONFIG_FILES([ pslib-config ])
    253 AC_CONFIG_FILES([ pslib.pc ])
    254 AC_CONFIG_FILES([ Doxyfile ])
    255 
    256262AC_OUTPUT
    257