IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3407


Ignore:
Timestamp:
Mar 11, 2005, 10:38:56 AM (21 years ago)
Author:
desonia
Message:

made adjustments to psMetadata and added psFitsUpdateTable.

Location:
trunk/psLib
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/config.guess

    r3377 r3407  
    22# Attempt to guess a canonical system name.
    33#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6 timestamp='2003-01-10'
     4#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
     5
     6timestamp='2004-08-11'
    77
    88# This file is free software; you can redistribute it and/or modify it
     
    5454
    5555Originally written by Per Bothner.
    56 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     56Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    5757Free Software Foundation, Inc.
    5858
     
    107107 { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    108108 { 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 ; } ||
    109110 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
    110111dummy=$tmp/dummy ;
     
    135136UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    136137UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
     138
     139case "${UNAME_MACHINE}" in
     140    i?86)
     141        test -z "$VENDOR" && VENDOR=pc
     142        ;;
     143    *)
     144        test -z "$VENDOR" && VENDOR=unknown
     145        ;;
     146esac
     147test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
    137148
    138149# Note: order is significant - the case branches are not exclusive.
     
    197208        echo "${machine}-${os}${release}"
    198209        exit 0 ;;
     210    amd64:OpenBSD:*:*)
     211        echo x86_64-unknown-openbsd${UNAME_RELEASE}
     212        exit 0 ;;
    199213    amiga:OpenBSD:*:*)
    200214        echo m68k-unknown-openbsd${UNAME_RELEASE}
     
    203217        echo mipsel-unknown-openbsd${UNAME_RELEASE}
    204218        exit 0 ;;
     219    cats:OpenBSD:*:*)
     220        echo arm-unknown-openbsd${UNAME_RELEASE}
     221        exit 0 ;;
    205222    hp300:OpenBSD:*:*)
    206223        echo m68k-unknown-openbsd${UNAME_RELEASE}
    207224        exit 0 ;;
     225    luna88k:OpenBSD:*:*)
     226        echo m88k-unknown-openbsd${UNAME_RELEASE}
     227        exit 0 ;;
    208228    mac68k:OpenBSD:*:*)
    209229        echo m68k-unknown-openbsd${UNAME_RELEASE}
     
    236256        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
    237257        exit 0 ;;
    238     *:MicroBSD:*:*)
    239         echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
     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}
    240266        exit 0 ;;
    241267    alpha:OSF1:*:*)
    242         if test $UNAME_RELEASE = "V4.0"; then
     268        case $UNAME_RELEASE in
     269        *4.0)
    243270                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    244         fi
     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.
    245314        # A Vn.n version is a released version.
    246315        # A Tn.n version is a released field test version.
    247316        # A Xn.n version is an unreleased experimental baselevel.
    248317        # 1.2 uses "1.2" for uname -r.
    249         eval $set_cc_for_build
    250         cat <<EOF >$dummy.s
    251         .data
    252 \$Lformat:
    253         .byte 37,100,45,37,120,10,0     # "%d-%x\n"
    254 
    255         .text
    256         .globl main
    257         .align 4
    258         .ent main
    259 main:
    260         .frame \$30,16,\$26,0
    261         ldgp \$29,0(\$27)
    262         .prologue 1
    263         .long 0x47e03d80 # implver \$0
    264         lda \$2,-1
    265         .long 0x47e20c21 # amask \$2,\$1
    266         lda \$16,\$Lformat
    267         mov \$0,\$17
    268         not \$1,\$18
    269         jsr \$26,printf
    270         ldgp \$29,0(\$26)
    271         mov 0,\$16
    272         jsr \$26,exit
    273         .end main
    274 EOF
    275         $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
    276         if test "$?" = 0 ; then
    277                 case `$dummy` in
    278                         0-0)
    279                                 UNAME_MACHINE="alpha"
    280                                 ;;
    281                         1-0)
    282                                 UNAME_MACHINE="alphaev5"
    283                                 ;;
    284                         1-1)
    285                                 UNAME_MACHINE="alphaev56"
    286                                 ;;
    287                         1-101)
    288                                 UNAME_MACHINE="alphapca56"
    289                                 ;;
    290                         2-303)
    291                                 UNAME_MACHINE="alphaev6"
    292                                 ;;
    293                         2-307)
    294                                 UNAME_MACHINE="alphaev67"
    295                                 ;;
    296                         2-1307)
    297                                 UNAME_MACHINE="alphaev68"
    298                                 ;;
    299                         3-1307)
    300                                 UNAME_MACHINE="alphaev7"
    301                                 ;;
    302                 esac
    303         fi
    304         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     318        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    305319        exit 0 ;;
    306320    Alpha\ *:Windows_NT*:*)
     
    324338    *:OS/390:*:*)
    325339        echo i370-ibm-openedition
     340        exit 0 ;;
     341    *:OS400:*:*)
     342        echo powerpc-ibm-os400
    326343        exit 0 ;;
    327344    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
     
    342359        echo pyramid-pyramid-svr4
    343360        exit 0 ;;
     361    DRS?6000:unix:4.0:6*)
     362        echo sparc-icl-nx6
     363        exit 0 ;;
    344364    DRS?6000:UNIX_SV:4.2*:7*)
    345365        case `/usr/bin/uname -p` in
     
    414434        echo m68k-unknown-mint${UNAME_RELEASE}
    415435        exit 0 ;;
     436    m68k:machten:*:*)
     437        echo m68k-apple-machten${UNAME_RELEASE}
     438        exit 0 ;;
    416439    powerpc:machten:*:*)
    417440        echo powerpc-apple-machten${UNAME_RELEASE}
     
    749772        exit 0 ;;
    750773    *:UNICOS/mp:*:*)
    751         echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     774        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    752775        exit 0 ;;
    753776    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
     
    757780        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    758781        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 ;;
    759787    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    760788        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
     
    767795        exit 0 ;;
    768796    *:FreeBSD:*:*)
    769         # Determine whether the default compiler uses glibc.
    770         eval $set_cc_for_build
    771         sed 's/^        //' << EOF >$dummy.c
    772         #include <features.h>
    773         #if __GLIBC__ >= 2
    774         LIBC=gnu
    775         #else
    776         LIBC=
    777         #endif
    778 EOF
    779         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    780         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
     797        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    781798        exit 0 ;;
    782799    i*:CYGWIN*:*)
     
    789806        echo ${UNAME_MACHINE}-pc-pw32
    790807        exit 0 ;;
    791     x86:Interix*:3*)
    792         echo i586-pc-interix3
     808    x86:Interix*:[34]*)
     809        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
    793810        exit 0 ;;
    794811    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
     
    811828        exit 0 ;;
    812829    *:GNU:*:*)
     830        # the GNU system
    813831        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
    814836        exit 0 ;;
    815837    i*86:Minix:*:*)
     
    817839        exit 0 ;;
    818840    arm*:Linux:*:*)
    819         echo ${UNAME_MACHINE}-unknown-linux-gnu
     841        echo ${UNAME_MACHINE}-${VENDOR}-linux
     842        exit 0 ;;
     843    cris:Linux:*:*)
     844        echo cris-axis-linux
    820845        exit 0 ;;
    821846    ia64:Linux:*:*)
    822         echo ${UNAME_MACHINE}-unknown-linux-gnu
     847        echo ${UNAME_MACHINE}-${VENDOR}-linux
     848        exit 0 ;;
     849    m32r*:Linux:*:*)
     850        echo ${UNAME_MACHINE}-${VENDOR}-linux
    823851        exit 0 ;;
    824852    m68*:Linux:*:*)
    825         echo ${UNAME_MACHINE}-unknown-linux-gnu
     853        echo ${UNAME_MACHINE}-${VENDOR}-linux
    826854        exit 0 ;;
    827855    mips:Linux:*:*)
     
    842870EOF
    843871        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    844         test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
     872        test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
    845873        ;;
    846874    mips64:Linux:*:*)
     
    861889EOF
    862890        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    863         test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
     891        test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
    864892        ;;
    865893    ppc:Linux:*:*)
    866         echo powerpc-unknown-linux-gnu
     894        echo powerpc-${VENDOR}-linux
    867895        exit 0 ;;
    868896    ppc64:Linux:*:*)
    869         echo powerpc64-unknown-linux-gnu
     897        echo powerpc64-${VENDOR}-linux
    870898        exit 0 ;;
    871899    alpha:Linux:*:*)
     
    880908        esac
    881909        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
    882         if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    883         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     910        if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
     911        echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
    884912        exit 0 ;;
    885913    parisc:Linux:*:* | hppa:Linux:*:*)
    886914        # Look for CPU level
    887915        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    888           PA7*) echo hppa1.1-unknown-linux-gnu ;;
    889           PA8*) echo hppa2.0-unknown-linux-gnu ;;
    890           *)    echo hppa-unknown-linux-gnu ;;
     916          PA7*) echo hppa1.1-${VENDOR}-linux ;;
     917          PA8*) echo hppa2.0-${VENDOR}-linux ;;
     918          *)    echo hppa-${VENDOR}-linux ;;
    891919        esac
    892920        exit 0 ;;
    893921    parisc64:Linux:*:* | hppa64:Linux:*:*)
    894         echo hppa64-unknown-linux-gnu
     922        echo hppa64-${VENDOR}-linux
    895923        exit 0 ;;
    896924    s390:Linux:*:* | s390x:Linux:*:*)
    897925        echo ${UNAME_MACHINE}-ibm-linux
    898926        exit 0 ;;
     927    sh64*:Linux:*:*)
     928        echo ${UNAME_MACHINE}-${VENDOR}-linux
     929        exit 0 ;;
    899930    sh*:Linux:*:*)
    900         echo ${UNAME_MACHINE}-unknown-linux-gnu
     931        echo ${UNAME_MACHINE}-${VENDOR}-linux
    901932        exit 0 ;;
    902933    sparc:Linux:*:* | sparc64:Linux:*:*)
    903         echo ${UNAME_MACHINE}-unknown-linux-gnu
     934        echo ${UNAME_MACHINE}-${VENDOR}-linux
    904935        exit 0 ;;
    905936    x86_64:Linux:*:*)
    906         echo x86_64-unknown-linux-gnu
     937        echo x86_64-${VENDOR}-linux
    907938        exit 0 ;;
    908939    i*86:Linux:*:*)
     
    919950        case "$ld_supported_targets" in
    920951          elf32-i386)
    921                 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
     952                TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux"
    922953                ;;
    923954          a.out-i386-linux)
    924                 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
     955                echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
    925956                exit 0 ;;
    926957          coff-i386)
    927                 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
     958                echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
    928959                exit 0 ;;
    929960          "")
    930                 # Either a pre-BFD a.out linker (linux-gnuoldld) or
     961                # Either a pre-BFD a.out linker (linuxoldld) or
    931962                # one that does not give us useful --help.
    932                 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
     963                echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
    933964                exit 0 ;;
    934965        esac
     
    954985        #endif
    955986        #endif
     987        #ifdef __dietlibc__
     988        LIBC=dietlibc
     989        #endif
    956990EOF
    957991        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    958         test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
     992        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
    959993        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
    960994        ;;
     
    9831017    i*86:atheos:*:*)
    9841018        echo ${UNAME_MACHINE}-unknown-atheos
     1019        exit 0 ;;
     1020        i*86:syllable:*:*)
     1021        echo ${UNAME_MACHINE}-pc-syllable
    9851022        exit 0 ;;
    9861023    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
     
    10531090        echo m68k-diab-dnix
    10541091        exit 0 ;;
    1055     M68*:*:R3V[567]*:*)
     1092    M68*:*:R3V[5678]*:*)
    10561093        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    1057     3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
     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)
    10581095        OS_REL=''
    10591096        test -r /etc/.relid \
     
    11531190        exit 0 ;;
    11541191    *:Darwin:*:*)
    1155         case `uname -p` in
     1192        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     1193        case $UNAME_PROCESSOR in
    11561194            *86) UNAME_PROCESSOR=i686 ;;
    1157             powerpc) UNAME_PROCESSOR=powerpc ;;
     1195            unknown) UNAME_PROCESSOR=powerpc ;;
    11581196        esac
    11591197        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     
    11701208        echo i386-pc-qnx
    11711209        exit 0 ;;
    1172     NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
     1210    NSR-?:NONSTOP_KERNEL:*:*)
    11731211        echo nsr-tandem-nsk${UNAME_RELEASE}
    11741212        exit 0 ;;
     
    12111249        echo pdp10-unknown-its
    12121250        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
    12131264esac
    12141265
  • trunk/psLib/config.sub

    r3377 r3407  
    22# Configuration validation subroutine script.
    33#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6 timestamp='2003-01-03'
     4#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
     5
     6timestamp='2004-06-24'
    77
    88# This file is (in principle) common to ALL GNU software.
     
    7171GNU config.sub ($timestamp)
    7272
    73 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     73Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    7474Free Software Foundation, Inc.
    7575
     
    119119maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    120120case $maybe_os in
    121   nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     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*)
    122123    os=-$maybe_os
    123124    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     
    145146        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    146147        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    147         -apple | -axis)
     148        -apple | -axis | -knuth | -cray)
    148149                os=
    149150                basic_machine=$1
     
    229230        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
    230231        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
     232        | am33_2.0 \
    231233        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
    232         | clipper \
     234        | c4x | clipper \
    233235        | d10v | d30v | dlx | dsp16xx \
    234236        | fr30 | frv \
    235237        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    236238        | i370 | i860 | i960 | ia64 \
    237         | ip2k \
    238         | m32r | m68000 | m68k | m88k | mcore \
     239        | ip2k | iq2000 \
     240        | m32r | m32rle | m68000 | m68k | m88k | mcore \
    239241        | mips | mipsbe | mipseb | mipsel | mipsle \
    240242        | mips16 \
     
    248250        | mipsisa32r2 | mipsisa32r2el \
    249251        | mipsisa64 | mipsisa64el \
     252        | mipsisa64r2 | mipsisa64r2el \
    250253        | mipsisa64sb1 | mipsisa64sb1el \
    251254        | mipsisa64sr71k | mipsisa64sr71kel \
     
    258261        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
    259262        | pyramid \
    260         | s390 | s390x \
    261         | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
     263        | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
    262264        | sh64 | sh64le \
    263         | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
     265        | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
    264266        | strongarm \
    265         | tahoe | thumb | tic80 | tron \
     267        | tahoe | thumb | tic4x | tic80 | tron \
    266268        | v850 | v850e \
    267269        | we32k \
     
    298300        | avr-* \
    299301        | bs2000-* \
    300         | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
    301         | clipper-* | cydra-* \
     302        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
     303        | clipper-* | craynv-* | cydra-* \
    302304        | d10v-* | d30v-* | dlx-* \
    303305        | elxsi-* \
     
    306308        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    307309        | i*86-* | i860-* | i960-* | ia64-* \
    308         | ip2k-* \
    309         | m32r-* \
     310        | ip2k-* | iq2000-* \
     311        | m32r-* | m32rle-* \
    310312        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    311313        | m88110-* | m88k-* | mcore-* \
     
    321323        | mipsisa32r2-* | mipsisa32r2el-* \
    322324        | mipsisa64-* | mipsisa64el-* \
     325        | mipsisa64r2-* | mipsisa64r2el-* \
    323326        | mipsisa64sb1-* | mipsisa64sb1el-* \
    324327        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
    325328        | mipstx39-* | mipstx39el-* \
     329        | mmix-* \
    326330        | msp430-* \
    327         | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
     331        | none-* | np1-* | ns16k-* | ns32k-* \
    328332        | orion-* \
    329333        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     
    331335        | pyramid-* \
    332336        | romp-* | rs6000-* \
    333         | s390-* | s390x-* \
    334         | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
     337        | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
    335338        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    336339        | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
    337         | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
    338         | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
     340        | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
     341        | tahoe-* | thumb-* \
     342        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
     343        | tron-* \
    339344        | v850-* | v850e-* | vax-* \
    340345        | we32k-* \
     
    360365                os=-udi
    361366                ;;
     367        abacus)
     368                basic_machine=abacus-unknown
     369                ;;
    362370        adobe68k)
    363371                basic_machine=m68010-adobe
     
    374382                os=-bsd
    375383                ;;
     384        amd64)
     385                basic_machine=x86_64-pc
     386                ;;
     387        amd64-*)
     388                basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     389                ;;
    376390        amdahl)
    377391                basic_machine=580-amdahl
     
    433447                os=-unicos
    434448                ;;
     449        craynv)
     450                basic_machine=craynv-cray
     451                os=-unicosmp
     452                ;;
     453        cr16c)
     454                basic_machine=cr16c-unknown
     455                os=-elf
     456                ;;
    435457        crds | unos)
    436458                basic_machine=m68k-crds
     
    438460        cris | cris-* | etrax*)
    439461                basic_machine=cris-axis
     462                ;;
     463        crx)
     464                basic_machine=crx-unknown
     465                os=-elf
    440466                ;;
    441467        da30 | da30-*)
     
    638664        mips3*)
    639665                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    640                 ;;
    641         mmix*)
    642                 basic_machine=mmix-knuth
    643                 os=-mmixware
    644666                ;;
    645667        monitor)
     
    723745                basic_machine=np1-gould
    724746                ;;
    725         nv1)
    726                 basic_machine=nv1-cray
    727                 os=-unicosmp
    728                 ;;
    729747        nsr-tandem)
    730748                basic_machine=nsr-tandem
     
    738756                os=-coff
    739757                ;;
     758        os400)
     759                basic_machine=powerpc-ibm
     760                os=-os400
     761                ;;
    740762        OSE68000 | ose68000)
    741763                basic_machine=m68000-ericsson
     
    769791                basic_machine=i686-pc
    770792                ;;
    771         pentiumii | pentium2)
     793        pentiumii | pentium2 | pentiumiii | pentium3)
    772794                basic_machine=i686-pc
     795                ;;
     796        pentium4)
     797                basic_machine=i786-pc
    773798                ;;
    774799        pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
     
    778803                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    779804                ;;
    780         pentiumii-* | pentium2-*)
     805        pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    781806                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     807                ;;
     808        pentium4-*)
     809                basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    782810                ;;
    783811        pn)
     
    823851                basic_machine=romp-ibm
    824852                ;;
     853        s390 | s390-*)
     854                basic_machine=s390-ibm
     855                ;;
     856        s390x | s390x-*)
     857                basic_machine=s390x-ibm
     858                ;;
    825859        sa29200)
    826860                basic_machine=a29k-amd
     
    833867                basic_machine=mipsisa64sb1el-unknown
    834868                ;;
     869        sei)
     870                basic_machine=mips-sei
     871                os=-seiux
     872                ;;
    835873        sequent)
    836874                basic_machine=i386-sequent
     
    840878                os=-hms
    841879                ;;
     880        sh64)
     881                basic_machine=sh64-unknown
     882                ;;
    842883        sparclite-wrs | simso-wrs)
    843884                basic_machine=sparclite-wrs
     
    914955                os=-unicos
    915956                ;;
    916         tic4x | c4x*)
    917                 basic_machine=tic4x-unknown
    918                 os=-coff
    919                 ;;
    920957        tic54x | c54x*)
    921958                basic_machine=tic54x-unknown
    922959                os=-coff
    923960                ;;
     961        tic55x | c55x*)
     962                basic_machine=tic55x-unknown
     963                os=-coff
     964                ;;
     965        tic6x | c6x*)
     966                basic_machine=tic6x-unknown
     967                os=-coff
     968                ;;
    924969        tx39)
    925970                basic_machine=mipstx39-unknown
     
    934979        tower | tower-32)
    935980                basic_machine=m68k-ncr
     981                ;;
     982        tpf)
     983                basic_machine=s390x-ibm
     984                os=-tpf
    936985                ;;
    937986        udi29k)
     
    10081057                basic_machine=romp-ibm
    10091058                ;;
     1059        mmix)
     1060                basic_machine=mmix-knuth
     1061                ;;
    10101062        rs6000)
    10111063                basic_machine=rs6000-ibm
     
    10241076                basic_machine=we32k-att
    10251077                ;;
    1026         sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
     1078        sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
    10271079                basic_machine=sh-unknown
    10281080                ;;
     
    10301082                basic_machine=sh64-unknown
    10311083                ;;
    1032         sparc | sparcv9 | sparcv9b)
     1084        sparc | sparcv8 | sparcv9 | sparcv9b)
    10331085                basic_machine=sparc-sun
    10341086                ;;
     
    11031155              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    11041156              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1105               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    1106               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     1157              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
     1158              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1159              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    11071160              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    11081161              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    11091162              | -chorusos* | -chorusrdb* \
    11101163              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1111               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
     1164              | -mingw32* | -linux* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
    11121165              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    11131166              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     
    11151168              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    11161169              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    1117               | -powermax* | -dnix* | -microbsd*)
     1170              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
    11181171        # Remember, each alternative MUST END IN *, to match a version number.
    11191172                ;;
     
    11391192                os=`echo $os | sed -e 's|mac|macos|'`
    11401193                ;;
    1141         -linux*)
    1142                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
     1194        -linux-dietlibc)
     1195                os=-linux-dietlibc
    11431196                ;;
    11441197        -sunos5*)
     
    11511204                os=-openedition
    11521205                ;;
     1206        -os400*)
     1207                os=-os400
     1208                ;;
    11531209        -wince*)
    11541210                os=-wince
     
    11711227        -atheos*)
    11721228                os=-atheos
     1229                ;;
     1230        -syllable*)
     1231                os=-syllable
    11731232                ;;
    11741233        -386bsd)
     
    11941253                os=-sysv4
    11951254                ;;
     1255        -tpf*)
     1256                os=-tpf
     1257                ;;
    11961258        -triton*)
    11971259                os=-sysv3
     
    12231285        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    12241286                os=-mint
     1287                ;;
     1288        -aros*)
     1289                os=-aros
     1290                ;;
     1291        -kaos*)
     1292                os=-kaos
    12251293                ;;
    12261294        -none)
     
    12551323                os=-aout
    12561324                ;;
     1325    c4x-* | tic4x-*)
     1326        os=-coff
     1327        ;;
    12571328        # This must come before the *-dec entry.
    12581329        pdp10-*)
     
    13001371        *-ibm)
    13011372                os=-aix
     1373                ;;
     1374        *-knuth)
     1375                os=-mmixware
    13021376                ;;
    13031377        *-wec)
     
    14331507                                vendor=ibm
    14341508                                ;;
     1509                        -os400*)
     1510                                vendor=ibm
     1511                                ;;
    14351512                        -ptx*)
    14361513                                vendor=sequent
     1514                                ;;
     1515                        -tpf*)
     1516                                vendor=ibm
    14371517                                ;;
    14381518                        -vxsim* | -vxworks* | -windiss*)
  • trunk/psLib/ltmain.sh

    r3377 r3407  
    22# NOTE: Changing this file will not affect anything until you rerun configure.
    33#
    4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
     4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
    55# Free Software Foundation, Inc.
    66# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
     
    2525# the same distribution terms that you use for the rest of that program.
    2626
     27basename="s,^.*/,,g"
     28
     29# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
     30# is ksh but when the shell is invoked as "sh" and the current value of
     31# the _XPG environment variable is not equal to 1 (one), the special
     32# positional parameter $0, within a function call, is the name of the
     33# function.
     34progpath="$0"
     35
     36# The name of this program:
     37progname=`echo "$progpath" | $SED $basename`
     38modename="$progname"
     39
     40# Global variables:
     41EXIT_SUCCESS=0
     42EXIT_FAILURE=1
     43
     44PROGRAM=ltmain.sh
     45PACKAGE=libtool
     46VERSION=1.5.8
     47TIMESTAMP=" (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.
     51if test -n "${ZSH_VERSION+set}" ; then
     52  setopt NO_GLOB_SUBST
     53fi
     54
    2755# Check that we have a working $echo.
    2856if test "X$1" = X--no-reexec; then
     
    3765else
    3866  # Restart under the correct shell, and then maybe $echo will work.
    39   exec $SHELL "$0" --no-reexec ${1+"$@"}
     67  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
    4068fi
    4169
     
    4674$*
    4775EOF
    48   exit 0
     76  exit $EXIT_SUCCESS
    4977fi
    50 
    51 # define SED for historic ltconfig's generated by Libtool 1.3
    52 test -z "$SED" && SED=sed
    53 
    54 # The name of this program.
    55 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
    56 modename="$progname"
    57 
    58 # Constants.
    59 PROGRAM=ltmain.sh
    60 PACKAGE=libtool
    61 VERSION=1.4.3
    62 TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
    6378
    6479default_mode=
     
    7388Xsed="${SED}"' -e 1s/^X//'
    7489sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    75 # test EBCDIC or ASCII                                                         
    76 case `echo A|od -x` in                                                         
    77  *[Cc]1*) # EBCDIC based system                                               
    78   SP2NL="tr '\100' '\n'"                                                       
    79   NL2SP="tr '\r\n' '\100\100'"                                                 
    80   ;;                                                                           
    81  *) # Assume ASCII based system                                               
    82   SP2NL="tr '\040' '\012'"                                                     
    83   NL2SP="tr '\015\012' '\040\040'"                                             
    84   ;;                                                                           
    85 esac                                                                           
     90# test EBCDIC or ASCII
     91case `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  ;;
     100esac
    86101
    87102# NLS nuisances.
     
    98113
    99114# Make sure IFS has a sensible default
    100 : ${IFS="       "}
     115: ${IFS="       
     116"}
    101117
    102118if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
    103   echo "$modename: not configured to build any kind of library" 1>&2
    104   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    105   exit 1
     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
    106122fi
    107123
     
    118134o2lo="s/\\.${objext}\$/.lo/"
    119135
     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.
     146func_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 ...'
     186func_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 ...
     246func_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
     363eval std_shrext=\"$shrext_cmds\"
     364
    120365# Parse our command line options once, thoroughly.
    121 while test $# -gt 0
     366while test "$#" -gt 0
    122367do
    123368  arg="$1"
     
    135380      execute_dlfiles="$execute_dlfiles $arg"
    136381      ;;
     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      ;;
    137410    *)
    138411      eval "$prev=\$arg"
     
    152425
    153426  --version)
    154     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
    155     exit 0
     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
    156433    ;;
    157434
    158435  --config)
    159     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
    160     exit 0
     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
    161442    ;;
    162443
    163444  --debug)
    164     echo "$progname: enabling shell trace mode"
     445    $echo "$progname: enabling shell trace mode"
    165446    set -x
     447    preserve_args="$preserve_args $arg"
    166448    ;;
    167449
     
    171453
    172454  --features)
    173     echo "host: $host"
     455    $echo "host: $host"
    174456    if test "$build_libtool_libs" = yes; then
    175       echo "enable shared libraries"
     457      $echo "enable shared libraries"
    176458    else
    177       echo "disable shared libraries"
     459      $echo "disable shared libraries"
    178460    fi
    179461    if test "$build_old_libs" = yes; then
    180       echo "enable static libraries"
     462      $echo "enable static libraries"
    181463    else
    182       echo "disable static libraries"
     464      $echo "disable static libraries"
    183465    fi
    184     exit 0
     466    exit $EXIT_SUCCESS
    185467    ;;
    186468
     
    194476  --quiet | --silent)
    195477    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"
    196487    ;;
    197488
     
    204495    $echo "$modename: unrecognized option \`$arg'" 1>&2
    205496    $echo "$help" 1>&2
    206     exit 1
     497    exit $EXIT_FAILURE
    207498    ;;
    208499
     
    217508  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
    218509  $echo "$help" 1>&2
    219   exit 1
     510  exit $EXIT_FAILURE
    220511fi
    221512
     
    229520  # Infer the operation mode.
    230521  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
    231524    case $nonopt in
    232     *cc | *++ | gcc* | *-gcc* | xlc*)
     525    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
    233526      mode=link
    234527      for arg
     
    271564    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
    272565    $echo "$help" 1>&2
    273     exit 1
     566    exit $EXIT_FAILURE
    274567  fi
    275568
     
    285578    # Get the compilation command and the source file.
    286579    base_compile=
    287     prev=
    288     lastarg=
    289     srcfile="$nonopt"
     580    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
     581    suppress_opt=yes
    290582    suppress_output=
    291 
    292     user_target=no
     583    arg_mode=normal
     584    libobj=
     585    later=
     586
    293587    for arg
    294588    do
    295       case $prev in
    296       "") ;;
    297       xcompiler)
    298         # Aesthetically quote the previous argument.
    299         prev=
    300         lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    301 
     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.
    302604        case $arg in
    303         # Double-quote args containing other shell metacharacters.
    304         # Many Bourne shells cannot handle close brackets correctly
    305         # in scan sets, so we specify it separately.
    306         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
    307           arg="\"$arg\""
    308           ;;
    309         esac
    310 
    311         # Add the previous argument to base_compile.
    312         if test -z "$base_compile"; then
    313           base_compile="$lastarg"
    314         else
     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.
    315650          base_compile="$base_compile $lastarg"
    316         fi
    317         continue
    318         ;;
    319       esac
    320 
    321       # Accept any command-line options.
    322       case $arg in
    323       -o)
    324         if test "$user_target" != "no"; then
    325           $echo "$modename: you cannot specify \`-o' more than once" 1>&2
    326           exit 1
    327         fi
    328         user_target=next
    329         ;;
    330 
    331       -static)
    332         build_old_libs=yes
    333         continue
    334         ;;
    335 
    336       -prefer-pic)
    337         pic_mode=yes
    338         continue
    339         ;;
    340 
    341       -prefer-non-pic)
    342         pic_mode=no
    343         continue
    344         ;;
    345 
    346       -Xcompiler)
    347         prev=xcompiler
    348         continue
    349         ;;
    350 
    351       -Wc,*)
    352         args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
    353         lastarg=
    354         save_ifs="$IFS"; IFS=','
    355         for arg in $args; do
    356           IFS="$save_ifs"
    357 
    358           # Double-quote args containing other shell metacharacters.
    359           # Many Bourne shells cannot handle close brackets correctly
    360           # in scan sets, so we specify it separately.
    361           case $arg in
    362             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
    363             arg="\"$arg\""
    364             ;;
    365           esac
    366           lastarg="$lastarg $arg"
    367         done
    368         IFS="$save_ifs"
    369         lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
    370 
    371         # Add the arguments to base_compile.
    372         if test -z "$base_compile"; then
    373           base_compile="$lastarg"
    374         else
    375           base_compile="$base_compile $lastarg"
    376         fi
    377         continue
    378         ;;
    379       esac
    380 
    381       case $user_target in
    382       next)
    383         # The next one is the -o target name
    384         user_target=yes
    385         continue
    386         ;;
    387       yes)
    388         # We got the output file
    389         user_target=set
    390         libobj="$arg"
    391         continue
    392         ;;
    393       esac
    394 
    395       # Accept the current argument as the source file.
    396       lastarg="$srcfile"
    397       srcfile="$arg"
     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
    398664
    399665      # Aesthetically quote the previous argument.
    400 
    401       # Backslashify any backslashes, double quotes, and dollar signs.
    402       # These are the only characters that are still specially
    403       # interpreted inside of double-quoted scrings.
    404666      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
    405667
     668      case $lastarg in
    406669      # Double-quote args containing other shell metacharacters.
    407670      # Many Bourne shells cannot handle close brackets correctly
    408671      # in scan sets, so we specify it separately.
    409       case $lastarg in
    410672      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    411673        lastarg="\"$lastarg\""
     
    413675      esac
    414676
    415       # Add the previous argument to base_compile.
    416       if test -z "$base_compile"; then
    417         base_compile="$lastarg"
    418       else
    419         base_compile="$base_compile $lastarg"
    420       fi
    421     done
    422 
    423     case $user_target in
    424     set)
     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
    425684      ;;
    426     no)
    427       # Get the name of the library object.
    428       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
     685    target)
     686      $echo "$modename: you must specify a target with \`-o'" 1>&2
     687      exit $EXIT_FAILURE
    429688      ;;
    430689    *)
    431       $echo "$modename: you must specify a target with \`-o'" 1>&2
    432       exit 1
     690      # Get the name of the library object.
     691      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
    433692      ;;
    434693    esac
     
    436695    # Recognize several different file suffixes.
    437696    # If the user specifies -o file.o, it is replaced with file.lo
    438     xform='[cCFSfmso]'
     697    xform='[cCFSifmso]'
    439698    case $libobj in
    440699    *.ada) xform=ada ;;
     
    444703    *.c++) xform=c++ ;;
    445704    *.cc) xform=cc ;;
     705    *.ii) xform=ii ;;
     706    *.class) xform=class ;;
    446707    *.cpp) xform=cpp ;;
    447708    *.cxx) xform=cxx ;;
    448709    *.f90) xform=f90 ;;
    449710    *.for) xform=for ;;
     711    *.java) xform=java ;;
    450712    esac
    451713
     
    456718    *)
    457719      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
    458       exit 1
     720      exit $EXIT_FAILURE
    459721      ;;
    460722    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
    461753
    462754    if test -z "$base_compile"; then
    463755      $echo "$modename: you must specify a compilation command" 1>&2
    464756      $echo "$help" 1>&2
    465       exit 1
     757      exit $EXIT_FAILURE
    466758    fi
    467759
    468760    # Delete any leftover library objects.
    469761    if test "$build_old_libs" = yes; then
    470       removelist="$obj $libobj"
     762      removelist="$obj $lobj $libobj ${libobj}T"
    471763    else
    472       removelist="$libobj"
     764      removelist="$lobj $libobj ${libobj}T"
    473765    fi
    474766
    475767    $run $rm $removelist
    476     trap "$run $rm $removelist; exit 1" 1 2 15
     768    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
    477769
    478770    # On Cygwin there's no "real" PIC flag so we must build both object types
     
    493785      lockfile="$output_obj.lock"
    494786      removelist="$removelist $output_obj $lockfile"
    495       trap "$run $rm $removelist; exit 1" 1 2 15
     787      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
    496788    else
     789      output_obj=
    497790      need_locks=no
    498791      lockfile=
     
    502795    # We use this script file to make the link, it avoids creating a new file
    503796    if test "$need_locks" = yes; then
    504       until $run ln "$0" "$lockfile" 2>/dev/null; do
     797      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
    505798        $show "Waiting for $lockfile to be removed"
    506799        sleep 2
     
    508801    elif test "$need_locks" = warn; then
    509802      if test -f "$lockfile"; then
    510         echo "\
     803        $echo "\
    511804*** ERROR, $lockfile exists and contains:
    512805`cat $lockfile 2>/dev/null`
     
    520813
    521814        $run $rm $removelist
    522         exit 1
    523       fi
    524       echo $srcfile > "$lockfile"
     815        exit $EXIT_FAILURE
     816      fi
     817      $echo $srcfile > "$lockfile"
    525818    fi
    526819
     
    528821      eval srcfile=\"$fix_srcfile_path\"
    529822    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.
     836EOF
    530837
    531838    # Only build a PIC object if we are building libtool libraries.
     
    535842
    536843      if test "$pic_mode" != no; then
    537         # All platforms use -DPIC, to notify preprocessed assembler code.
    538         command="$base_compile $srcfile $pic_flag -DPIC"
     844        command="$base_compile $srcfile $pic_flag"
    539845      else
    540846        # Don't build PIC code
    541847        command="$base_compile $srcfile"
    542848      fi
    543       if test "$build_old_libs" = yes; then
    544         lo_libobj="$libobj"
    545         dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
    546         if test "X$dir" = "X$libobj"; then
    547           dir="$objdir"
    548         else
    549           dir="$dir/$objdir"
    550         fi
    551         libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
    552 
    553         if test -d "$dir"; then
    554           $show "$rm $libobj"
    555           $run $rm $libobj
    556         else
    557           $show "$mkdir $dir"
    558           $run $mkdir $dir
    559           status=$?
    560           if test $status -ne 0 && test ! -d $dir; then
    561             exit $status
    562           fi
    563         fi
    564       fi
    565       if test "$compiler_o_lo" = yes; then
    566         output_obj="$libobj"
    567         command="$command -o $output_obj"
    568       elif test "$compiler_c_o" = yes; then
    569         output_obj="$obj"
    570         command="$command -o $output_obj"
    571       fi
    572 
    573       $run $rm "$output_obj"
     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
    574866      $show "$command"
    575867      if $run eval "$command"; then :
    576868      else
    577869        test -n "$output_obj" && $run $rm $removelist
    578         exit 1
     870        exit $EXIT_FAILURE
    579871      fi
    580872
    581873      if test "$need_locks" = warn &&
    582          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
    583         echo "\
     874         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
     875        $echo "\
    584876*** ERROR, $lockfile contains:
    585877`cat $lockfile 2>/dev/null`
     
    596888
    597889        $run $rm $removelist
    598         exit 1
     890        exit $EXIT_FAILURE
    599891      fi
    600892
    601893      # Just move the object if needed, then go on to compile the next one
    602       if test x"$output_obj" != x"$libobj"; then
    603         $show "$mv $output_obj $libobj"
    604         if $run $mv $output_obj $libobj; then :
     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 :
    605897        else
    606898          error=$?
     
    610902      fi
    611903
    612       # If we have no pic_flag, then copy the object into place and finish.
    613       if (test -z "$pic_flag" || test "$pic_mode" != default) &&
    614          test "$build_old_libs" = yes; then
    615         # Rename the .lo from within objdir to obj
    616         if test -f $obj; then
    617           $show $rm $obj
    618           $run $rm $obj
    619         fi
    620 
    621         $show "$mv $libobj $obj"
    622         if $run $mv $libobj $obj; then :
    623         else
    624           error=$?
    625           $run $rm $removelist
    626           exit $error
    627         fi
    628 
    629         xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
    630         if test "X$xdir" = "X$obj"; then
    631           xdir="."
    632         else
    633           xdir="$xdir"
    634         fi
    635         baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
    636         libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
    637         # Now arrange that obj and lo_libobj become the same file
    638         $show "(cd $xdir && $LN_S $baseobj $libobj)"
    639         if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
    640           # Unlock the critical section if it was locked
    641           if test "$need_locks" != no; then
    642             $run $rm "$lockfile"
    643           fi
    644           exit 0
    645         else
    646           error=$?
    647           $run $rm $removelist
    648           exit $error
    649         fi
    650       fi
     904      # Append the name of the PIC object to the libtool object file.
     905      test -z "$run" && cat >> ${libobj}T <<EOF
     906pic_object='$objdir/$objname'
     907
     908EOF
    651909
    652910      # Allow error messages only from the first compilation.
    653       suppress_output=' >/dev/null 2>&1'
     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
     918pic_object=none
     919
     920EOF
    654921    fi
    655922
     
    660927        command="$base_compile $srcfile"
    661928      else
    662         # All platforms use -DPIC, to notify preprocessed assembler code.
    663         command="$base_compile $srcfile $pic_flag -DPIC"
     929        command="$base_compile $srcfile $pic_flag"
    664930      fi
    665931      if test "$compiler_c_o" = yes; then
    666932        command="$command -o $obj"
    667         output_obj="$obj"
    668933      fi
    669934
    670935      # Suppress compiler output if we already did a PIC compilation.
    671936      command="$command$suppress_output"
    672       $run $rm "$output_obj"
     937      $run $rm "$obj" "$output_obj"
    673938      $show "$command"
    674939      if $run eval "$command"; then :
    675940      else
    676941        $run $rm $removelist
    677         exit 1
     942        exit $EXIT_FAILURE
    678943      fi
    679944
    680945      if test "$need_locks" = warn &&
    681          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
    682         echo "\
     946         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
     947        $echo "\
    683948*** ERROR, $lockfile contains:
    684949`cat $lockfile 2>/dev/null`
     
    695960
    696961        $run $rm $removelist
    697         exit 1
     962        exit $EXIT_FAILURE
    698963      fi
    699964
    700965      # Just move the object if needed
    701       if test x"$output_obj" != x"$obj"; then
     966      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
    702967        $show "$mv $output_obj $obj"
    703968        if $run $mv $output_obj $obj; then :
     
    709974      fi
    710975
    711       # Create an invalid libtool object if no PIC, so that we do not
    712       # accidentally link it into a program.
    713       if test "$build_libtool_libs" != yes; then
    714         $show "echo timestamp > $libobj"
    715         $run eval "echo timestamp > \$libobj" || exit $?
    716       else
    717         # Move the .lo from within objdir
    718         $show "$mv $libobj $lo_libobj"
    719         if $run $mv $libobj $lo_libobj; then :
    720         else
    721           error=$?
    722           $run $rm $removelist
    723           exit $error
    724         fi
    725       fi
     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.
     980non_pic_object='$objname'
     981
     982EOF
     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.
     988non_pic_object=none
     989
     990EOF
    726991    fi
     992
     993    $run $mv "${libobj}T" "${libobj}"
    727994
    728995    # Unlock the critical section if it was locked
     
    731998    fi
    732999
    733     exit 0
     1000    exit $EXIT_SUCCESS
    7341001    ;;
    7351002
     
    7421009      # we shouldn't force the makefile maintainer to figure out
    7431010      # which system we are compiling for in order to pass an extra
    744       # flag for every libtool invokation.
     1011      # flag for every libtool invocation.
    7451012      # allow_undefined=no
    7461013
     
    7571024    esac
    7581025    libtool_args="$nonopt"
     1026    base_compile="$nonopt $@"
    7591027    compile_command="$nonopt"
    7601028    finalize_command="$nonopt"
     
    7871055    no_install=no
    7881056    objs=
     1057    non_pic_objects=
     1058    precious_files_regex=
    7891059    prefer_static_libs=no
    7901060    preload=no
     
    7981068    thread_safe=no
    7991069    vinfo=
     1070    vinfo_number=no
     1071
     1072    func_infer_tag $base_compile
    8001073
    8011074    # We need to know -static, to get the right output filenames.
     
    8281101
    8291102    # Go through the arguments, transforming them on the way.
    830     while test $# -gt 0; do
     1103    while test "$#" -gt 0; do
    8311104      arg="$1"
    8321105      shift
     
    8931166          if test ! -f "$arg"; then
    8941167            $echo "$modename: symbol file \`$arg' does not exist"
    895             exit 1
     1168            exit $EXIT_FAILURE
    8961169          fi
    8971170          prev=
     
    9031176          continue
    9041177          ;;
    905         inst_prefix)
     1178        inst_prefix)
    9061179          inst_prefix_dir="$arg"
    9071180          prev=
    9081181          continue
    9091182          ;;
     1183        precious_regex)
     1184          precious_files_regex="$arg"
     1185          prev=
     1186          continue
     1187          ;;
    9101188        release)
    9111189          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
    9121297          prev=
    9131298          continue
     
    9191304          *)
    9201305            $echo "$modename: only absolute run-paths are allowed" 1>&2
    921             exit 1
     1306            exit $EXIT_FAILURE
    9221307            ;;
    9231308          esac
     
    9511336          continue
    9521337          ;;
     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          ;;
    9531351        *)
    9541352          eval "$prev=\"\$arg\""
     
    9571355          ;;
    9581356        esac
    959       fi # test -n $prev
     1357      fi # test -n "$prev"
    9601358
    9611359      prevarg="$arg"
     
    9991397        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
    10001398          $echo "$modename: more than one -exported-symbols argument is not allowed"
    1001           exit 1
     1399          exit $EXIT_FAILURE
    10021400        fi
    10031401        if test "X$arg" = "X-export-symbols"; then
     
    10181416      -L[A-Z][A-Z]*:*)
    10191417        case $with_gcc/$host in
    1020         no/*-*-irix* | no/*-*-nonstopux*)
     1418        no/*-*-irix* | /*-*-irix*)
    10211419          compile_command="$compile_command $arg"
    10221420          finalize_command="$finalize_command $arg"
     
    10351433          if test -z "$absdir"; then
    10361434            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
    1037             exit 1
     1435            exit $EXIT_FAILURE
    10381436          fi
    10391437          dir="$absdir"
     
    10731471            test "X$arg" = "X-lc" && continue
    10741472            ;;
     1473          *-*-rhapsody* | *-*-darwin1.[012])
     1474            # Rhapsody C and math libraries are in the System framework
     1475            deplibs="$deplibs -framework System"
     1476            continue
    10751477          esac
    1076          elif test "X$arg" = "X-lc_r"; then
    1077           case $host in
     1478        elif test "X$arg" = "X-lc_r"; then
     1479         case $host in
    10781480         *-*-openbsd* | *-*-freebsd*)
    1079             # Do not include libc_r directly, use -pthread flag.
    1080             continue
    1081             ;;
    1082           esac
     1481           # Do not include libc_r directly, use -pthread flag.
     1482           continue
     1483           ;;
     1484         esac
    10831485        fi
    10841486        deplibs="$deplibs $arg"
     
    10861488        ;;
    10871489
     1490     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
     1491        deplibs="$deplibs $arg"
     1492        continue
     1493        ;;
     1494
    10881495      -module)
    10891496        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
    10901525        continue
    10911526        ;;
     
    11151550        ;;
    11161551
     1552      -objectlist)
     1553        prev=objectlist
     1554        continue
     1555        ;;
     1556
    11171557      -o) prev=output ;;
     1558
     1559      -precious-files-regex)
     1560        prev=precious_regex
     1561        continue
     1562        ;;
    11181563
    11191564      -release)
     
    11391584        *)
    11401585          $echo "$modename: only absolute run-paths are allowed" 1>&2
    1141           exit 1
     1586          exit $EXIT_FAILURE
    11421587          ;;
    11431588        esac
     
    11651610      -version-info)
    11661611        prev=vinfo
     1612        continue
     1613        ;;
     1614      -version-number)
     1615        prev=vinfo
     1616        vinfo_number=yes
    11671617        continue
    11681618        ;;
     
    12151665        ;;
    12161666
     1667      -XCClinker)
     1668        prev=xcclinker
     1669        continue
     1670        ;;
     1671
    12171672      # Some other compiler flag.
    12181673      -* | +*)
     
    12271682        ;;
    12281683
    1229       *.lo | *.$objext)
    1230         # A library or standard object.
    1231         if test "$prev" = dlfiles; then
    1232           # This file was specified with -dlopen.
    1233           if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
    1234             dlfiles="$dlfiles $arg"
    1235             prev=
    1236             continue
     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
    12371763          else
    1238             # If libtool objects are unsupported, then we need to preload.
    1239             prev=dlprefiles
    1240           fi
    1241         fi
    1242 
    1243         if test "$prev" = dlprefiles; then
    1244           # Preload the old-style object.
    1245           dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
    1246           prev=
    1247         else
    1248           case $arg in
    1249           *.lo) libobjs="$libobjs $arg" ;;
    1250           *) objs="$objs $arg" ;;
    1251           esac
     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
    12521779        fi
    12531780        ;;
     
    13001827      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
    13011828      $echo "$help" 1>&2
    1302       exit 1
     1829      exit $EXIT_FAILURE
    13031830    fi
    13041831
     
    13091836    fi
    13101837
     1838    oldlibs=
    13111839    # calculate the name of the file, without its directory
    13121840    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
     
    13291857    fi
    13301858    # Create the object directory.
    1331     if test ! -d $output_objdir; then
     1859    if test ! -d "$output_objdir"; then
    13321860      $show "$mkdir $output_objdir"
    13331861      $run $mkdir $output_objdir
    13341862      status=$?
    1335       if test $status -ne 0 && test ! -d $output_objdir; then
     1863      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
    13361864        exit $status
    13371865      fi
     
    13431871      $echo "$modename: you must specify an output file" 1>&2
    13441872      $echo "$help" 1>&2
    1345       exit 1
     1873      exit $EXIT_FAILURE
    13461874      ;;
    13471875    *.$libext) linkmode=oldlib ;;
     
    13511879    esac
    13521880
     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
    13531890    specialdeplibs=
     1891
    13541892    libs=
    13551893    # Find all interdependent deplibs by searching for libraries
     
    13631901      libs="$libs $deplib"
    13641902    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
    13651922    deplibs=
    13661923    newdependency_libs=
     
    13771934          *)
    13781935            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
    1379             exit 1
     1936            exit $EXIT_FAILURE
    13801937            ;;
    13811938          esac
     
    13941951    esac
    13951952    for pass in $passes; do
    1396       if test $linkmode = prog; then
    1397         # Determine which files to process
     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
    13981959        case $pass in
    1399         dlopen)
    1400           libs="$dlfiles"
    1401           save_deplibs="$deplibs" # Collect dlpreopened libraries
    1402           deplibs=
    1403           ;;
     1960        dlopen) libs="$dlfiles" ;;
    14041961        dlpreopen) libs="$dlprefiles" ;;
    14051962        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
    14061963        esac
     1964      fi
     1965      if test "$pass" = dlopen; then
     1966        # Collect dlpreopened libraries
     1967        save_deplibs="$deplibs"
     1968        deplibs=
    14071969      fi
    14081970      for deplib in $libs; do
     
    14101972        found=no
    14111973        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          ;;
    14121983        -l*)
    1413           if test $linkmode = oldlib && test $linkmode = obj; then
    1414             $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
     1984          if test "$linkmode" != lib && test "$linkmode" != prog; then
     1985            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
    14151986            continue
    14161987          fi
    1417           if test $pass = conv; then
     1988          if test "$pass" = conv; then
    14181989            deplibs="$deplib $deplibs"
    14191990            continue
     
    14211992          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
    14221993          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
    1423             # Search the libtool library
    1424             lib="$searchdir/lib${name}.la"
    1425             if test -f "$lib"; then
    1426               found=yes
    1427               break
    1428             fi
     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
    14292006          done
    14302007          if test "$found" != yes; then
     
    14352012            else
    14362013              deplibs="$deplib $deplibs"
    1437               test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
     2014              test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
    14382015            fi
    14392016            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
    14402053          fi
    14412054          ;; # -l
     
    14442057          lib)
    14452058            deplibs="$deplib $deplibs"
    1446             test $pass = conv && continue
     2059            test "$pass" = conv && continue
    14472060            newdependency_libs="$deplib $newdependency_libs"
    14482061            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    14492062            ;;
    14502063          prog)
    1451             if test $pass = conv; then
     2064            if test "$pass" = conv; then
    14522065              deplibs="$deplib $deplibs"
    14532066              continue
    14542067            fi
    1455             if test $pass = scan; then
     2068            if test "$pass" = scan; then
    14562069              deplibs="$deplib $deplibs"
    1457               newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    14582070            else
    14592071              compile_deplibs="$deplib $compile_deplibs"
    14602072              finalize_deplibs="$deplib $finalize_deplibs"
    14612073            fi
     2074            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    14622075            ;;
    14632076          *)
    1464             $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
     2077            $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
    14652078            ;;
    14662079          esac # linkmode
     
    14682081          ;; # -L
    14692082        -R*)
    1470           if test $pass = link; then
     2083          if test "$pass" = link; then
    14712084            dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
    14722085            # Make sure the xrpath contains only unique directories.
     
    14812094        *.la) lib="$deplib" ;;
    14822095        *.$libext)
    1483           if test $pass = conv; then
     2096          if test "$pass" = conv; then
    14842097            deplibs="$deplib $deplibs"
    14852098            continue
     
    14872100          case $linkmode in
    14882101          lib)
    1489             if test "$deplibs_check_method" != pass_all; then
    1490               echo
    1491               echo "*** Warning: Trying to link with static lib archive $deplib."
    1492               echo "*** I have the capability to make that library automatically link in when"
    1493               echo "*** you link to this library.  But I can only do this if you have a"
    1494               echo "*** shared version of the library, which you do not appear to have"
    1495               echo "*** because the file extensions .$libext of this argument makes me believe"
    1496               echo "*** that it is just a static archive that I should not used here."
     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."
    14972125            else
    1498               echo
    1499               echo "*** Warning: Linking the shared library $output against the"
    1500               echo "*** static library $deplib is not portable!"
     2126              $echo
     2127              $echo "*** Warning: Linking the shared library $output against the"
     2128              $echo "*** static library $deplib is not portable!"
    15012129              deplibs="$deplib $deplibs"
    15022130            fi
     
    15042132            ;;
    15052133          prog)
    1506             if test $pass != link; then
     2134            if test "$pass" != link; then
    15072135              deplibs="$deplib $deplibs"
    15082136            else
     
    15152143          ;; # *.$libext
    15162144        *.lo | *.$objext)
    1517           if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
    1518             # If there is no dlopen support or we're linking statically,
    1519             # we need to preload.
    1520             newdlprefiles="$newdlprefiles $deplib"
    1521             compile_deplibs="$deplib $compile_deplibs"
    1522             finalize_deplibs="$deplib $finalize_deplibs"
    1523           else
    1524             newdlfiles="$newdlfiles $deplib"
     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
    15252157          fi
    15262158          continue
     
    15312163          ;;
    15322164        esac # case $deplib
    1533         if test $found = yes || test -f "$lib"; then :
     2165        if test "$found" = yes || test -f "$lib"; then :
    15342166        else
    15352167          $echo "$modename: cannot find the library \`$lib'" 1>&2
    1536           exit 1
     2168          exit $EXIT_FAILURE
    15372169        fi
    15382170
    15392171        # Check to see that this really is a libtool archive.
    1540         if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     2172        if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    15412173        else
    15422174          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    1543           exit 1
     2175          exit $EXIT_FAILURE
    15442176        fi
    15452177
     
    15542186        old_library=
    15552187        # If the library was installed with an old release of libtool,
    1556         # it will not redefine variable installed.
     2188        # it will not redefine variables installed, or shouldnotlink
    15572189        installed=yes
     2190        shouldnotlink=no
    15582191
    15592192        # Read the .la file
     
    15652198        if test "$linkmode,$pass" = "lib,link" ||
    15662199           test "$linkmode,$pass" = "prog,scan" ||
    1567            { test $linkmode = oldlib && test $linkmode = obj; }; then
    1568            # Add dl[pre]opened files of deplib
     2200           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
    15692201          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
    15702202          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
    15712203        fi
    15722204
    1573         if test $pass = conv; then
     2205        if test "$pass" = conv; then
    15742206          # Only check for convenience libraries
    15752207          deplibs="$lib $deplibs"
     
    15772209            if test -z "$old_library"; then
    15782210              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
    1579               exit 1
     2211              exit $EXIT_FAILURE
    15802212            fi
    15812213            # It is a libtool convenience library, so add in its objects.
     
    15922224              tmp_libs="$tmp_libs $deplib"
    15932225            done
    1594           elif test $linkmode != prog && test $linkmode != lib; then
     2226          elif test "$linkmode" != prog && test "$linkmode" != lib; then
    15952227            $echo "$modename: \`$lib' is not a convenience library" 1>&2
    1596             exit 1
     2228            exit $EXIT_FAILURE
    15972229          fi
    15982230          continue
    15992231        fi # $pass = conv
     2232
    16002233
    16012234        # Get the name of the library we link against.
     
    16062239        if test -z "$linklib"; then
    16072240          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
    1608           exit 1
     2241          exit $EXIT_FAILURE
    16092242        fi
    16102243
    16112244        # This library was specified with -dlopen.
    1612         if test $pass = dlopen; then
     2245        if test "$pass" = dlopen; then
    16132246          if test -z "$libdir"; then
    16142247            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
    1615             exit 1
    1616           fi
    1617           if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
     2248            exit $EXIT_FAILURE
     2249          fi
     2250          if test -z "$dlname" ||
     2251             test "$dlopen_support" != yes ||
     2252             test "$build_libtool_libs" = no; then
    16182253            # If there is no dlname, no dlopen support or we're linking
    1619             # statically, we need to preload.
    1620             dlprefiles="$dlprefiles $lib"
     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"
    16212258          else
    16222259            newdlfiles="$newdlfiles $lib"
     
    16512288          fi
    16522289        else
    1653           dir="$ladir/$objdir"
    1654           absdir="$abs_ladir/$objdir"
    1655           # Remove this search path later
    1656           notinst_path="$notinst_path $abs_ladir"
     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
    16572301        fi # $installed = yes
    16582302        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    16592303
    16602304        # This library was specified with -dlpreopen.
    1661         if test $pass = dlpreopen; then
     2305        if test "$pass" = dlpreopen; then
    16622306          if test -z "$libdir"; then
    16632307            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
    1664             exit 1
     2308            exit $EXIT_FAILURE
    16652309          fi
    16662310          # Prefer using a static library (so that no silly _DYNAMIC symbols
     
    16782322        if test -z "$libdir"; then
    16792323          # Link the convenience library
    1680           if test $linkmode = lib; then
     2324          if test "$linkmode" = lib; then
    16812325            deplibs="$dir/$old_library $deplibs"
    16822326          elif test "$linkmode,$pass" = "prog,link"; then
     
    16842328            finalize_deplibs="$dir/$old_library $finalize_deplibs"
    16852329          else
    1686             deplibs="$lib $deplibs"
     2330            deplibs="$lib $deplibs" # used for prog,scan pass
    16872331          fi
    16882332          continue
    16892333        fi
    16902334
    1691         if test $linkmode = prog && test $pass != link; then
     2335
     2336        if test "$linkmode" = prog && test "$pass" != link; then
    16922337          newlib_search_path="$newlib_search_path $ladir"
    16932338          deplibs="$lib $deplibs"
     
    17052350            esac
    17062351            # Need to link against all dependency_libs?
    1707             if test $linkalldeplibs = yes; then
     2352            if test "$linkalldeplibs" = yes; then
    17082353              deplibs="$deplib $deplibs"
    17092354            else
     
    17222367        fi # $linkmode = prog...
    17232368
    1724         link_static=no # Whether the deplib will be linked statically
    1725         if test -n "$library_names" &&
    1726            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
    1727           # Link against this shared library
    1728 
    1729           if test "$linkmode,$pass" = "prog,link" ||
    1730            { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
     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
    17312382            # Hardcode the library path.
    17322383            # Skip directories that are in the system default run-time
     
    17502401              ;;
    17512402            esac
    1752             if test $linkmode = prog; then
    1753               # We need to hardcode the library path
    1754               if test -n "$shlibpath_var"; then
    1755                 # Make sure the rpath contains only unique directories.
    1756                 case "$temp_rpath " in
    1757                 *" $dir "*) ;;
    1758                 *" $absdir "*) ;;
    1759                 *) temp_rpath="$temp_rpath $dir" ;;
    1760                 esac
    1761               fi
    1762             fi
    17632403          fi # $linkmode,$pass = prog,link...
    17642404
     
    17702410            continue
    17712411          fi
    1772 
     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
    17732417          if test "$installed" = no; then
    17742418            notinst_deplibs="$notinst_deplibs $lib"
    17752419            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
    17762457          fi
    17772458
     
    17882469              # bleh windows
    17892470              case $host in
    1790               *cygwin*)
     2471              *cygwin* | mingw*)
    17912472                major=`expr $current - $age`
    17922473                versuffix="-$major"
     
    18002481            # Make a new name for the extract_expsyms_cmds to use
    18012482            soroot="$soname"
    1802             soname=`echo $soroot | ${SED} -e 's/^.*\///'`
    1803             newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
     2483            soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
     2484            newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
    18042485
    18052486            # If the library has no export list, then create one now
     
    18082489              $show "extracting exported symbol list from \`$soname'"
    18092490              save_ifs="$IFS"; IFS='~'
    1810               eval cmds=\"$extract_expsyms_cmds\"
     2491              cmds=$extract_expsyms_cmds
    18112492              for cmd in $cmds; do
    18122493                IFS="$save_ifs"
     2494                eval cmd=\"$cmd\"
    18132495                $show "$cmd"
    18142496                $run eval "$cmd" || exit $?
     
    18212503              $show "generating import library for \`$soname'"
    18222504              save_ifs="$IFS"; IFS='~'
    1823               eval cmds=\"$old_archive_from_expsyms_cmds\"
     2505              cmds=$old_archive_from_expsyms_cmds
    18242506              for cmd in $cmds; do
    18252507                IFS="$save_ifs"
     2508                eval cmd=\"$cmd\"
    18262509                $show "$cmd"
    18272510                $run eval "$cmd" || exit $?
     
    18322515            dir=$output_objdir
    18332516            linklib=$newlib
    1834           fi # test -n $old_archive_from_expsyms_cmds
    1835 
    1836           if test $linkmode = prog || test "$mode" != relink; then
     2517          fi # test -n "$old_archive_from_expsyms_cmds"
     2518
     2519          if test "$linkmode" = prog || test "$mode" != relink; then
    18372520            add_shlibpath=
    18382521            add_dir=
     
    18432526              if test "$hardcode_direct" = no; then
    18442527                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
    18452544              elif test "$hardcode_minus_L" = no; then
    18462545                case $host in
     
    18612560              elif test "$hardcode_minus_L" = yes; then
    18622561                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
    18632570                add="-l$name"
    18642571              elif test "$hardcode_shlibpath_var" = yes; then
     
    18742581            if test "$lib_linked" != yes; then
    18752582              $echo "$modename: configuration error: unsupported hardcode properties"
    1876               exit 1
     2583              exit $EXIT_FAILURE
    18772584            fi
    18782585
     
    18832590              esac
    18842591            fi
    1885             if test $linkmode = prog; then
     2592            if test "$linkmode" = prog; then
    18862593              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
    18872594              test -n "$add" && compile_deplibs="$add $compile_deplibs"
     
    19002607          fi
    19012608
    1902           if test $linkmode = prog || test "$mode" = relink; then
     2609          if test "$linkmode" = prog || test "$mode" = relink; then
    19032610            add_shlibpath=
    19042611            add_dir=
     
    19082615              add="$libdir/$linklib"
    19092616            elif test "$hardcode_minus_L" = yes; then
    1910               # Try looking first in the location we're being installed to.
    1911               add_dir=
    1912               if test -n "$inst_prefix_dir"; then
    1913                 case "$libdir" in
    1914                 [\\/]*)
    1915                   add_dir="-L$inst_prefix_dir$libdir"
    1916                   ;;
    1917                 esac
    1918               fi
    1919               add_dir="$add_dir -L$libdir"
     2617              add_dir="-L$libdir"
    19202618              add="-l$name"
    19212619            elif test "$hardcode_shlibpath_var" = yes; then
     
    19252623              esac
    19262624              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
    19272632            else
    19282633              # We cannot seem to hardcode it, guess we'll fake it.
     2634              add_dir="-L$libdir"
    19292635              # Try looking first in the location we're being installed to.
    1930               add_dir=
    19312636              if test -n "$inst_prefix_dir"; then
    19322637                case "$libdir" in
    1933                 [\\/]*)
    1934                   add_dir="-L$inst_prefix_dir$libdir"
    1935                   ;;
     2638                  [\\/]*)
     2639                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
     2640                    ;;
    19362641                esac
    19372642              fi
    1938               add_dir="$add_dir -L$libdir"
    19392643              add="-l$name"
    19402644            fi
    19412645
    1942             if test $linkmode = prog; then
     2646            if test "$linkmode" = prog; then
    19432647              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
    19442648              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
     
    19482652            fi
    19492653          fi
    1950         elif test $linkmode = prog; then
    1951           if test "$alldeplibs" = yes &&
    1952              { test "$deplibs_check_method" = pass_all ||
    1953                { test "$build_libtool_libs" = yes &&
    1954                  test -n "$library_names"; }; }; then
    1955             # We only need to search for static libraries
    1956             continue
    1957           fi
    1958 
    1959           # Try to link the static library
     2654        elif test "$linkmode" = prog; then
    19602655          # Here we assume that one of hardcode_direct or hardcode_minus_L
    19612656          # is not unsupported.  This is valid on all known static and
     
    19772672            # Just print a warning and add the library to dependency_libs so
    19782673            # that the program can be linked against the static library.
    1979             echo
    1980             echo "*** Warning: This system can not link to static lib archive $lib."
    1981             echo "*** I have the capability to make that library automatically link in when"
    1982             echo "*** you link to this library.  But I can only do this if you have a"
    1983             echo "*** shared version of the library, which you do not appear to have."
     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."
    19842679            if test "$module" = yes; then
    1985               echo "*** But as you try to build a module library, libtool will still create "
    1986               echo "*** a static module, that should work as long as the dlopening application"
    1987               echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
     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."
    19882683              if test -z "$global_symbol_pipe"; then
    1989                 echo
    1990                 echo "*** However, this would only work if libtool was able to extract symbol"
    1991                 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    1992                 echo "*** not find such a program.  So, this module is probably useless."
    1993                 echo "*** \`nm' from GNU binutils and a full rebuild may help."
     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."
    19942689              fi
    19952690              if test "$build_old_libs" = no; then
     
    20082703        fi # link shared/static library?
    20092704
    2010         if test $linkmode = lib; then
     2705        if test "$linkmode" = lib; then
    20112706          if test -n "$dependency_libs" &&
    2012              { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
    2013                test $link_static = yes; }; then
     2707             { test "$hardcode_into_libs" != yes ||
     2708               test "$build_old_libs" = yes ||
     2709               test "$link_static" = yes; }; then
    20142710            # Extract -R from dependency_libs
    20152711            temp_deplibs=
     
    20422738          done
    20432739
    2044           if test $link_all_deplibs != no; then
     2740          if test "$link_all_deplibs" != no; then
    20452741            # Add the search paths of all dependency libraries
    20462742            for deplib in $dependency_libs; do
     
    20622758                esac
    20632759                if grep "^installed=no" $deplib > /dev/null; then
    2064                   path="-L$absdir/$objdir"
     2760                  path="$absdir/$objdir"
    20652761                else
    20662762                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
    20672763                  if test -z "$libdir"; then
    20682764                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
    2069                     exit 1
     2765                    exit $EXIT_FAILURE
    20702766                  fi
    20712767                  if test "$absdir" != "$libdir"; then
    20722768                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
    20732769                  fi
    2074                   path="-L$absdir"
     2770                  path="$absdir"
    20752771                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
    20762813                ;;
    20772814              *) continue ;;
     2815              esac
     2816              case " $deplibs " in
     2817              *" $depdepl "*) ;;
     2818              *) deplibs="$depdepl $deplibs" ;;
    20782819              esac
    20792820              case " $deplibs " in
     
    20852826        fi # linkmode = lib
    20862827      done # for deplib in $libs
    2087       if test $pass = dlpreopen; then
     2828      dependency_libs="$newdependency_libs"
     2829      if test "$pass" = dlpreopen; then
    20882830        # Link the dlpreopened libraries before other libraries
    20892831        for deplib in $save_deplibs; do
     
    20912833        done
    20922834      fi
    2093       if test $pass != dlopen; then
    2094         test $pass != scan && dependency_libs="$newdependency_libs"
    2095         if test $pass != conv; then
     2835      if test "$pass" != dlopen; then
     2836        if test "$pass" != conv; then
    20962837          # Make sure lib_search_path contains only unique directories.
    20972838          lib_search_path=
     
    21152856          new_libs=
    21162857          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:
    21172864            case $deplib in
    21182865            -L*) new_libs="$deplib $new_libs" ;;
     2866            -R*) ;;
    21192867            *)
     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.
    21202882              case " $specialdeplibs " in
    21212883              *" $deplib "*) new_libs="$deplib $new_libs" ;;
     
    21452907        done # for var
    21462908      fi
    2147       if test "$pass" = "conv" &&
    2148        { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
    2149         libs="$deplibs" # reset libs
    2150         deplibs=
    2151       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
    21522923    done # for pass
    2153     if test $linkmode = prog; then
     2924    if test "$linkmode" = prog; then
    21542925      dlfiles="$newdlfiles"
    21552926      dlprefiles="$newdlprefiles"
     
    21582929    case $linkmode in
    21592930    oldlib)
     2931      if test -n "$deplibs"; then
     2932        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
     2933      fi
     2934
    21602935      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    21612936        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
     
    21712946
    21722947      if test -n "$vinfo"; then
    2173         $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
     2948        $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
    21742949      fi
    21752950
     
    21932968      lib*)
    21942969        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
     2970        eval shared_ext=\"$shrext_cmds\"
    21952971        eval libname=\"$libname_spec\"
    21962972        ;;
     
    21992975          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
    22002976          $echo "$help" 1>&2
    2201           exit 1
     2977          exit $EXIT_FAILURE
    22022978        fi
    22032979        if test "$need_lib_prefix" != no; then
    22042980          # Add the "lib" prefix for modules if required
    22052981          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
     2982          eval shared_ext=\"$shrext_cmds\"
    22062983          eval libname=\"$libname_spec\"
    22072984        else
     
    22142991        if test "$deplibs_check_method" != pass_all; then
    22152992          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
    2216           exit 1
     2993          exit $EXIT_FAILURE
    22172994        else
    2218           echo
    2219           echo "*** Warning: Linking the shared library $output against the non-libtool"
    2220           echo "*** objects $objs is not portable!"
     2995          $echo
     2996          $echo "*** Warning: Linking the shared library $output against the non-libtool"
     2997          $echo "*** objects $objs is not portable!"
    22212998          libobjs="$libobjs $objs"
    22222999        fi
     
    22283005
    22293006      set dummy $rpath
    2230       if test $# -gt 2; then
     3007      if test "$#" -gt 2; then
    22313008        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
    22323009      fi
     
    22373014        if test "$build_libtool_libs" = yes; then
    22383015          # Building a libtool convenience library.
    2239           libext=al
     3016          # Some compilers have problems with a `.al' extension so
     3017          # convenience libraries should have the same extension an
     3018          # archive normally would.
    22403019          oldlibs="$output_objdir/$libname.$libext $oldlibs"
    22413020          build_libtool_libs=convenience
     
    22443023
    22453024        if test -n "$vinfo"; then
    2246           $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
     3025          $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
    22473026        fi
    22483027
     
    22603039          $echo "$modename: too many parameters to \`-version-info'" 1>&2
    22613040          $echo "$help" 1>&2
    2262           exit 1
    2263         fi
    2264 
    2265         current="$2"
    2266         revision="$3"
    2267         age="$4"
     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
    22683084
    22693085        # Check that each of the things are valid numbers.
    22703086        case $current in
    2271         [0-9]*) ;;
     3087        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    22723088        *)
    22733089          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    22743090          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    2275           exit 1
     3091          exit $EXIT_FAILURE
    22763092          ;;
    22773093        esac
    22783094
    22793095        case $revision in
    2280         [0-9]*) ;;
     3096        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    22813097        *)
    22823098          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    22833099          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    2284           exit 1
     3100          exit $EXIT_FAILURE
    22853101          ;;
    22863102        esac
    22873103
    22883104        case $age in
    2289         [0-9]*) ;;
     3105        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    22903106        *)
    22913107          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    22923108          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    2293           exit 1
     3109          exit $EXIT_FAILURE
    22943110          ;;
    22953111        esac
    22963112
    2297         if test $age -gt $current; then
     3113        if test "$age" -gt "$current"; then
    22983114          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    22993115          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    2300           exit 1
     3116          exit $EXIT_FAILURE
    23013117        fi
    23023118
     
    23153131          # Darwin ld doesn't like 0 for these options...
    23163132          minor_current=`expr $current + 1`
    2317           verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
     3133          verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
    23183134          ;;
    23193135
     
    23393155          # Add in all the interfaces that we are compatible with.
    23403156          loop=$revision
    2341           while test $loop != 0; do
     3157          while test "$loop" -ne 0; do
    23423158            iface=`expr $revision - $loop`
    23433159            loop=`expr $loop - 1`
     
    23623178          # Add in all the interfaces that we are compatible with.
    23633179          loop=$age
    2364           while test $loop != 0; do
     3180          while test "$loop" -ne 0; do
    23653181            iface=`expr $current - $loop`
    23663182            loop=`expr $loop - 1`
     
    23863202        *)
    23873203          $echo "$modename: unknown library version type \`$version_type'" 1>&2
    2388           echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    2389           exit 1
     3204          $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
     3205          exit $EXIT_FAILURE
    23903206          ;;
    23913207        esac
     
    23943210        if test -z "$vinfo" && test -n "$release"; then
    23953211          major=
    2396           verstring="0.0"
    23973212          case $version_type in
    23983213          darwin)
    23993214            # we can't check for "0.0" in archive_cmds due to quoting
    24003215            # problems, so we reset it completely
    2401             verstring=""
     3216            verstring=
    24023217            ;;
    24033218          *)
     
    24333248
    24343249      if test "$mode" != relink; then
    2435         # Remove our outputs.
    2436         $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
    2437         $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
     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
    24383274      fi
    24393275
     
    24483284      # Eliminate all temporary directories.
    24493285      for path in $notinst_path; do
    2450         lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
    2451         deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
    2452         dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
     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'`
    24533289      done
    24543290
     
    24633299          esac
    24643300        done
    2465         if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
     3301        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
    24663302          dependency_libs="$temp_xrpath $dependency_libs"
    24673303        fi
     
    25033339          *-*-openbsd* | *-*-freebsd*)
    25043340            # Do not include libc due to us having libc/libc_r.
     3341            test "X$arg" = "X-lc" && continue
    25053342            ;;
    2506           *)
     3343          *)
    25073344            # Add libc to deplibs on all other systems if necessary.
    2508             if test $build_libtool_need_lc = "yes"; then
     3345            if test "$build_libtool_need_lc" = "yes"; then
    25093346              deplibs="$deplibs -lc"
    25103347            fi
     
    25333370          # whether the library exists or not.  But this is on
    25343371          # osf3 & osf4 and I'm not really sure... Just
    2535           # implementing what was already the behaviour.
     3372          # implementing what was already the behavior.
    25363373          newdeplibs=$deplibs
    25373374          ;;
     
    25463383EOF
    25473384          $rm conftest
    2548           $CC -o conftest conftest.c $deplibs
    2549           if test $? -eq 0 ; then
     3385          $LTCC -o conftest conftest.c $deplibs
     3386          if test "$?" -eq 0 ; then
    25503387            ldd_output=`ldd conftest`
    25513388            for i in $deplibs; do
    25523389              name="`expr $i : '-l\(.*\)'`"
    25533390              # If $name is empty we are operating on a -L argument.
    2554               if test -n "$name" && test "$name" != "0"; then
    2555                 libname=`eval \\$echo \"$libname_spec\"`
    2556                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
    2557                 set dummy $deplib_matches
    2558                 deplib_match=$2
    2559                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    2560                   newdeplibs="$newdeplibs $i"
    2561                 else
    2562                   droppeddeps=yes
    2563                   echo
    2564                   echo "*** Warning: dynamic linker does not accept needed library $i."
    2565                   echo "*** I have the capability to make that library automatically link in when"
    2566                   echo "*** you link to this library.  But I can only do this if you have a"
    2567                   echo "*** shared version of the library, which I believe you do not have"
    2568                   echo "*** because a test_compile did reveal that the linker did not use it for"
    2569                   echo "*** its dynamic dependency list that programs get resolved with at runtime."
    2570                 fi
    2571               else
    2572                 newdeplibs="$newdeplibs $i"
    2573               fi
    2574             done
    2575           else
    2576             # Error occured in the first compile.  Let's try to salvage
    2577             # the situation: Compile a separate program for each library.
    2578             for i in $deplibs; do
    2579               name="`expr $i : '-l\(.*\)'`"
    2580              # If $name is empty we are operating on a -L argument.
    2581               if test -n "$name" && test "$name" != "0"; then
    2582                 $rm conftest
    2583                 $CC -o conftest conftest.c $i
    2584                 # Did it work?
    2585                 if test $? -eq 0 ; then
    2586                   ldd_output=`ldd conftest`
     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
    25873401                  libname=`eval \\$echo \"$libname_spec\"`
    25883402                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
     
    25933407                  else
    25943408                    droppeddeps=yes
    2595                     echo
    2596                     echo "*** Warning: dynamic linker does not accept needed library $i."
    2597                     echo "*** I have the capability to make that library automatically link in when"
    2598                     echo "*** you link to this library.  But I can only do this if you have a"
    2599                     echo "*** shared version of the library, which you do not appear to have"
    2600                     echo "*** because a test_compile did reveal that the linker did not use this one"
    2601                     echo "*** as a dynamic dependency that programs can get resolved with at runtime."
     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
    26023459                  fi
    26033460                else
    26043461                  droppeddeps=yes
    2605                   echo
    2606                   echo "*** Warning!  Library $i is needed by this library but I was not able to"
    2607                   echo "***  make it link in!  You will probably need to install it or some"
    2608                   echo "*** library that it depends on before this library will be fully"
    2609                   echo "*** functional.  Installing it before continuing would be even better."
     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."
    26103467                fi
    26113468              else
     
    26213478            name="`expr $a_deplib : '-l\(.*\)'`"
    26223479            # If $name is empty we are operating on a -L argument.
    2623             if test -n "$name" && test "$name" != "0"; then
    2624               libname=`eval \\$echo \"$libname_spec\"`
    2625               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    2626                     potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    2627                     for potent_lib in $potential_libs; do
     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
    26283494                      # Follow soft links.
    26293495                      if ls -lLd "$potent_lib" 2>/dev/null \
     
    26463512                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
    26473513                         | ${SED} 10q \
    2648                          | egrep "$file_magic_regex" > /dev/null; then
     3514                         | $EGREP "$file_magic_regex" > /dev/null; then
    26493515                        newdeplibs="$newdeplibs $a_deplib"
    26503516                        a_deplib=""
    26513517                        break 2
    26523518                      fi
    2653                     done
    2654               done
     3519                  done
     3520                done
     3521              fi
    26553522              if test -n "$a_deplib" ; then
    26563523                droppeddeps=yes
    2657                 echo
    2658                 echo "*** Warning: linker path does not have real file for library $a_deplib."
    2659                 echo "*** I have the capability to make that library automatically link in when"
    2660                 echo "*** you link to this library.  But I can only do this if you have a"
    2661                 echo "*** shared version of the library, which you do not appear to have"
    2662                 echo "*** because I did check the linker path looking for a file starting"
     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"
    26633530                if test -z "$potlib" ; then
    2664                   echo "*** with $libname but no candidates were found. (...for file magic test)"
     3531                  $echo "*** with $libname but no candidates were found. (...for file magic test)"
    26653532                else
    2666                   echo "*** with $libname and none of the candidates passed a file format test"
    2667                   echo "*** using a file magic. Last file checked: $potlib"
     3533                  $echo "*** with $libname and none of the candidates passed a file format test"
     3534                  $echo "*** using a file magic. Last file checked: $potlib"
    26683535                fi
    26693536              fi
     
    26813548            # If $name is empty we are operating on a -L argument.
    26823549            if test -n "$name" && test "$name" != "0"; then
    2683               libname=`eval \\$echo \"$libname_spec\"`
    2684               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    2685                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    2686                 for potent_lib in $potential_libs; do
    2687                   potlib="$potent_lib" # see symlink-check below in file_magic test
    2688                   if eval echo \"$potent_lib\" 2>/dev/null \
    2689                       | ${SED} 10q \
    2690                       | egrep "$match_pattern_regex" > /dev/null; then
    2691                     newdeplibs="$newdeplibs $a_deplib"
    2692                     a_deplib=""
    2693                     break 2
    2694                   fi
     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
    26953572                done
    2696               done
     3573              fi
    26973574              if test -n "$a_deplib" ; then
    26983575                droppeddeps=yes
    2699                 echo
    2700                 echo "*** Warning: linker path does not have real file for library $a_deplib."
    2701                 echo "*** I have the capability to make that library automatically link in when"
    2702                 echo "*** you link to this library.  But I can only do this if you have a"
    2703                 echo "*** shared version of the library, which you do not appear to have"
    2704                 echo "*** because I did check the linker path looking for a file starting"
     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"
    27053582                if test -z "$potlib" ; then
    2706                   echo "*** with $libname but no candidates were found. (...for regex pattern test)"
     3583                  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
    27073584                else
    2708                   echo "*** with $libname and none of the candidates passed a file format test"
    2709                   echo "*** using a regex pattern. Last file checked: $potlib"
     3585                  $echo "*** with $libname and none of the candidates passed a file format test"
     3586                  $echo "*** using a regex pattern. Last file checked: $potlib"
    27103587                fi
    27113588              fi
     
    27183595        none | unknown | *)
    27193596          newdeplibs=""
    2720           if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
    2721                -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
    2722              grep . >/dev/null; then
    2723             echo
     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
    27243608            if test "X$deplibs_check_method" = "Xnone"; then
    2725               echo "*** Warning: inter-library dependencies are not supported in this platform."
     3609              $echo "*** Warning: inter-library dependencies are not supported in this platform."
    27263610            else
    2727               echo "*** Warning: inter-library dependencies are not known to be supported."
     3611              $echo "*** Warning: inter-library dependencies are not known to be supported."
    27283612            fi
    2729             echo "*** All declared inter-library dependencies are being dropped."
     3613            $echo "*** All declared inter-library dependencies are being dropped."
    27303614            droppeddeps=yes
    27313615          fi
     
    27473631        if test "$droppeddeps" = yes; then
    27483632          if test "$module" = yes; then
    2749             echo
    2750             echo "*** Warning: libtool could not satisfy all declared inter-library"
    2751             echo "*** dependencies of module $libname.  Therefore, libtool will create"
    2752             echo "*** a static module, that should work as long as the dlopening"
    2753             echo "*** application is linked with the -dlopen flag."
     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."
    27543638            if test -z "$global_symbol_pipe"; then
    2755               echo
    2756               echo "*** However, this would only work if libtool was able to extract symbol"
    2757               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    2758               echo "*** not find such a program.  So, this module is probably useless."
    2759               echo "*** \`nm' from GNU binutils and a full rebuild may help."
     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."
    27603644            fi
    27613645            if test "$build_old_libs" = no; then
     
    27673651            fi
    27683652          else
    2769             echo "*** The inter-library dependencies that have been dropped here will be"
    2770             echo "*** automatically added whenever a program is linked with this library"
    2771             echo "*** or is declared to -dlopen it."
    2772 
    2773             if test $allow_undefined = no; then
    2774               echo
    2775               echo "*** Since this library must not contain undefined symbols,"
    2776               echo "*** because either the platform does not support them or"
    2777               echo "*** it was explicitly requested with -no-undefined,"
    2778               echo "*** libtool will only create a static version of it."
     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."
    27793663              if test "$build_old_libs" = no; then
    27803664                oldlibs="$output_objdir/$libname.$libext"
     
    27983682      # Test again, we may have decided not to build it any more
    27993683      if test "$build_libtool_libs" = yes; then
    2800         if test $hardcode_into_libs = yes; then
     3684        if test "$hardcode_into_libs" = yes; then
    28013685          # Hardcode the library paths
    28023686          hardcode_libdirs=
     
    28343718             test -n "$hardcode_libdirs"; then
    28353719            libdir="$hardcode_libdirs"
    2836             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
     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
    28373725          fi
    28383726          if test -n "$runpath_var" && test -n "$perm_rpath"; then
     
    28543742
    28553743        # Get the real and link names of the library.
     3744        eval shared_ext=\"$shrext_cmds\"
    28563745        eval library_names=\"$library_names_spec\"
    28573746        set dummy $library_names
     
    28643753          soname="$realname"
    28653754        fi
    2866         test -z "$dlname" && dlname=$soname
     3755        if test -z "$dlname"; then
     3756          dlname=$soname
     3757        fi
    28673758
    28683759        lib="$output_objdir/$realname"
     
    28703761        do
    28713762          linknames="$linknames $link"
    2872         done
    2873 
    2874         # Ensure that we have .o objects for linkers which dislike .lo
    2875         # (e.g. aix) in case we are running --disable-static
    2876         for obj in $libobjs; do
    2877           xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
    2878           if test "X$xdir" = "X$obj"; then
    2879             xdir="."
    2880           else
    2881             xdir="$xdir"
    2882           fi
    2883           baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
    2884           oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
    2885           if test ! -f $xdir/$oldobj; then
    2886             $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
    2887             $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
    2888           fi
    28893763        done
    28903764
     
    28983772            export_symbols="$output_objdir/$libname.exp"
    28993773            $run $rm $export_symbols
    2900             eval cmds=\"$export_symbols_cmds\"
     3774            cmds=$export_symbols_cmds
    29013775            save_ifs="$IFS"; IFS='~'
    29023776            for cmd in $cmds; do
    29033777              IFS="$save_ifs"
    2904               $show "$cmd"
    2905               $run eval "$cmd" || exit $?
     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
    29063789            done
    29073790            IFS="$save_ifs"
    29083791            if test -n "$export_symbols_regex"; then
    2909               $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
    2910               $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
     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"'
    29113794              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
    29123795              $run eval '$mv "${export_symbols}T" "$export_symbols"'
     
    29193802        fi
    29203803
     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
    29213815        if test -n "$convenience"; then
    29223816          if test -n "$whole_archive_flag_spec"; then
     3817            save_libobjs=$libobjs
    29233818            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    29243819          else
    29253820            gentop="$output_objdir/${outputname}x"
    2926             $show "${rm}r $gentop"
    2927             $run ${rm}r "$gentop"
    2928             $show "mkdir $gentop"
    2929             $run mkdir "$gentop"
    2930             status=$?
    2931             if test $status -ne 0 && test ! -d "$gentop"; then
    2932               exit $status
    2933             fi
    29343821            generated="$generated $gentop"
    29353822
    2936             for xlib in $convenience; do
    2937               # Extract the objects.
    2938               case $xlib in
    2939               [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    2940               *) xabs=`pwd`"/$xlib" ;;
    2941               esac
    2942               xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    2943               xdir="$gentop/$xlib"
    2944 
    2945               $show "${rm}r $xdir"
    2946               $run ${rm}r "$xdir"
    2947               $show "mkdir $xdir"
    2948               $run mkdir "$xdir"
    2949               status=$?
    2950               if test $status -ne 0 && test ! -d "$xdir"; then
    2951                 exit $status
    2952               fi
    2953               $show "(cd $xdir && $AR x $xabs)"
    2954               $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    2955 
    2956               libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
    2957             done
    2958           fi
    2959         fi
    2960 
     3823            func_extract_archives $gentop $convenience
     3824            libobjs="$libobjs $func_extract_archives_result"
     3825          fi
     3826        fi
     3827       
    29613828        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
    29623829          eval flag=\"$thread_safe_flag_spec\"
     
    29703837
    29713838        # 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
    29723848        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    2973           eval cmds=\"$archive_expsym_cmds\"
     3849          eval test_cmds=\"$archive_expsym_cmds\"
     3850          cmds=$archive_expsym_cmds
    29743851        else
    2975           save_deplibs="$deplibs"
    2976           for conv in $convenience; do
    2977             tmp_deplibs=
    2978             for test_deplib in $deplibs; do
    2979               if test "$test_deplib" != "$conv"; then
    2980                 tmp_deplibs="$tmp_deplibs $test_deplib"
     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\"
    29813904              fi
    2982             done
    2983             deplibs="$tmp_deplibs"
     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
    29843911          done
    2985           eval cmds=\"$archive_cmds\"
    2986           deplibs="$save_deplibs"
     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\"
    29873975        fi
    29883976        save_ifs="$IFS"; IFS='~'
    29893977        for cmd in $cmds; do
    29903978          IFS="$save_ifs"
     3979          eval cmd=\"$cmd\"
    29913980          $show "$cmd"
    29923981          $run eval "$cmd" || exit $?
     
    29973986        if test "$mode" = relink; then
    29983987          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
    2999           exit 0
     3988          exit $EXIT_SUCCESS
    30003989        fi
    30013990
     
    30454034        if test -n "$objs$old_deplibs"; then
    30464035          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
    3047           exit 1
     4036          exit $EXIT_FAILURE
    30484037        fi
    30494038        libobj="$output"
     
    30744063        else
    30754064          gentop="$output_objdir/${obj}x"
    3076           $show "${rm}r $gentop"
    3077           $run ${rm}r "$gentop"
    3078           $show "mkdir $gentop"
    3079           $run mkdir "$gentop"
    3080           status=$?
    3081           if test $status -ne 0 && test ! -d "$gentop"; then
    3082             exit $status
    3083           fi
    30844065          generated="$generated $gentop"
    30854066
    3086           for xlib in $convenience; do
    3087             # Extract the objects.
    3088             case $xlib in
    3089             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    3090             *) xabs=`pwd`"/$xlib" ;;
    3091             esac
    3092             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    3093             xdir="$gentop/$xlib"
    3094 
    3095             $show "${rm}r $xdir"
    3096             $run ${rm}r "$xdir"
    3097             $show "mkdir $xdir"
    3098             $run mkdir "$xdir"
    3099             status=$?
    3100             if test $status -ne 0 && test ! -d "$xdir"; then
    3101               exit $status
    3102             fi
    3103             $show "(cd $xdir && $AR x $xabs)"
    3104             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    3105 
    3106             reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
    3107           done
     4067          func_extract_archives $gentop $convenience
     4068          reload_conv_objs="$reload_objs $func_extract_archives_result"
    31084069        fi
    31094070      fi
     
    31134074
    31144075      output="$obj"
    3115       eval cmds=\"$reload_cmds\"
     4076      cmds=$reload_cmds
    31164077      save_ifs="$IFS"; IFS='~'
    31174078      for cmd in $cmds; do
    31184079        IFS="$save_ifs"
     4080        eval cmd=\"$cmd\"
    31194081        $show "$cmd"
    31204082        $run eval "$cmd" || exit $?
     
    31294091        fi
    31304092
    3131         exit 0
     4093        exit $EXIT_SUCCESS
    31324094      fi
    31334095
     
    31404102        # Create an invalid libtool object if no PIC, so that we don't
    31414103        # accidentally link it into a program.
    3142         $show "echo timestamp > $libobj"
    3143         $run eval "echo timestamp > $libobj" || exit $?
    3144         exit 0
     4104        # $show "echo timestamp > $libobj"
     4105        # $run eval "echo timestamp > $libobj" || exit $?
     4106        exit $EXIT_SUCCESS
    31454107      fi
    31464108
     
    31494111        reload_objs="$libobjs $reload_conv_objs"
    31504112        output="$libobj"
    3151         eval cmds=\"$reload_cmds\"
     4113        cmds=$reload_cmds
    31524114        save_ifs="$IFS"; IFS='~'
    31534115        for cmd in $cmds; do
    31544116          IFS="$save_ifs"
     4117          eval cmd=\"$cmd\"
    31554118          $show "$cmd"
    31564119          $run eval "$cmd" || exit $?
    31574120        done
    31584121        IFS="$save_ifs"
    3159       else
    3160         # Just create a symlink.
    3161         $show $rm $libobj
    3162         $run $rm $libobj
    3163         xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
    3164         if test "X$xdir" = "X$libobj"; then
    3165           xdir="."
    3166         else
    3167           xdir="$xdir"
    3168         fi
    3169         baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
    3170         oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
    3171         $show "(cd $xdir && $LN_S $oldobj $baseobj)"
    3172         $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
    31734122      fi
    31744123
     
    31784127      fi
    31794128
    3180       exit 0
     4129      exit $EXIT_SUCCESS
    31814130      ;;
    31824131
    31834132    prog)
    31844133      case $host in
    3185         *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
     4134        *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
    31864135      esac
    31874136      if test -n "$vinfo"; then
     
    32054154        compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
    32064155        finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
    3207         case $host in
    3208         *darwin*)
    3209           # Don't allow lazy linking, it breaks C++ global constructors
    3210           compile_command="$compile_command ${wl}-bind_at_load"
    3211           finalize_command="$finalize_command ${wl}-bind_at_load"
    3212           ;;
    3213         esac
    3214         ;;
     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        ;;
    32154167      esac
    32164168
     
    33654317
    33664318            if test -n "$exclude_expsyms"; then
    3367               $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
     4319              $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
    33684320              $run eval '$mv "$nlist"T "$nlist"'
    33694321            fi
    33704322
    33714323            if test -n "$export_symbols_regex"; then
    3372               $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
     4324              $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
    33734325              $run eval '$mv "$nlist"T "$nlist"'
    33744326            fi
     
    33884340          for arg in $dlprefiles; do
    33894341            $show "extracting global C symbols from \`$arg'"
    3390             name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
    3391             $run eval 'echo ": $name " >> "$nlist"'
     4342            name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
     4343            $run eval '$echo ": $name " >> "$nlist"'
    33924344            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    33934345          done
     
    33984350
    33994351            if test -n "$exclude_expsyms"; then
    3400               egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
     4352              $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
    34014353              $mv "$nlist"T "$nlist"
    34024354            fi
     
    34184370              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
    34194371            else
    3420               echo '/* NONE */' >> "$output_objdir/$dlsyms"
     4372              $echo '/* NONE */' >> "$output_objdir/$dlsyms"
    34214373            fi
    34224374
     
    34704422            case "$compile_command " in
    34714423            *" -static "*) ;;
    3472             *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
     4424            *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
    34734425            esac;;
    34744426          *-*-hpux*)
    34754427            case "$compile_command " in
    34764428            *" -static "*) ;;
    3477             *) pic_flag_for_symtable=" $pic_flag -DPIC";;
     4429            *) pic_flag_for_symtable=" $pic_flag";;
    34784430            esac
    34794431          esac
    34804432
    34814433          # Now compile the dynamic symbol file.
    3482           $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
    3483           $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
     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 $?
    34844436
    34854437          # Clean up the generated files.
     
    34934445        *)
    34944446          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
    3495           exit 1
     4447          exit $EXIT_FAILURE
    34964448          ;;
    34974449        esac
     
    35064458      fi
    35074459
    3508       if test $need_relink = no || test "$build_libtool_libs" != yes; then
     4460      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
    35094461        # Replace the output file specification.
    35104462        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
     
    35814533        $show "$link_command"
    35824534        $run eval "$link_command" || exit $?
    3583         exit 0
     4535        exit $EXIT_SUCCESS
    35844536      fi
    35854537
     
    36364588
    36374589      # Quote $echo for shipping.
    3638       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
    3639         case $0 in
    3640         [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
    3641         *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
     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";;
    36424594        esac
    36434595        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
     
    36514603        # a .exe suffix, so we strip it off here.
    36524604        case $output in
    3653           *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
     4605          *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
    36544606        esac
    36554607        # test for cygwin because mv fails w/o .exe extensions
    36564608        case $host in
    3657           *cygwin*) exeext=.exe ;;
     4609          *cygwin*)
     4610            exeext=.exe
     4611            outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
    36584612          *) exeext= ;;
    36594613        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*/
     4636EOF
     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
     4677const char *program_name = NULL;
     4678
     4679void * xmalloc (size_t num);
     4680char * xstrdup (const char *string);
     4681char * basename (const char *name);
     4682char * fnqualify(const char *path);
     4683char * strendzap(char *str, const char *pat);
     4684void lt_fatal (const char *message, ...);
     4685
     4686int
     4687main (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);
     4694EOF
     4695
     4696            cat >> $cwrappersource <<EOF
     4697  newargz[0] = "$SHELL";
     4698EOF
     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;
     4708EOF
     4709
     4710            cat >> $cwrappersource <<EOF
     4711  execv("$SHELL",newargz);
     4712EOF
     4713
     4714            cat >> $cwrappersource <<"EOF"
     4715}
     4716
     4717void *
     4718xmalloc (size_t num)
     4719{
     4720  void * p = (void *) malloc (num);
     4721  if (!p)
     4722    lt_fatal ("Memory exhausted");
     4723
     4724  return p;
     4725}
     4726
     4727char *
     4728xstrdup (const char *string)
     4729{
     4730  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
     4731;
     4732}
     4733
     4734char *
     4735basename (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
     4751char *
     4752fnqualify(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
     4778char *
     4779strendzap(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
     4798static void
     4799lt_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
     4810void
     4811lt_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}
     4818EOF
     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
    36604827        $rm $output
    3661         trap "$rm $output; exit 1" 1 2 15
     4828        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
    36624829
    36634830        $echo > $output "\
     
    36754842# Sed substitution that helps us do robust quoting.  It backslashifies
    36764843# metacharacters that are still active within double-quoted strings.
    3677 Xsed="${SED}"' -e 1s/^X//'
     4844Xsed='${SED} -e 1s/^X//'
    36784845sed_quote_subst='$sed_quote_subst'
    36794846
    36804847# The HP-UX ksh and POSIX shell print the target directory to stdout
    36814848# if CDPATH is set.
    3682 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
     4849(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
    36834850
    36844851relink_command=\"$relink_command\"
     
    37354902
    37364903        if test "$fast_install" = yes; then
    3737           echo >> $output "\
     4904          $echo >> $output "\
    37384905  program=lt-'$outputname'$exeext
    37394906  progdir=\"\$thisdir/$objdir\"
     
    37514918    fi"
    37524919
    3753           echo >> $output "\
     4920          $echo >> $output "\
    37544921
    37554922    # relink executable if necessary
     
    37594926        $echo \"\$relink_command_output\" >&2
    37604927        $rm \"\$progdir/\$file\"
    3761         exit 1
     4928        exit $EXIT_FAILURE
    37624929      fi
    37634930    fi
     
    37694936  fi"
    37704937        else
    3771           echo >> $output "\
     4938          $echo >> $output "\
    37724939  program='$outputname'
    37734940  progdir=\"\$thisdir/$objdir\"
     
    37754942        fi
    37764943
    3777         echo >> $output "\
     4944        $echo >> $output "\
    37784945
    37794946  if test -f \"\$progdir/\$program\"; then"
     
    37864953
    37874954    # Some systems cannot cope with colon-terminated $shlibpath_var
    3788     # The second colon is a workaround for a bug in BeOS R4 ${SED}
     4955    # The second colon is a workaround for a bug in BeOS R4 sed
    37894956    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
    37904957
     
    38064973"
    38074974        case $host in
    3808         # win32 systems need to use the prog path for dll
    3809         # lookup to work
    3810         *-*-cygwin* | *-*-pw32*)
    3811           $echo >> $output "\
    3812       exec \$progdir/\$program \${1+\"\$@\"}
    3813 "
    3814           ;;
    3815 
    38164975        # Backslashes separate directories on plain windows
    38174976        *-*-mingw | *-*-os2*)
     
    38234982        *)
    38244983          $echo >> $output "\
    3825       # Export the path to the program.
    3826       PATH=\"\$progdir:\$PATH\"
    3827       export PATH
    3828 
    3829       exec \$program \${1+\"\$@\"}
     4984      exec \$progdir/\$program \${1+\"\$@\"}
    38304985"
    38314986          ;;
     
    38334988        $echo >> $output "\
    38344989      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
    3835       exit 1
     4990      exit $EXIT_FAILURE
    38364991    fi
    38374992  else
     
    38394994    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
    38404995    \$echo \"This script is just a wrapper for \$program.\" 1>&2
    3841     echo \"See the $PACKAGE documentation for more information.\" 1>&2
    3842     exit 1
     4996    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
     4997    exit $EXIT_FAILURE
    38434998  fi
    38444999fi\
     
    38465001        chmod +x $output
    38475002      fi
    3848       exit 0
     5003      exit $EXIT_SUCCESS
    38495004      ;;
    38505005    esac
     
    38625017          build_libtool_libs=no
    38635018        else
    3864           oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
     5019          oldobjs="$old_deplibs $non_pic_objects"
    38655020        fi
    38665021        addlibs="$old_convenience"
     
    38695024      if test -n "$addlibs"; then
    38705025        gentop="$output_objdir/${outputname}x"
    3871         $show "${rm}r $gentop"
    3872         $run ${rm}r "$gentop"
    3873         $show "mkdir $gentop"
    3874         $run mkdir "$gentop"
    3875         status=$?
    3876         if test $status -ne 0 && test ! -d "$gentop"; then
    3877           exit $status
    3878         fi
    38795026        generated="$generated $gentop"
    38805027
    3881         # Add in members from convenience archives.
    3882         for xlib in $addlibs; do
    3883           # Extract the objects.
    3884           case $xlib in
    3885           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    3886           *) xabs=`pwd`"/$xlib" ;;
    3887           esac
    3888           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
    3889           xdir="$gentop/$xlib"
    3890 
    3891           $show "${rm}r $xdir"
    3892           $run ${rm}r "$xdir"
    3893           $show "mkdir $xdir"
    3894           $run mkdir "$xdir"
    3895           status=$?
    3896           if test $status -ne 0 && test ! -d "$xdir"; then
    3897             exit $status
    3898           fi
    3899           $show "(cd $xdir && $AR x $xabs)"
    3900           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
    3901 
    3902           oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
    3903         done
     5028        func_extract_archives $gentop $addlibs
     5029        oldobjs="$oldobjs $func_extract_archives_result"
    39045030      fi
    39055031
    39065032      # Do each command in the archive commands.
    39075033      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
    3908         eval cmds=\"$old_archive_from_new_cmds\"
     5034       cmds=$old_archive_from_new_cmds
    39095035      else
    3910         # Ensure that we have .o objects in place in case we decided
    3911         # not to build a shared library, and have fallen back to building
    3912         # static libs even though --disable-static was passed!
    3913         for oldobj in $oldobjs; do
    3914           if test ! -f $oldobj; then
    3915             xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
    3916             if test "X$xdir" = "X$oldobj"; then
    3917               xdir="."
     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              :
    39185076            else
    3919               xdir="$xdir"
     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=
    39205085            fi
    3921             baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
    3922             obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
    3923             $show "(cd $xdir && ${LN_S} $obj $baseobj)"
    3924             $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
    3925           fi
    3926         done
    3927 
    3928         eval cmds=\"$old_archive_cmds\"
     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
    39295095      fi
    39305096      save_ifs="$IFS"; IFS='~'
    39315097      for cmd in $cmds; do
     5098        eval cmd=\"$cmd\"
    39325099        IFS="$save_ifs"
    39335100        $show "$cmd"
     
    39615128      done
    39625129      # Quote the link command for shipping.
    3963       relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
     5130      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
    39645131      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
     5132      if test "$hardcode_automatic" = yes ; then
     5133        relink_command=
     5134      fi
     5135
    39655136
    39665137      # Only create the output if not a dry run.
     
    39815152                if test -z "$libdir"; then
    39825153                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
    3983                   exit 1
     5154                  exit $EXIT_FAILURE
    39845155                fi
    39855156                newdependency_libs="$newdependency_libs $libdir/$name"
     
    39955166              if test -z "$libdir"; then
    39965167                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    3997                 exit 1
     5168                exit $EXIT_FAILURE
    39985169              fi
    39995170              newdlfiles="$newdlfiles $libdir/$name"
     
    40065177              if test -z "$libdir"; then
    40075178                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    4008                 exit 1
     5179                exit $EXIT_FAILURE
    40095180              fi
    40105181              newdlprefiles="$newdlprefiles $libdir/$name"
    40115182            done
    40125183            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"
    40135203          fi
    40145204          $rm $output
     
    40165206          tdlname=$dlname
    40175207          case $host,$output,$installed,$module,$dlname in
    4018             *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
     5208            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
    40195209          esac
    40205210          $echo > $output "\
     
    40455235installed=$installed
    40465236
     5237# Should we warn about portability when linking against -modules?
     5238shouldnotlink=$module
     5239
    40475240# Files to dlopen/dlpreopen
    40485241dlopen='$dlfiles'
     
    40515244# Directory that this library needs to be installed in:
    40525245libdir='$install_libdir'"
    4053           if test "$installed" = no && test $need_relink = yes; then
     5246          if test "$installed" = no && test "$need_relink" = yes; then
    40545247            $echo >> $output "\
    40555248relink_command=\"$relink_command\""
     
    40645257      ;;
    40655258    esac
    4066     exit 0
     5259    exit $EXIT_SUCCESS
    40675260    ;;
    40685261
     
    41535346      $echo "$modename: you must specify an install program" 1>&2
    41545347      $echo "$help" 1>&2
    4155       exit 1
     5348      exit $EXIT_FAILURE
    41565349    fi
    41575350
     
    41595352      $echo "$modename: the \`$prev' option requires an argument" 1>&2
    41605353      $echo "$help" 1>&2
    4161       exit 1
     5354      exit $EXIT_FAILURE
    41625355    fi
    41635356
     
    41695362      fi
    41705363      $echo "$help" 1>&2
    4171       exit 1
     5364      exit $EXIT_FAILURE
    41725365    fi
    41735366
     
    41875380      # Not a directory, so check to see that there is only one file specified.
    41885381      set dummy $files
    4189       if test $# -gt 2; then
     5382      if test "$#" -gt 2; then
    41905383        $echo "$modename: \`$dest' is not a directory" 1>&2
    41915384        $echo "$help" 1>&2
    4192         exit 1
     5385        exit $EXIT_FAILURE
    41935386      fi
    41945387    fi
     
    42025395          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
    42035396          $echo "$help" 1>&2
    4204           exit 1
     5397          exit $EXIT_FAILURE
    42055398          ;;
    42065399        esac
     
    42275420      *.la)
    42285421        # Check to see that this really is a libtool archive.
    4229         if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     5422        if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    42305423        else
    42315424          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
    42325425          $echo "$help" 1>&2
    4233           exit 1
     5426          exit $EXIT_FAILURE
    42345427        fi
    42355428
     
    42635456        if test -n "$relink_command"; then
    42645457          # Determine the prefix the user has applied to our future dir.
    4265           inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
     5458          inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
    42665459
    42675460          # Don't allow the user to place us outside of our expected
    42685461          # location b/c this prevents finding dependent libraries that
    42695462          # 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.
    42705466          if test "$inst_prefix_dir" = "$destdir"; then
    42715467            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
    4272             exit 1
     5468            exit $EXIT_FAILURE
    42735469          fi
    42745470
    42755471          if test -n "$inst_prefix_dir"; then
    42765472            # Stick the inst_prefix_dir data into the link command.
    4277             relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
     5473            relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
    42785474          else
    4279             relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
     5475            relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
    42805476          fi
    42815477
     
    42855481          else
    42865482            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
    4287             exit 1
     5483            exit $EXIT_FAILURE
    42885484          fi
    42895485        fi
     
    43075503          fi
    43085504
    4309           if test $# -gt 0; then
     5505          if test "$#" -gt 0; then
    43105506            # Delete the old symlinks, and create new ones.
    43115507            for linkname
     
    43205516          # Do each command in the postinstall commands.
    43215517          lib="$destdir/$realname"
    4322           eval cmds=\"$postinstall_cmds\"
     5518          cmds=$postinstall_cmds
    43235519          save_ifs="$IFS"; IFS='~'
    43245520          for cmd in $cmds; do
    43255521            IFS="$save_ifs"
     5522            eval cmd=\"$cmd\"
    43265523            $show "$cmd"
    43275524            $run eval "$cmd" || exit $?
     
    43635560          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
    43645561          $echo "$help" 1>&2
    4365           exit 1
     5562          exit $EXIT_FAILURE
    43665563          ;;
    43675564        esac
     
    43815578          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
    43825579        fi
    4383         exit 0
     5580        exit $EXIT_SUCCESS
    43845581        ;;
    43855582
     
    43935590        fi
    43945591
     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
    43955605        # Do a test to see if this is really a libtool program.
    43965606        case $host in
    43975607        *cygwin*|*mingw*)
    4398             wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
     5608            wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
    43995609            ;;
    44005610        *)
     
    44025612            ;;
    44035613        esac
    4404         if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
     5614        if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
    44055615          notinst_deplibs=
    44065616          relink_command=
    44075617
     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
    44085625          # If there is no directory component, then add one.
    44095626          case $file in
    4410           */* | *\\*) . $wrapper ;;
    4411           *) . ./$wrapper ;;
     5627          */* | *\\*) . ${wrapperdot} ;;
     5628          *) . ./${wrapperdot} ;;
    44125629          esac
    44135630
     
    44155632          if test -z "$notinst_deplibs"; then
    44165633            $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
    4417             exit 1
     5634            exit $EXIT_FAILURE
    44185635          fi
    44195636
     
    44375654
    44385655          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
    44395663          # If there is no directory component, then add one.
    44405664          case $file in
    4441           */* | *\\*) . $wrapper ;;
    4442           *) . ./$wrapper ;;
     5665          */* | *\\*) . ${wrapperdot} ;;
     5666          *) . ./${wrapperdot} ;;
    44435667          esac
    44445668
     
    44485672              tmpdir="/tmp"
    44495673              test -n "$TMPDIR" && tmpdir="$TMPDIR"
    4450               tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
    4451               if test $? = 0 ; then
    4452                 tmpdir="$tmpdir_mktemp"
    4453                 unset tmpdir_mktemp
    4454                else
    4455                 tmpdir="$tmpdir/libtool-$$"
    4456               fi
    4457               if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
     5674              tmpdir="$tmpdir/libtool-$$"
     5675              save_umask=`umask`
     5676              umask 0077
     5677              if $mkdir "$tmpdir"; then
     5678                umask $save_umask
    44585679              else
     5680                umask $save_umask
    44595681                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
    44605682                continue
    44615683              fi
    4462               file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
     5684              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
    44635685              outputname="$tmpdir/$file"
    44645686              # Replace the output file specification.
     
    44785700          else
    44795701            # Install the binary that we compiled earlier.
    4480             file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
     5702            file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
    44815703          fi
    44825704        fi
     
    44855707        # one anyways
    44865708        case $install_prog,$host in
    4487         /usr/bin/install*,*cygwin*)
     5709        */usr/bin/install*,*cygwin*)
    44885710          case $file:$destfile in
    44895711          *.exe:*.exe)
     
    44945716            ;;
    44955717          *:*.exe)
    4496             destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
     5718            destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
    44975719            ;;
    44985720          esac
     
    45155737      $run eval "$install_prog \$file \$oldlib" || exit $?
    45165738
    4517       if test -n "$stripme" && test -n "$striplib"; then
     5739      if test -n "$stripme" && test -n "$old_striplib"; then
    45185740        $show "$old_striplib $oldlib"
    45195741        $run eval "$old_striplib $oldlib" || exit $?
     
    45215743
    45225744      # Do each command in the postinstall commands.
    4523       eval cmds=\"$old_postinstall_cmds\"
     5745      cmds=$old_postinstall_cmds
    45245746      save_ifs="$IFS"; IFS='~'
    45255747      for cmd in $cmds; do
    45265748        IFS="$save_ifs"
     5749        eval cmd=\"$cmd\"
    45275750        $show "$cmd"
    45285751        $run eval "$cmd" || exit $?
     
    45385761      # Maybe just do a dry run.
    45395762      test -n "$run" && current_libdirs=" -n$current_libdirs"
    4540       exec_cmd='$SHELL $0 --finish$current_libdirs'
     5763      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
    45415764    else
    4542       exit 0
     5765      exit $EXIT_SUCCESS
    45435766    fi
    45445767    ;;
     
    45595782        if test -n "$finish_cmds"; then
    45605783          # Do each command in the finish commands.
    4561           eval cmds=\"$finish_cmds\"
     5784          cmds=$finish_cmds
    45625785          save_ifs="$IFS"; IFS='~'
    45635786          for cmd in $cmds; do
    45645787            IFS="$save_ifs"
     5788            eval cmd=\"$cmd\"
    45655789            $show "$cmd"
    45665790            $run eval "$cmd" || admincmds="$admincmds
     
    45795803
    45805804    # Exit here if they wanted silent mode.
    4581     test "$show" = ":" && exit 0
    4582 
    4583     echo "----------------------------------------------------------------------"
    4584     echo "Libraries have been installed in:"
     5805    test "$show" = : && exit $EXIT_SUCCESS
     5806
     5807    $echo "----------------------------------------------------------------------"
     5808    $echo "Libraries have been installed in:"
    45855809    for libdir in $libdirs; do
    4586       echo "   $libdir"
     5810      $echo "   $libdir"
    45875811    done
    4588     echo
    4589     echo "If you ever happen to want to link against installed libraries"
    4590     echo "in a given directory, LIBDIR, you must either use libtool, and"
    4591     echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
    4592     echo "flag during linking and do at least one of the following:"
     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:"
    45935817    if test -n "$shlibpath_var"; then
    4594       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
    4595       echo "     during execution"
     5818      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
     5819      $echo "     during execution"
    45965820    fi
    45975821    if test -n "$runpath_var"; then
    4598       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
    4599       echo "     during linking"
     5822      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
     5823      $echo "     during linking"
    46005824    fi
    46015825    if test -n "$hardcode_libdir_flag_spec"; then
     
    46035827      eval flag=\"$hardcode_libdir_flag_spec\"
    46045828
    4605       echo "   - use the \`$flag' linker flag"
     5829      $echo "   - use the \`$flag' linker flag"
    46065830    fi
    46075831    if test -n "$admincmds"; then
    4608       echo "   - have your system administrator run these commands:$admincmds"
     5832      $echo "   - have your system administrator run these commands:$admincmds"
    46095833    fi
    46105834    if test -f /etc/ld.so.conf; then
    4611       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
     5835      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
    46125836    fi
    4613     echo
    4614     echo "See any operating system documentation about shared libraries for"
    4615     echo "more information, such as the ld(1) and ld.so(8) manual pages."
    4616     echo "----------------------------------------------------------------------"
    4617     exit 0
     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
    46185842    ;;
    46195843
     
    46275851      $echo "$modename: you must specify a COMMAND" 1>&2
    46285852      $echo "$help"
    4629       exit 1
     5853      exit $EXIT_FAILURE
    46305854    fi
    46315855
     
    46355859        $echo "$modename: \`$file' is not a file" 1>&2
    46365860        $echo "$help" 1>&2
    4637         exit 1
     5861        exit $EXIT_FAILURE
    46385862      fi
    46395863
     
    46425866      *.la)
    46435867        # Check to see that this really is a libtool archive.
    4644         if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     5868        if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    46455869        else
    46465870          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    46475871          $echo "$help" 1>&2
    4648           exit 1
     5872          exit $EXIT_FAILURE
    46495873        fi
    46505874
     
    46735897        else
    46745898          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
    4675           exit 1
     5899          exit $EXIT_FAILURE
    46765900        fi
    46775901        ;;
     
    47135937      *)
    47145938        # Do a test to see if this is really a libtool program.
    4715         if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     5939        if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    47165940          # If there is no directory component, then add one.
    47175941          case $file in
     
    47365960      fi
    47375961
    4738       # Restore saved enviroment variables
     5962      # Restore saved environment variables
    47395963      if test "${save_LC_ALL+set}" = set; then
    47405964        LC_ALL="$save_LC_ALL"; export LC_ALL
     
    47455969
    47465970      # Now prepare to actually exec the command.
    4747       exec_cmd="\$cmd$args"
     5971      exec_cmd="\"\$cmd\"$args"
    47485972    else
    47495973      # Display what would be done.
     
    47525976        $echo "export $shlibpath_var"
    47535977      fi
    4754       $echo "$cmd$args"
    4755       exit 0
     5978      eval \$echo \"\$cmd\"$args
     5979      exit $EXIT_SUCCESS
    47565980    fi
    47575981    ;;
     
    47816005      $echo "$modename: you must specify an RM program" 1>&2
    47826006      $echo "$help" 1>&2
    4783       exit 1
     6007      exit $EXIT_FAILURE
    47846008    fi
    47856009
    47866010    rmdirs=
    47876011
     6012    origobjdir="$objdir"
    47886013    for file in $files; do
    47896014      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
    47906015      if test "X$dir" = "X$file"; then
    47916016        dir=.
    4792         objdir="$objdir"
     6017        objdir="$origobjdir"
    47936018      else
    4794         objdir="$dir/$objdir"
     6019        objdir="$dir/$origobjdir"
    47956020      fi
    47966021      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    4797       test $mode = uninstall && objdir="$dir"
     6022      test "$mode" = uninstall && objdir="$dir"
    47986023
    47996024      # Remember objdir for removal later, being careful to avoid duplicates
    4800       if test $mode = clean; then
     6025      if test "$mode" = clean; then
    48016026        case " $rmdirs " in
    48026027          *" $objdir "*) ;;
     
    48226047      *.la)
    48236048        # Possibly a libtool archive, so verify it.
    4824         if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     6049        if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    48256050          . $dir/$name
    48266051
     
    48306055          done
    48316056          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
    4832           test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
    4833 
    4834           if test $mode = uninstall; then
     6057          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
     6058
     6059          if test "$mode" = uninstall; then
    48356060            if test -n "$library_names"; then
    48366061              # Do each command in the postuninstall commands.
    4837               eval cmds=\"$postuninstall_cmds\"
     6062              cmds=$postuninstall_cmds
    48386063              save_ifs="$IFS"; IFS='~'
    48396064              for cmd in $cmds; do
    48406065                IFS="$save_ifs"
     6066                eval cmd=\"$cmd\"
    48416067                $show "$cmd"
    48426068                $run eval "$cmd"
    4843                 if test $? != 0 && test "$rmforce" != yes; then
     6069                if test "$?" -ne 0 && test "$rmforce" != yes; then
    48446070                  exit_status=1
    48456071                fi
     
    48506076            if test -n "$old_library"; then
    48516077              # Do each command in the old_postuninstall commands.
    4852               eval cmds=\"$old_postuninstall_cmds\"
     6078              cmds=$old_postuninstall_cmds
    48536079              save_ifs="$IFS"; IFS='~'
    48546080              for cmd in $cmds; do
    48556081                IFS="$save_ifs"
     6082                eval cmd=\"$cmd\"
    48566083                $show "$cmd"
    48576084                $run eval "$cmd"
    4858                 if test $? != 0 && test "$rmforce" != yes; then
     6085                if test "$?" -ne 0 && test "$rmforce" != yes; then
    48596086                  exit_status=1
    48606087                fi
     
    48686095
    48696096      *.lo)
    4870         if test "$build_old_libs" = yes; then
    4871           oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
    4872           rmfiles="$rmfiles $dir/$oldobj"
     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
    48736114        fi
    48746115        ;;
    48756116
    48766117      *)
    4877         # Do a test to see if this is a libtool program.
    4878         if test $mode = clean &&
    4879            (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    4880           relink_command=
    4881           . $dir/$file
    4882 
    4883           rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
    4884           if test "$fast_install" = yes && test -n "$relink_command"; then
    4885             rmfiles="$rmfiles $objdir/lt-$name"
     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
    48866143          fi
    48876144        fi
     
    48916148      $run $rm $rmfiles || exit_status=1
    48926149    done
     6150    objdir="$origobjdir"
    48936151
    48946152    # Try to remove the ${objdir}s in the directories where we deleted files
     
    49066164    $echo "$modename: you must specify a MODE" 1>&2
    49076165    $echo "$generic_help" 1>&2
    4908     exit 1
     6166    exit $EXIT_FAILURE
    49096167    ;;
    49106168  esac
     
    49136171    $echo "$modename: invalid operation mode \`$mode'" 1>&2
    49146172    $echo "$generic_help" 1>&2
    4915     exit 1
     6173    exit $EXIT_FAILURE
    49166174  fi
    49176175fi # test -z "$show_help"
     
    49196177if test -n "$exec_cmd"; then
    49206178  eval exec $exec_cmd
    4921   exit 1
     6179  exit $EXIT_FAILURE
    49226180fi
    49236181
     
    49386196    --quiet           same as \`--silent'
    49396197    --silent          don't print informational messages
     6198    --tag=TAG         use configuration variables from tag TAG
    49406199    --version         print version information
    49416200
     
    49516210
    49526211MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
    4953 a more detailed description of MODE."
    4954   exit 0
     6212a more detailed description of MODE.
     6213
     6214Report bugs to <bug-libtool@gnu.org>."
     6215  exit $EXIT_SUCCESS
    49556216  ;;
    49566217
     
    50636324  -no-undefined     declare that a library does not refer to external symbols
    50646325  -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
    50656329  -release RELEASE  specify package release information
    50666330  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
     
    51046368  $echo "$modename: invalid operation mode \`$mode'" 1>&2
    51056369  $echo "$help" 1>&2
    5106   exit 1
     6370  exit $EXIT_FAILURE
    51076371  ;;
    51086372esac
    51096373
    5110 echo
     6374$echo
    51116375$echo "Try \`$modename --help' for more information about other modes."
    51126376
    5113 exit 0
     6377exit $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
     6391build_libtool_libs=no
     6392build_old_libs=yes
     6393# ### END LIBTOOL TAG CONFIG: disable-shared
     6394
     6395# ### BEGIN LIBTOOL TAG CONFIG: disable-static
     6396build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
     6397# ### END LIBTOOL TAG CONFIG: disable-static
    51146398
    51156399# Local Variables:
  • trunk/psLib/pslib.kdevses

    r3381 r3407  
    44 <DocsAndViews NumberOfDocuments="5" >
    55  <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.c" >
    6    <View0 line="593" Type="Source" />
     6   <View0 line="477" Type="Source" />
    77  </Doc0>
    88  <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.h" >
    9    <View0 line="103" Type="Source" />
     9   <View0 line="130" Type="Source" />
    1010  </Doc1>
    1111  <Doc2 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/collections/psList.h" >
    12    <View0 line="79" Type="Source" />
     12   <View0 line="88" Type="Source" />
    1313  </Doc2>
    14   <Doc3 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psAstronomyErrors.dat" >
    15    <View0 line="50" Type="Source" />
     14  <Doc3 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/fileUtils/psFits.c" >
     15   <View0 line="1658" Type="Source" />
    1616  </Doc3>
    17   <Doc4 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/collections/psList.c" >
    18    <View0 line="216" Type="Source" />
     17  <Doc4 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/fileUtils/psFits.h" >
     18   <View0 line="260" Type="Source" />
    1919  </Doc4>
    2020 </DocsAndViews>
  • trunk/psLib/src/astronomy/psMetadata.c

    r3381 r3407  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-03-07 20:58:50 $
     14*  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-03-11 20:38:56 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6767/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    6868/*****************************************************************************/
     69
     70static psMetadataItem* makeMetaMulti(psHash* table, const char* key, psMetadataItem* existing)
     71{
     72
     73    if (existing != NULL && existing->type == PS_META_MULTI) {
     74        return existing;
     75    }
     76
     77    // move any existing entry into a psList
     78    psList* newList = psListAlloc(existing);
     79
     80    psMetadataItem* item = psMetadataItemAlloc(key,
     81                           PS_META_MULTI,
     82                           "",
     83                           newList);
     84
     85    if (existing != NULL) {
     86        psHashRemove(table,key); // take out the old entry
     87    }
     88
     89    psHashAdd(table, key, item); // put in the new entry
     90
     91    // free local references of newly allocated items.
     92    psFree(newList);
     93    psFree(item);
     94
     95    return item;
     96}
    6997
    7098static void metadataItemFree(psMetadataItem* metadataItem)
     
    253281    existingEntry = (psMetadataItem*)psHashLookup(mdTable, key);
    254282
    255     // how the item is added to the hash depends on flags & prior existence
    256     if(existingEntry != NULL) {
    257         if ((flags & PS_META_DUPLICATE_OK) != 0) {
     283    if (metadataItem->type == PS_META_MULTI) {
     284        // the incoming entry is PS_META_MULTI
     285
     286        // force the hash entry to be PS_META_MULTI
     287        existingEntry = makeMetaMulti(mdTable,key,existingEntry);
     288
     289        // add all the items in the incoming entry to metadata
     290        psList* list = metadataItem->data.list;
     291        if (list != NULL) {
     292            psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
     293            psMetadataItem* listItem;
     294            while ((listItem=(psMetadataItem*)psListGetAndIncrement(iter)) != NULL) {
     295                psMetadataAddItem(md,listItem,location,flags);
     296            }
     297            psFree(iter);
     298        }
     299
     300        return true; // all done.
     301    }
     302
     303    // how the item is added to the hash depends on prior existence, flags, etc.
     304    if(existingEntry != NULL) { // prior existence
     305        if (existingEntry->type == PS_META_MULTI || (flags & PS_META_DUPLICATE_OK) != 0) {
    258306            // duplicate entries allowed - add another entry.
    259             if (existingEntry->type != PS_META_MULTI) {
    260                 // first duplicate, transfer the hash's old entry into a
    261                 // list of entries with the type PS_META_MULTI.
    262 
    263                 // add entry to a list and dereference the local pointer
    264                 psList* newList = psListAlloc(existingEntry);
    265 
    266                 existingEntry = psMetadataItemAlloc(key,
    267                                                     PS_META_MULTI,
    268                                                     "",
    269                                                     newList);
    270                 psHashRemove(mdTable,key); // take out the old entry
    271                 psHashAdd(mdTable, key, existingEntry); // put in the new entry
    272 
    273                 // free local references of newly allocated items.
    274                 psFree(newList);
    275                 psFree(existingEntry);
    276 
    277             }
     307
     308            // make sure the existing entry is PS_META_MULTI
     309            existingEntry = makeMetaMulti(mdTable,key,existingEntry);
    278310
    279311            // add to the hash's list of duplicate entries
     
    282314                return false;
    283315            }
    284             // (added to list below)
    285 
    286316        } else if ((flags & PS_META_REPLACE) != 0) {
    287317            // replace entry instead of creating a duplicate entry.
    288318
    289319            // remove the existing entry from metadata
    290             psListRemoveData(mdList, existingEntry);
    291             psHashRemove(mdTable, key);
     320            psMetadataRemove(md,0,key);
    292321
    293322            // treat as if new (added to list below)
     
    423452            // multiple entries with same key, remove just the specified one
    424453            psListRemoveData(tableItem->data.list, entry);
    425             if (psListGet(tableItem->data.list,PS_LIST_HEAD) == NULL) {
    426                 // list is empty, so let's clear the whole entry now.
    427                 if (!psHashRemove(mdTable, key)) {
    428                     psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
    429                     return false;
    430                 }
    431             }
    432454        } else {
    433455            if (!psHashRemove(mdTable, key)) {
  • trunk/psLib/src/astronomy/psMetadata.h

    r3381 r3407  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-03-07 20:58:50 $
     13*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-03-11 20:38:56 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737 */
    3838typedef enum {
    39     PS_META_S32,                       ///< psS32 primitive data.
    40     PS_META_F32,                       ///< psF32 primitive data.
    41     PS_META_F64,                       ///< psF64 primitive data.
    42     PS_META_BOOL,                      ///< psBool primitive data.
    43     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     39    PS_META_S32 = PS_TYPE_S32,         ///< psS32 primitive data.
     40    PS_META_F32 = PS_TYPE_F32,         ///< psF32 primitive data.
     41    PS_META_F64 = PS_TYPE_F64,         ///< psF64 primitive data.
     42    PS_META_BOOL = PS_TYPE_BOOL,       ///< psBool primitive data.
     43    PS_META_LIST = 0x10000,            ///< List data (Stored as item.data.list).
    4444    PS_META_STR,                       ///< String data (Stored as item.data.V).
    4545    PS_META_VEC,                       ///< Vector data (Stored as item.data.V).
     
    5151    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored as item.data.V).
    5252    PS_META_UNKNOWN,                   ///< Other data (Stored as item.data.V).
    53     PS_META_MULTI,                     ///< Used internally, do not create an metadata item of this type.
    54     PS_META_NTYPE                      ///< Number of types. Must be last.
     53    PS_META_MULTI                      ///< Used internally, do not create an metadata item of this type.
    5554} psMetadataType;
    5655
  • trunk/psLib/src/collections/psMetadata.c

    r3381 r3407  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-03-07 20:58:50 $
     14*  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-03-11 20:38:56 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6767/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    6868/*****************************************************************************/
     69
     70static psMetadataItem* makeMetaMulti(psHash* table, const char* key, psMetadataItem* existing)
     71{
     72
     73    if (existing != NULL && existing->type == PS_META_MULTI) {
     74        return existing;
     75    }
     76
     77    // move any existing entry into a psList
     78    psList* newList = psListAlloc(existing);
     79
     80    psMetadataItem* item = psMetadataItemAlloc(key,
     81                           PS_META_MULTI,
     82                           "",
     83                           newList);
     84
     85    if (existing != NULL) {
     86        psHashRemove(table,key); // take out the old entry
     87    }
     88
     89    psHashAdd(table, key, item); // put in the new entry
     90
     91    // free local references of newly allocated items.
     92    psFree(newList);
     93    psFree(item);
     94
     95    return item;
     96}
    6997
    7098static void metadataItemFree(psMetadataItem* metadataItem)
     
    253281    existingEntry = (psMetadataItem*)psHashLookup(mdTable, key);
    254282
    255     // how the item is added to the hash depends on flags & prior existence
    256     if(existingEntry != NULL) {
    257         if ((flags & PS_META_DUPLICATE_OK) != 0) {
     283    if (metadataItem->type == PS_META_MULTI) {
     284        // the incoming entry is PS_META_MULTI
     285
     286        // force the hash entry to be PS_META_MULTI
     287        existingEntry = makeMetaMulti(mdTable,key,existingEntry);
     288
     289        // add all the items in the incoming entry to metadata
     290        psList* list = metadataItem->data.list;
     291        if (list != NULL) {
     292            psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
     293            psMetadataItem* listItem;
     294            while ((listItem=(psMetadataItem*)psListGetAndIncrement(iter)) != NULL) {
     295                psMetadataAddItem(md,listItem,location,flags);
     296            }
     297            psFree(iter);
     298        }
     299
     300        return true; // all done.
     301    }
     302
     303    // how the item is added to the hash depends on prior existence, flags, etc.
     304    if(existingEntry != NULL) { // prior existence
     305        if (existingEntry->type == PS_META_MULTI || (flags & PS_META_DUPLICATE_OK) != 0) {
    258306            // duplicate entries allowed - add another entry.
    259             if (existingEntry->type != PS_META_MULTI) {
    260                 // first duplicate, transfer the hash's old entry into a
    261                 // list of entries with the type PS_META_MULTI.
    262 
    263                 // add entry to a list and dereference the local pointer
    264                 psList* newList = psListAlloc(existingEntry);
    265 
    266                 existingEntry = psMetadataItemAlloc(key,
    267                                                     PS_META_MULTI,
    268                                                     "",
    269                                                     newList);
    270                 psHashRemove(mdTable,key); // take out the old entry
    271                 psHashAdd(mdTable, key, existingEntry); // put in the new entry
    272 
    273                 // free local references of newly allocated items.
    274                 psFree(newList);
    275                 psFree(existingEntry);
    276 
    277             }
     307
     308            // make sure the existing entry is PS_META_MULTI
     309            existingEntry = makeMetaMulti(mdTable,key,existingEntry);
    278310
    279311            // add to the hash's list of duplicate entries
     
    282314                return false;
    283315            }
    284             // (added to list below)
    285 
    286316        } else if ((flags & PS_META_REPLACE) != 0) {
    287317            // replace entry instead of creating a duplicate entry.
    288318
    289319            // remove the existing entry from metadata
    290             psListRemoveData(mdList, existingEntry);
    291             psHashRemove(mdTable, key);
     320            psMetadataRemove(md,0,key);
    292321
    293322            // treat as if new (added to list below)
     
    423452            // multiple entries with same key, remove just the specified one
    424453            psListRemoveData(tableItem->data.list, entry);
    425             if (psListGet(tableItem->data.list,PS_LIST_HEAD) == NULL) {
    426                 // list is empty, so let's clear the whole entry now.
    427                 if (!psHashRemove(mdTable, key)) {
    428                     psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
    429                     return false;
    430                 }
    431             }
    432454        } else {
    433455            if (!psHashRemove(mdTable, key)) {
  • trunk/psLib/src/collections/psMetadata.h

    r3381 r3407  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-03-07 20:58:50 $
     13*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-03-11 20:38:56 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737 */
    3838typedef enum {
    39     PS_META_S32,                       ///< psS32 primitive data.
    40     PS_META_F32,                       ///< psF32 primitive data.
    41     PS_META_F64,                       ///< psF64 primitive data.
    42     PS_META_BOOL,                      ///< psBool primitive data.
    43     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     39    PS_META_S32 = PS_TYPE_S32,         ///< psS32 primitive data.
     40    PS_META_F32 = PS_TYPE_F32,         ///< psF32 primitive data.
     41    PS_META_F64 = PS_TYPE_F64,         ///< psF64 primitive data.
     42    PS_META_BOOL = PS_TYPE_BOOL,       ///< psBool primitive data.
     43    PS_META_LIST = 0x10000,            ///< List data (Stored as item.data.list).
    4444    PS_META_STR,                       ///< String data (Stored as item.data.V).
    4545    PS_META_VEC,                       ///< Vector data (Stored as item.data.V).
     
    5151    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored as item.data.V).
    5252    PS_META_UNKNOWN,                   ///< Other data (Stored as item.data.V).
    53     PS_META_MULTI,                     ///< Used internally, do not create an metadata item of this type.
    54     PS_META_NTYPE                      ///< Number of types. Must be last.
     53    PS_META_MULTI                      ///< Used internally, do not create an metadata item of this type.
    5554} psMetadataType;
    5655
  • trunk/psLib/src/collections/psVector.c

    r3264 r3407  
    1 
    21/** @file  psVector.c
    32*
     
    109*  @author Robert DeSonia, MHPCC
    1110*
    12 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-02-17 19:26:23 $
     11*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-03-11 20:38:56 $
    1413*
    1514*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1817#include <string.h>                        // for memcpy
    1918#include <stdlib.h>
     19#include <stdio.h>
    2020#include <math.h>
    2121
     
    407407    return outVector;
    408408}
     409
     410char* psVectorToString(psVector* vector, int maxLength)
     411{
     412
     413    if (maxLength < 5) {
     414        return NULL;
     415    }
     416
     417    char* str = psAlloc(sizeof(char)*maxLength+1);
     418
     419    if (vector == NULL) {
     420        snprintf(str,maxLength, "NULL");
     421        return str;
     422    }
     423
     424    int size = vector->n;
     425
     426    if (size == 0) {
     427        snprintf(str,maxLength, "[]");
     428        return str;
     429    }
     430
     431    char* tempStr = psAlloc(sizeof(char)*maxLength+1);
     432    *str = '\0';
     433    bool full = false;
     434
     435    #define APPEND_ELEMENTS_CASE(TYPE, NATIVE_TYPE, FORMAT) \
     436case PS_TYPE_##TYPE: \
     437    for (lcv=0; lcv < size && ! full; lcv++) { \
     438        snprintf(tempStr, maxLength, "%s" FORMAT, prefix, (NATIVE_TYPE) (vector->data.TYPE[lcv])); \
     439        strncat(str,tempStr,maxLength); \
     440        full = (strlen(str) > maxLength-2); \
     441        prefix = ","; \
     442    } \
     443    break;
     444
     445    #define APPEND_ELEMENTS_CASE_COMPLEX(TYPE,CREAL,CIMAG) \
     446case PS_TYPE_##TYPE: \
     447    for (lcv=0; lcv < size && ! full; lcv++) { \
     448        snprintf(tempStr, maxLength, "%s%g%+gi", prefix, \
     449                 CREAL(vector->data.TYPE[lcv]), \
     450                 CIMAG(vector->data.TYPE[lcv])); \
     451        full = (strlen(str) > maxLength-2); \
     452        prefix = ","; \
     453    } \
     454    break;
     455
     456    int lcv;
     457    char* prefix = "[";
     458    switch(vector->type.type) {
     459        APPEND_ELEMENTS_CASE(S8,char,"%hd")
     460        APPEND_ELEMENTS_CASE(S16,short int,"%hd")
     461        APPEND_ELEMENTS_CASE(S32,int,"%d")
     462        APPEND_ELEMENTS_CASE(S64,long,"%ld")
     463        APPEND_ELEMENTS_CASE(U8,unsigned char,"%hu")
     464        APPEND_ELEMENTS_CASE(U16,unsigned short,"%hu")
     465        APPEND_ELEMENTS_CASE(U32,unsigned int, "%u")
     466        APPEND_ELEMENTS_CASE(U64,unsigned long,"%lu")
     467        APPEND_ELEMENTS_CASE(F32,double,"%g")
     468        APPEND_ELEMENTS_CASE(F64,double,"%g")
     469        APPEND_ELEMENTS_CASE_COMPLEX(C32,crealf,cimagf)
     470        APPEND_ELEMENTS_CASE_COMPLEX(C64,creal,cimag)
     471    default:
     472        snprintf(str,maxLength,"[...]");
     473        break;
     474    }
     475
     476    if (full) {
     477        // couldn't all fit in given string length
     478
     479        // remove elements until there is room for ",...]"
     480        while (strlen(str) > maxLength - 5) {
     481            char* lastComma = strrchr(str,',');
     482            if (lastComma == NULL) { // no comma, must be first number
     483                str[1] = '\0';
     484            } else {
     485                *lastComma = '\0';
     486            }
     487        }
     488        strncat(str,",...]",maxLength);
     489    } else {
     490        strncat(str,"]",maxLength);
     491    }
     492
     493    psFree(tempStr);
     494
     495    return str;
     496}
     497
  • trunk/psLib/src/collections/psVector.h

    r3264 r3407  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:23 $
     13 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-11 20:38:56 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    144144);
    145145
     146/** Creates a string from a psVector's values in the form "[x0,x1,x2]".
     147 *
     148 *  @return psPtr          a newly allocated string
     149 */
     150char* psVectorToString(
     151    psVector* vector,                  ///< vector to create a string from
     152    int maxLength                      ///< the maximum length of the resulting string
     153);
     154
    146155/// @}
    147156
  • trunk/psLib/src/dataIO/psFits.c

    r3341 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-28 23:34:10 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9898        break;
    9999
     100    case PS_TYPE_BOOL:
    100101    case PS_TYPE_S8:
    101102        bitpix = BYTE_IMG;
     
    14501451        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    14511452                PS_ERRORTEXT_psFits_NULL);
    1452         return NULL;
     1453        return false;
    14531454    }
    14541455
     
    16191620    return true;
    16201621}
     1622
     1623bool psFitsUpdateTable(psFits* fits,
     1624                       psMetadata* data,
     1625                       int row)
     1626{
     1627    int status = 0;
     1628
     1629    if (fits == NULL) {
     1630        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1631                PS_ERRORTEXT_psFits_NULL);
     1632        return false;
     1633    }
     1634
     1635    if (data == NULL) {
     1636        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1637                PS_ERRORTEXT_psFits_IMAGE_NULL);
     1638        return false;
     1639    }
     1640
     1641
     1642    // check to see if we even are positioned on a table HDU
     1643    int hdutype;
     1644    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
     1645        char fitsErr[MAX_STRING_LENGTH];
     1646        (void)fits_get_errstatus(status, fitsErr);
     1647        psError(PS_ERR_IO, true,
     1648                PS_ERRORTEXT_psFits_GET_HDU_TYPE_FAILED,
     1649                fitsErr);
     1650        return false;
     1651    }
     1652    if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) {
     1653        psError(PS_ERR_IO, true,
     1654                PS_ERRORTEXT_psFits_NOT_TABLE_TYPE);
     1655        return false;
     1656    }
     1657
     1658
     1659    psMetadataIterator* iter = psMetadataIteratorAlloc(data,PS_LIST_HEAD,NULL);
     1660
     1661    psMetadataItem* item;
     1662
     1663    while ( (item=psMetadataGetAndIncrement(iter)) != NULL) {
     1664        if (PS_META_IS_PRIMITIVE(item->type)) {
     1665            // operating on primitive data type, i.e., not a complex object
     1666            int colnum = 0;
     1667
     1668            if ( fits_get_colnum(fits->p_fd, CASESEN, item->name, &colnum, &status) == 0) {
     1669                // cooresponding column found in table
     1670                int dataType = 0;
     1671                convertPsTypeToFits(item->type, NULL, NULL, &dataType);
     1672
     1673                if (fits_write_col(fits->p_fd, dataType, colnum, row, 0,1,&item->data,&status) != 0) {
     1674                    char fitsErr[MAX_STRING_LENGTH];
     1675                    (void)fits_get_errstatus(status, fitsErr);
     1676                    psError(PS_ERR_IO, true,
     1677                            PS_ERRORTEXT_psFits_WRITE_FAILED,
     1678                            fits->filename, fitsErr);
     1679                    return false;
     1680                }
     1681            }
     1682        }
     1683    }
     1684
     1685    psFree(iter);
     1686
     1687    return true;
     1688}
  • trunk/psLib/src/dataIO/psFits.h

    r3264 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    249249);
    250250
    251 #if 0
     251
    252252/** Updates a FITS table.  The current HDU type must be either
    253253 *  PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.
     
    259259bool psFitsUpdateTable(
    260260    psFits* fits,                      ///< the psFits object
    261     psArray* table
     261    psMetadata* data,
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
     263    int row                            ///< the row number to update.
     264
    263265);
    264266
     
    266268
    267269#endif
    268 
    269 #endif
  • trunk/psLib/src/fileUtils/psFits.c

    r3341 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-28 23:34:10 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9898        break;
    9999
     100    case PS_TYPE_BOOL:
    100101    case PS_TYPE_S8:
    101102        bitpix = BYTE_IMG;
     
    14501451        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    14511452                PS_ERRORTEXT_psFits_NULL);
    1452         return NULL;
     1453        return false;
    14531454    }
    14541455
     
    16191620    return true;
    16201621}
     1622
     1623bool psFitsUpdateTable(psFits* fits,
     1624                       psMetadata* data,
     1625                       int row)
     1626{
     1627    int status = 0;
     1628
     1629    if (fits == NULL) {
     1630        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1631                PS_ERRORTEXT_psFits_NULL);
     1632        return false;
     1633    }
     1634
     1635    if (data == NULL) {
     1636        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1637                PS_ERRORTEXT_psFits_IMAGE_NULL);
     1638        return false;
     1639    }
     1640
     1641
     1642    // check to see if we even are positioned on a table HDU
     1643    int hdutype;
     1644    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
     1645        char fitsErr[MAX_STRING_LENGTH];
     1646        (void)fits_get_errstatus(status, fitsErr);
     1647        psError(PS_ERR_IO, true,
     1648                PS_ERRORTEXT_psFits_GET_HDU_TYPE_FAILED,
     1649                fitsErr);
     1650        return false;
     1651    }
     1652    if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) {
     1653        psError(PS_ERR_IO, true,
     1654                PS_ERRORTEXT_psFits_NOT_TABLE_TYPE);
     1655        return false;
     1656    }
     1657
     1658
     1659    psMetadataIterator* iter = psMetadataIteratorAlloc(data,PS_LIST_HEAD,NULL);
     1660
     1661    psMetadataItem* item;
     1662
     1663    while ( (item=psMetadataGetAndIncrement(iter)) != NULL) {
     1664        if (PS_META_IS_PRIMITIVE(item->type)) {
     1665            // operating on primitive data type, i.e., not a complex object
     1666            int colnum = 0;
     1667
     1668            if ( fits_get_colnum(fits->p_fd, CASESEN, item->name, &colnum, &status) == 0) {
     1669                // cooresponding column found in table
     1670                int dataType = 0;
     1671                convertPsTypeToFits(item->type, NULL, NULL, &dataType);
     1672
     1673                if (fits_write_col(fits->p_fd, dataType, colnum, row, 0,1,&item->data,&status) != 0) {
     1674                    char fitsErr[MAX_STRING_LENGTH];
     1675                    (void)fits_get_errstatus(status, fitsErr);
     1676                    psError(PS_ERR_IO, true,
     1677                            PS_ERRORTEXT_psFits_WRITE_FAILED,
     1678                            fits->filename, fitsErr);
     1679                    return false;
     1680                }
     1681            }
     1682        }
     1683    }
     1684
     1685    psFree(iter);
     1686
     1687    return true;
     1688}
  • trunk/psLib/src/fileUtils/psFits.h

    r3264 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    249249);
    250250
    251 #if 0
     251
    252252/** Updates a FITS table.  The current HDU type must be either
    253253 *  PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.
     
    259259bool psFitsUpdateTable(
    260260    psFits* fits,                      ///< the psFits object
    261     psArray* table
     261    psMetadata* data,
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
     263    int row                            ///< the row number to update.
     264
    263265);
    264266
     
    266268
    267269#endif
    268 
    269 #endif
  • trunk/psLib/src/fits/psFits.c

    r3341 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-28 23:34:10 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9898        break;
    9999
     100    case PS_TYPE_BOOL:
    100101    case PS_TYPE_S8:
    101102        bitpix = BYTE_IMG;
     
    14501451        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    14511452                PS_ERRORTEXT_psFits_NULL);
    1452         return NULL;
     1453        return false;
    14531454    }
    14541455
     
    16191620    return true;
    16201621}
     1622
     1623bool psFitsUpdateTable(psFits* fits,
     1624                       psMetadata* data,
     1625                       int row)
     1626{
     1627    int status = 0;
     1628
     1629    if (fits == NULL) {
     1630        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1631                PS_ERRORTEXT_psFits_NULL);
     1632        return false;
     1633    }
     1634
     1635    if (data == NULL) {
     1636        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     1637                PS_ERRORTEXT_psFits_IMAGE_NULL);
     1638        return false;
     1639    }
     1640
     1641
     1642    // check to see if we even are positioned on a table HDU
     1643    int hdutype;
     1644    if ( fits_get_hdu_type(fits->p_fd,&hdutype, &status) != 0) {
     1645        char fitsErr[MAX_STRING_LENGTH];
     1646        (void)fits_get_errstatus(status, fitsErr);
     1647        psError(PS_ERR_IO, true,
     1648                PS_ERRORTEXT_psFits_GET_HDU_TYPE_FAILED,
     1649                fitsErr);
     1650        return false;
     1651    }
     1652    if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) {
     1653        psError(PS_ERR_IO, true,
     1654                PS_ERRORTEXT_psFits_NOT_TABLE_TYPE);
     1655        return false;
     1656    }
     1657
     1658
     1659    psMetadataIterator* iter = psMetadataIteratorAlloc(data,PS_LIST_HEAD,NULL);
     1660
     1661    psMetadataItem* item;
     1662
     1663    while ( (item=psMetadataGetAndIncrement(iter)) != NULL) {
     1664        if (PS_META_IS_PRIMITIVE(item->type)) {
     1665            // operating on primitive data type, i.e., not a complex object
     1666            int colnum = 0;
     1667
     1668            if ( fits_get_colnum(fits->p_fd, CASESEN, item->name, &colnum, &status) == 0) {
     1669                // cooresponding column found in table
     1670                int dataType = 0;
     1671                convertPsTypeToFits(item->type, NULL, NULL, &dataType);
     1672
     1673                if (fits_write_col(fits->p_fd, dataType, colnum, row, 0,1,&item->data,&status) != 0) {
     1674                    char fitsErr[MAX_STRING_LENGTH];
     1675                    (void)fits_get_errstatus(status, fitsErr);
     1676                    psError(PS_ERR_IO, true,
     1677                            PS_ERRORTEXT_psFits_WRITE_FAILED,
     1678                            fits->filename, fitsErr);
     1679                    return false;
     1680                }
     1681            }
     1682        }
     1683    }
     1684
     1685    psFree(iter);
     1686
     1687    return true;
     1688}
  • trunk/psLib/src/fits/psFits.h

    r3264 r3407  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-02-17 19:26:24 $
     9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-03-11 20:38:56 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    249249);
    250250
    251 #if 0
     251
    252252/** Updates a FITS table.  The current HDU type must be either
    253253 *  PS_FITS_TYPE_BINARY_TABLE or PS_FITS_TYPE_ASCII_TABLE.
     
    259259bool psFitsUpdateTable(
    260260    psFits* fits,                      ///< the psFits object
    261     psArray* table
     261    psMetadata* data,
    262262    ///< Array of psMetadata items, which contains the output data items of each row.
     263    int row                            ///< the row number to update.
     264
    263265);
    264266
     
    266268
    267269#endif
    268 
    269 #endif
  • trunk/psLib/src/mathtypes/psVector.c

    r3264 r3407  
    1 
    21/** @file  psVector.c
    32*
     
    109*  @author Robert DeSonia, MHPCC
    1110*
    12 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-02-17 19:26:23 $
     11*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-03-11 20:38:56 $
    1413*
    1514*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1817#include <string.h>                        // for memcpy
    1918#include <stdlib.h>
     19#include <stdio.h>
    2020#include <math.h>
    2121
     
    407407    return outVector;
    408408}
     409
     410char* psVectorToString(psVector* vector, int maxLength)
     411{
     412
     413    if (maxLength < 5) {
     414        return NULL;
     415    }
     416
     417    char* str = psAlloc(sizeof(char)*maxLength+1);
     418
     419    if (vector == NULL) {
     420        snprintf(str,maxLength, "NULL");
     421        return str;
     422    }
     423
     424    int size = vector->n;
     425
     426    if (size == 0) {
     427        snprintf(str,maxLength, "[]");
     428        return str;
     429    }
     430
     431    char* tempStr = psAlloc(sizeof(char)*maxLength+1);
     432    *str = '\0';
     433    bool full = false;
     434
     435    #define APPEND_ELEMENTS_CASE(TYPE, NATIVE_TYPE, FORMAT) \
     436case PS_TYPE_##TYPE: \
     437    for (lcv=0; lcv < size && ! full; lcv++) { \
     438        snprintf(tempStr, maxLength, "%s" FORMAT, prefix, (NATIVE_TYPE) (vector->data.TYPE[lcv])); \
     439        strncat(str,tempStr,maxLength); \
     440        full = (strlen(str) > maxLength-2); \
     441        prefix = ","; \
     442    } \
     443    break;
     444
     445    #define APPEND_ELEMENTS_CASE_COMPLEX(TYPE,CREAL,CIMAG) \
     446case PS_TYPE_##TYPE: \
     447    for (lcv=0; lcv < size && ! full; lcv++) { \
     448        snprintf(tempStr, maxLength, "%s%g%+gi", prefix, \
     449                 CREAL(vector->data.TYPE[lcv]), \
     450                 CIMAG(vector->data.TYPE[lcv])); \
     451        full = (strlen(str) > maxLength-2); \
     452        prefix = ","; \
     453    } \
     454    break;
     455
     456    int lcv;
     457    char* prefix = "[";
     458    switch(vector->type.type) {
     459        APPEND_ELEMENTS_CASE(S8,char,"%hd")
     460        APPEND_ELEMENTS_CASE(S16,short int,"%hd")
     461        APPEND_ELEMENTS_CASE(S32,int,"%d")
     462        APPEND_ELEMENTS_CASE(S64,long,"%ld")
     463        APPEND_ELEMENTS_CASE(U8,unsigned char,"%hu")
     464        APPEND_ELEMENTS_CASE(U16,unsigned short,"%hu")
     465        APPEND_ELEMENTS_CASE(U32,unsigned int, "%u")
     466        APPEND_ELEMENTS_CASE(U64,unsigned long,"%lu")
     467        APPEND_ELEMENTS_CASE(F32,double,"%g")
     468        APPEND_ELEMENTS_CASE(F64,double,"%g")
     469        APPEND_ELEMENTS_CASE_COMPLEX(C32,crealf,cimagf)
     470        APPEND_ELEMENTS_CASE_COMPLEX(C64,creal,cimag)
     471    default:
     472        snprintf(str,maxLength,"[...]");
     473        break;
     474    }
     475
     476    if (full) {
     477        // couldn't all fit in given string length
     478
     479        // remove elements until there is room for ",...]"
     480        while (strlen(str) > maxLength - 5) {
     481            char* lastComma = strrchr(str,',');
     482            if (lastComma == NULL) { // no comma, must be first number
     483                str[1] = '\0';
     484            } else {
     485                *lastComma = '\0';
     486            }
     487        }
     488        strncat(str,",...]",maxLength);
     489    } else {
     490        strncat(str,"]",maxLength);
     491    }
     492
     493    psFree(tempStr);
     494
     495    return str;
     496}
     497
  • trunk/psLib/src/mathtypes/psVector.h

    r3264 r3407  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-02-17 19:26:23 $
     13 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-03-11 20:38:56 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    144144);
    145145
     146/** Creates a string from a psVector's values in the form "[x0,x1,x2]".
     147 *
     148 *  @return psPtr          a newly allocated string
     149 */
     150char* psVectorToString(
     151    psVector* vector,                  ///< vector to create a string from
     152    int maxLength                      ///< the maximum length of the resulting string
     153);
     154
    146155/// @}
    147156
  • trunk/psLib/src/types/psMetadata.c

    r3381 r3407  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-03-07 20:58:50 $
     14*  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-03-11 20:38:56 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6767/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    6868/*****************************************************************************/
     69
     70static psMetadataItem* makeMetaMulti(psHash* table, const char* key, psMetadataItem* existing)
     71{
     72
     73    if (existing != NULL && existing->type == PS_META_MULTI) {
     74        return existing;
     75    }
     76
     77    // move any existing entry into a psList
     78    psList* newList = psListAlloc(existing);
     79
     80    psMetadataItem* item = psMetadataItemAlloc(key,
     81                           PS_META_MULTI,
     82                           "",
     83                           newList);
     84
     85    if (existing != NULL) {
     86        psHashRemove(table,key); // take out the old entry
     87    }
     88
     89    psHashAdd(table, key, item); // put in the new entry
     90
     91    // free local references of newly allocated items.
     92    psFree(newList);
     93    psFree(item);
     94
     95    return item;
     96}
    6997
    7098static void metadataItemFree(psMetadataItem* metadataItem)
     
    253281    existingEntry = (psMetadataItem*)psHashLookup(mdTable, key);
    254282
    255     // how the item is added to the hash depends on flags & prior existence
    256     if(existingEntry != NULL) {
    257         if ((flags & PS_META_DUPLICATE_OK) != 0) {
     283    if (metadataItem->type == PS_META_MULTI) {
     284        // the incoming entry is PS_META_MULTI
     285
     286        // force the hash entry to be PS_META_MULTI
     287        existingEntry = makeMetaMulti(mdTable,key,existingEntry);
     288
     289        // add all the items in the incoming entry to metadata
     290        psList* list = metadataItem->data.list;
     291        if (list != NULL) {
     292            psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
     293            psMetadataItem* listItem;
     294            while ((listItem=(psMetadataItem*)psListGetAndIncrement(iter)) != NULL) {
     295                psMetadataAddItem(md,listItem,location,flags);
     296            }
     297            psFree(iter);
     298        }
     299
     300        return true; // all done.
     301    }
     302
     303    // how the item is added to the hash depends on prior existence, flags, etc.
     304    if(existingEntry != NULL) { // prior existence
     305        if (existingEntry->type == PS_META_MULTI || (flags & PS_META_DUPLICATE_OK) != 0) {
    258306            // duplicate entries allowed - add another entry.
    259             if (existingEntry->type != PS_META_MULTI) {
    260                 // first duplicate, transfer the hash's old entry into a
    261                 // list of entries with the type PS_META_MULTI.
    262 
    263                 // add entry to a list and dereference the local pointer
    264                 psList* newList = psListAlloc(existingEntry);
    265 
    266                 existingEntry = psMetadataItemAlloc(key,
    267                                                     PS_META_MULTI,
    268                                                     "",
    269                                                     newList);
    270                 psHashRemove(mdTable,key); // take out the old entry
    271                 psHashAdd(mdTable, key, existingEntry); // put in the new entry
    272 
    273                 // free local references of newly allocated items.
    274                 psFree(newList);
    275                 psFree(existingEntry);
    276 
    277             }
     307
     308            // make sure the existing entry is PS_META_MULTI
     309            existingEntry = makeMetaMulti(mdTable,key,existingEntry);
    278310
    279311            // add to the hash's list of duplicate entries
     
    282314                return false;
    283315            }
    284             // (added to list below)
    285 
    286316        } else if ((flags & PS_META_REPLACE) != 0) {
    287317            // replace entry instead of creating a duplicate entry.
    288318
    289319            // remove the existing entry from metadata
    290             psListRemoveData(mdList, existingEntry);
    291             psHashRemove(mdTable, key);
     320            psMetadataRemove(md,0,key);
    292321
    293322            // treat as if new (added to list below)
     
    423452            // multiple entries with same key, remove just the specified one
    424453            psListRemoveData(tableItem->data.list, entry);
    425             if (psListGet(tableItem->data.list,PS_LIST_HEAD) == NULL) {
    426                 // list is empty, so let's clear the whole entry now.
    427                 if (!psHashRemove(mdTable, key)) {
    428                     psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
    429                     return false;
    430                 }
    431             }
    432454        } else {
    433455            if (!psHashRemove(mdTable, key)) {
  • trunk/psLib/src/types/psMetadata.h

    r3381 r3407  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-03-07 20:58:50 $
     13*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-03-11 20:38:56 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737 */
    3838typedef enum {
    39     PS_META_S32,                       ///< psS32 primitive data.
    40     PS_META_F32,                       ///< psF32 primitive data.
    41     PS_META_F64,                       ///< psF64 primitive data.
    42     PS_META_BOOL,                      ///< psBool primitive data.
    43     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     39    PS_META_S32 = PS_TYPE_S32,         ///< psS32 primitive data.
     40    PS_META_F32 = PS_TYPE_F32,         ///< psF32 primitive data.
     41    PS_META_F64 = PS_TYPE_F64,         ///< psF64 primitive data.
     42    PS_META_BOOL = PS_TYPE_BOOL,       ///< psBool primitive data.
     43    PS_META_LIST = 0x10000,            ///< List data (Stored as item.data.list).
    4444    PS_META_STR,                       ///< String data (Stored as item.data.V).
    4545    PS_META_VEC,                       ///< Vector data (Stored as item.data.V).
     
    5151    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored as item.data.V).
    5252    PS_META_UNKNOWN,                   ///< Other data (Stored as item.data.V).
    53     PS_META_MULTI,                     ///< Used internally, do not create an metadata item of this type.
    54     PS_META_NTYPE                      ///< Number of types. Must be last.
     53    PS_META_MULTI                      ///< Used internally, do not create an metadata item of this type.
    5554} psMetadataType;
    5655
  • trunk/psLib/test/astronomy/tst_psMetadataIO.c

    r3381 r3407  
    1414 *  @author  Robert DeSonia, MHPCC
    1515 *
    16  *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-03-07 20:58:50 $
     16 *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-03-11 20:38:56 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6666static void printMetadataItem(psMetadataItem *metadataItem, char *spaces)
    6767{
     68    char* vecStr;
     69
    6870    printf("%sKey Name: %8s  ", spaces, metadataItem->name);
    69     printf("Key mdType: %d ", metadataItem->type);
     71    printf("Key mdType: 0x%08x ", metadataItem->type);
    7072
    7173    switch (metadataItem->type) {
     
    8587        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    8688        break;
     89    case PS_META_VEC:
     90        vecStr = (char*)psVectorToString((psVector*)metadataItem->data.V, 15);
     91        printf("Key Value: %15s  ", vecStr);
     92        psFree(vecStr);
     93        break;
    8794    case PS_META_STR:
    8895        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    8996        break;
    9097    default:
    91         printf("Bad type: %d ", metadataItem->type);
     98        printf("Bad type: 0x%08x ", metadataItem->type);
    9299    }
    93100    printf("Key Comment: %s\n", metadataItem->comment);
  • trunk/psLib/test/astronomy/tst_psMetadata_01.c

    r3381 r3407  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-03-07 20:58:50 $
     20*  @version $Revision: 1.23 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-03-11 20:38:56 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7272{
    7373    printf("%sKey Name: %8s  ", spaces, metadataItem->name);
    74     printf("Key mdType: %d  ", metadataItem->type);
     74    printf("Key mdType: 0x%08x  ", metadataItem->type);
    7575
    7676    switch (metadataItem->type) {
     
    126126    printFooter(stdout, "psMetadata", "Test A - Read 1st hdr from simple FITS file", true);
    127127
     128    printf("ID=%d\n",(int)psMemGetId());
    128129
    129130    // Test B - Read 2nd hdr from complex FITS file
     
    173174    printFooter(stdout, "psMetadata", "Test B - Read 2nd hdr from complex FITS file", true);
    174175
     176    printf("ID=%d\n",(int)psMemGetId());
    175177
    176178    // Test C - Read named hdr from complex FITS file
  • trunk/psLib/test/astronomy/tst_psMetadata_02.c

    r3381 r3407  
    1515 *  @author  Robert DeSonia, MHPCC
    1616 *
    17  *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2005-03-07 20:58:50 $
     17 *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2005-03-11 20:38:56 $
    1919 *
    2020 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929{
    3030    printf("Key Name: %8s  ", metadataItem->name);
    31     printf("Key mdType: %2d  ", metadataItem->type);
     31    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3232
    3333    switch (metadataItem->type) {
     
    9898    printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
    9999                            "Invalid psMetadataType: 6", 0);
    100     badItem = psMetadataItemAlloc("badItem", PS_META_NTYPE, "I am bad", "Bad comment");
     100    badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment");
    101101    printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
    102102
  • trunk/psLib/test/astronomy/tst_psMetadata_03.c

    r3381 r3407  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-03-07 20:58:50 $
     20*  @version $Revision: 1.16 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-03-11 20:38:56 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232{
    3333    printf("Key Name: %8s  ", metadataItem->name);
    34     printf("Key mdType: %2d  ", metadataItem->type);
     34    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3535
    3636    switch (metadataItem->type) {
  • trunk/psLib/test/astronomy/tst_psMetadata_04.c

    r3381 r3407  
    2323*  @author  Ross Harman, MHPCC
    2424*
    25 *  @version $Revision: 1.16 $  $Name: not supported by cvs2svn $
    26 *  @date  $Date: 2005-03-07 20:58:50 $
     25*  @version $Revision: 1.17 $  $Name: not supported by cvs2svn $
     26*  @date  $Date: 2005-03-11 20:38:56 $
    2727*
    2828*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737{
    3838    printf("Key Name: %8s  ", metadataItem->name);
    39     printf("Key mdType: %2d  ", metadataItem->type);
     39    printf("Key mdType: 0x%08x  ", metadataItem->type);
    4040
    4141    switch (metadataItem->type) {
  • trunk/psLib/test/astronomy/tst_psMetadata_05.c

    r3381 r3407  
    2222*  @author  Ross Harman, MHPCC
    2323*
    24 *  @version $Revision: 1.21 $  $Name: not supported by cvs2svn $
    25 *  @date  $Date: 2005-03-07 20:58:50 $
     24*  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
     25*  @date  $Date: 2005-03-11 20:38:56 $
    2626*
    2727*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636{
    3737    printf("Key Name: %8s  ", metadataItem->name);
    38     printf("Key mdType: %2d  ", metadataItem->type);
     38    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3939
    4040    switch (metadataItem->type) {
  • trunk/psLib/test/astronomy/tst_psMetadata_06.c

    r3381 r3407  
    1313*  @author  Ross Harman, MHPCC
    1414*
    15 *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
    16 *  @date  $Date: 2005-03-07 20:58:50 $
     15*  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
     16*  @date  $Date: 2005-03-11 20:38:56 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2727{
    2828    printf("Key Name: %8s  ", metadataItem->name);
    29     printf("Key mdType: %2d  ", metadataItem->type);
     29    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3030
    3131    switch (metadataItem->type) {
  • trunk/psLib/test/astronomy/verified/tst_psMetadataIO.stdout

    r3381 r3407  
    77Failed lines: 6 Expected: 6
    88Contents of metadata list:
    9  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    10  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    11  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    12  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    13  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
    14  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    15  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    16  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    17  Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    18  Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    19  Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    20  Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    21  Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    22  Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    23  Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    24  Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    25  Key Name:    speed  Key mdType: 1 Key Value:          66.660  Key Comment:
     9 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     10 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     11 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     12 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     13 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
     14 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     15 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     16 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     17 Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     18 Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     19 Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     20 Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     21 Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     22 Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     23 Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     24 Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     25 Key Name:    speed  Key mdType: 0x00000404 Key Value:          66.660  Key Comment:
    2626
    2727Contents of metadata table:
    28  Key Name:  comment  Key mdType: 14 Key Value:                  Key Comment:
    29     Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    30     Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    31     Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    32     Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    33     Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    34     Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    35     Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    36     Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    37  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    38  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    39  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    40  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    41  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    42  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    43  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    44  Key Name:    speed  Key mdType: 1 Key Value:          66.660  Key Comment:
    45  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
     28 Key Name:  comment  Key mdType: 0x0001000a Key Value:                  Key Comment:
     29    Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     30    Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     31    Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     32    Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     33    Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     34    Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     35    Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     36    Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     37 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     38 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     39 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     40 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     41 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     42 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     43 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     44 Key Name:    speed  Key mdType: 0x00000404 Key Value:          66.660  Key Comment:
     45 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
    4646
    4747---> TESTPOINT PASSED (psMetadata{Test A - Read config file with overwrite set true} | tst_psMetadataIO.c)
     
    5454
    5555Failed lines: 7 Expected: 7 Contents of metadata list:
    56  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    57  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    58  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    59  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    60  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
    61  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    62  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    63  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    64  Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    65  Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    66  Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    67  Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    68  Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    69  Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    70  Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    71  Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    72  Key Name:    speed  Key mdType: 1 Key Value:          55.550  Key Comment:
     56 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     57 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     58 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     59 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     60 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
     61 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     62 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     63 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     64 Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     65 Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     66 Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     67 Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     68 Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     69 Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     70 Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     71 Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     72 Key Name:    speed  Key mdType: 0x00000404 Key Value:          55.550  Key Comment:
    7373
    7474Contents of metadata table:
    75  Key Name:  comment  Key mdType: 14 Key Value:                  Key Comment:
    76     Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    77     Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    78     Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    79     Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    80     Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    81     Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    82     Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    83     Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    84  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    85  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    86  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    87  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    88  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    89  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    90  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    91  Key Name:    speed  Key mdType: 1 Key Value:          55.550  Key Comment:
    92  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
     75 Key Name:  comment  Key mdType: 0x0001000a Key Value:                  Key Comment:
     76    Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     77    Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     78    Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     79    Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     80    Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     81    Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     82    Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     83    Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     84 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     85 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     86 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     87 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     88 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     89 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     90 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     91 Key Name:    speed  Key mdType: 0x00000404 Key Value:          55.550  Key Comment:
     92 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
    9393
    9494---> TESTPOINT PASSED (psMetadata{Test B - Read config file with overwrite set false} | tst_psMetadataIO.c)
     
    101101
    102102Failed lines: 6 Expected: 6 Contents of metadata list:
    103  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    104  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    105  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    106  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    107  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
    108  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    109  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    110  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    111  Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    112  Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    113  Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    114  Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    115  Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    116  Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    117  Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    118  Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    119  Key Name:    speed  Key mdType: 1 Key Value:          66.660  Key Comment:
     103 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     104 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     105 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     106 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     107 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
     108 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     109 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     110 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     111 Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     112 Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     113 Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     114 Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     115 Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     116 Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     117 Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     118 Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     119 Key Name:    speed  Key mdType: 0x00000404 Key Value:          66.660  Key Comment:
    120120
    121121Contents of metadata table:
    122  Key Name:  comment  Key mdType: 14 Key Value:                  Key Comment:
    123     Key Name:  comment  Key mdType: 5 Key Value:            This  Key Comment:
    124     Key Name:  comment  Key mdType: 5 Key Value:              is  Key Comment:
    125     Key Name:  comment  Key mdType: 5 Key Value:              an  Key Comment:
    126     Key Name:  comment  Key mdType: 5 Key Value:            ugly  Key Comment:
    127     Key Name:  comment  Key mdType: 5 Key Value:         comment  Key Comment:
    128     Key Name:  comment  Key mdType: 5 Key Value:             but  Key Comment:
    129     Key Name:  comment  Key mdType: 5 Key Value:           still  Key Comment:
    130     Key Name:  comment  Key mdType: 5 Key Value:           valid  Key Comment:
    131  Key Name:   title2  Key mdType: 5 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
    132  Key Name:     time  Key mdType: 1 Key Value:        1234.568  Key Comment:
    133  Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment:
    134  Key Name:       pi  Key mdType: 2 Key Value:           3.142  Key Comment: Definition of pi
    135  Key Name:   myBool  Key mdType: 3 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
    136  Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
    137  Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment:
    138  Key Name:    speed  Key mdType: 1 Key Value:          66.660  Key Comment:
    139  Key Name:   title1  Key mdType: 5 Key Value:     Hello world  Key Comment: This is a comment for the string value
     122 Key Name:  comment  Key mdType: 0x0001000a Key Value:                  Key Comment:
     123    Key Name:  comment  Key mdType: 0x00010001 Key Value:            This  Key Comment:
     124    Key Name:  comment  Key mdType: 0x00010001 Key Value:              is  Key Comment:
     125    Key Name:  comment  Key mdType: 0x00010001 Key Value:              an  Key Comment:
     126    Key Name:  comment  Key mdType: 0x00010001 Key Value:            ugly  Key Comment:
     127    Key Name:  comment  Key mdType: 0x00010001 Key Value:         comment  Key Comment:
     128    Key Name:  comment  Key mdType: 0x00010001 Key Value:             but  Key Comment:
     129    Key Name:  comment  Key mdType: 0x00010001 Key Value:           still  Key Comment:
     130    Key Name:  comment  Key mdType: 0x00010001 Key Value:           valid  Key Comment:
     131 Key Name:   title2  Key mdType: 0x00010001 Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
     132 Key Name:     time  Key mdType: 0x00000404 Key Value:        1234.568  Key Comment:
     133 Key Name: negatives  Key mdType: 0x00010002 Key Value:  [-1,-2,-3,...] Key Comment:
     134 Key Name:       pi  Key mdType: 0x00000408 Key Value:           3.142  Key Comment: Definition of pi
     135 Key Name:   myBool  Key mdType: 0x00001301 Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
     136 Key Name:   primes  Key mdType: 0x00010002 Key Value:   [2,3,5,7,...] Key Comment: These are prime numbers
     137 Key Name: altitude  Key mdType: 0x00000104 Key Value:           10000  Key Comment:
     138 Key Name:    speed  Key mdType: 0x00000404 Key Value:          66.660  Key Comment:
     139 Key Name:   title1  Key mdType: 0x00010001 Key Value:     Hello world  Key Comment: This is a comment for the string value
    140140
    141141---> TESTPOINT PASSED (psMetadata{Test C - Read config file without auto-allocation of metadata} | tst_psMetadataIO.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_01.stdout

    r3381 r3407  
    66
    77Contents of metadata list:
    8  Key Name:   SIMPLE  Key mdType: 3  Key Value:               1  Key Comment: file does conform to FITS standard
    9  Key Name:   BITPIX  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
    10  Key Name:    NAXIS  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
    11  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     8 Key Name:   SIMPLE  Key mdType: 0x00001301  Key Value:               1  Key Comment: file does conform to FITS standard
     9 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:               8  Key Comment: number of bits per data pixel
     10 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               0  Key Comment: number of data axes
     11 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    1212
    1313Contents of metadata table:
    14  Key Name:    NAXIS  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
    15  Key Name:   SIMPLE  Key mdType: 3  Key Value:               1  Key Comment: file does conform to FITS standard
    16  Key Name:   BITPIX  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
    17  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     14 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               0  Key Comment: number of data axes
     15 Key Name:   SIMPLE  Key mdType: 0x00001301  Key Value:               1  Key Comment: file does conform to FITS standard
     16 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:               8  Key Comment: number of bits per data pixel
     17 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    1818
    1919---> TESTPOINT PASSED (psMetadata{Test A - Read 1st hdr from simple FITS file} | tst_psMetadata_01.c)
    2020
     21ID=34
    2122/***************************** TESTPOINT ******************************************\
    2223*             TestFile: tst_psMetadata_01.c                                        *
     
    2627
    2728Contents of metadata list:
    28  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    29  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    30  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    31  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    32  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    33  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    34  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    35  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_1'  Key Comment:
    36  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    37  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    38  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    39  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     29 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     30 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     31 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     32 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     33 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     34 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     35 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     36 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_1'  Key Comment:
     37 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     38 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     39 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     40 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    4041
    4142Contents of metadata table:
    42  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    43  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    44  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    45  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    46  Key Name:   BITPIX  Key mdType: 14  Key Value:                  Key Comment:
    47     Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    48     Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    49  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    50  Key Name:  HISTORY  Key mdType: 14  Key Value:                  Key Comment:
    51     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    52     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    53     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    54     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    55  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_1'  Key Comment:
     43 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     44 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     45 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     46 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     47 Key Name:   BITPIX  Key mdType: 0x0001000a  Key Value:                  Key Comment:
     48    Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     49    Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     50 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     51 Key Name:  HISTORY  Key mdType: 0x0001000a  Key Value:                  Key Comment:
     52    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     53    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     54    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     55    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     56 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_1'  Key Comment:
    5657
    5758---> TESTPOINT PASSED (psMetadata{Test B - Read 2nd hdr from complex FITS file} | tst_psMetadata_01.c)
    5859
     60ID=138
    5961/***************************** TESTPOINT ******************************************\
    6062*             TestFile: tst_psMetadata_01.c                                        *
     
    6466
    6567Contents of metadata list:
    66  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    67  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    68  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    69  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    70  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    71  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    72  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment:
    73  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    74  Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     68 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     69 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     70 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     71 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     72 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     73 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     74 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
     75 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     76 Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    7577
    7678Contents of metadata table:
    77  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    78  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    79  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    80  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    81  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    82  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    83  Key Name:  HISTORY  Key mdType: 14  Key Value:                  Key Comment:
    84     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    85     Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    86  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment:
     79 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     80 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     81 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     82 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     83 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     84 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     85 Key Name:  HISTORY  Key mdType: 0x0001000a  Key Value:                  Key Comment:
     86    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     87    Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     88 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
    8789
    8890---> TESTPOINT PASSED (psMetadata{Test C - Read named hdr from complex FITS file} | tst_psMetadata_01.c)
     
    9799
    98100Contents of metadata list:
    99  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    100  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    101  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    102  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    103  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    104  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    105  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment:
     101 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     102 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     103 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     104 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     105 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     106 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     107 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
    106108
    107109Contents of metadata table:
    108  Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
    109  Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
    110  Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
    111  Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    112  Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
    113  Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
    114  Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment:
     110 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     111 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
     112 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
     113 Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     114 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
     115 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
     116 Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
    115117
    116118---> TESTPOINT PASSED (psMetadata{Test D - Remove items with same name from all metadata} | tst_psMetadata_01.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stderr

    r3381 r3407  
    44    Unallowable operation: name is NULL.
    55<DATE><TIME>|<HOST>|E|psMetadataItemAllocV (FILE:LINENO)
    6     Specified psMetadataType, 15, is not supported.
     6    Specified psMetadataType, -1, is not supported.
    77<DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
    88    Unallowable operation: md is NULL.
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stdout

    r3341 r3407  
    55\**********************************************************************************/
    66
    7 Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
    8 Key Name:  myItem2  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
    9 Key Name:  myItem3  Key mdType:  1  Key Value:         222.222  Key Comment: I am a single precision floating point
    10 Key Name:  myItem4  Key mdType:  2  Key Value:         333.333  Key Comment: I am a double precision floating point
    11 Key Name:  myItem5  Key mdType:  5  Key Value:     HELLO WORLD  Key Comment: I am a string
     7Key Name:  myItem1  Key mdType: 0x00001301  Key Value:               1  Key Comment: I am a boolean
     8Key Name:  myItem2  Key mdType: 0x00000104  Key Value:             111  Key Comment: I am a signed integer
     9Key Name:  myItem3  Key mdType: 0x00000404  Key Value:         222.222  Key Comment: I am a single precision floating point
     10Key Name:  myItem4  Key mdType: 0x00000408  Key Value:         333.333  Key Comment: I am a double precision floating point
     11Key Name:  myItem5  Key mdType: 0x00010001  Key Value:     HELLO WORLD  Key Comment: I am a string
    1212
    1313---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_02.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_03.stdout

    r3341 r3407  
    55\**********************************************************************************/
    66
    7 Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
    8 Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
    9 Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
    10 Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
     7Key Name:  myItem1  Key mdType: 0x00001301  Key Value:               1  Key Comment: I am a boolean
     8Key Name:  myItem2  Key mdType: 0x00000104  Key Value:              55  Key Comment: I am a integer
     9Key Name:  myItem3  Key mdType: 0x00001301  Key Value:               0  Key Comment: I am a boolean
     10Key Name:  myItem4  Key mdType: 0x00000104  Key Value:              66  Key Comment: I am a integer
    1111
    1212---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_03.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_04.stdout

    r3341 r3407  
    55\**********************************************************************************/
    66
    7 Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
    8 Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
    9 Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
    10 Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
    11 Key Name:  myItem5  Key mdType:  2  Key Value:           3.140  Key Comment: I am a double
     7Key Name:  myItem1  Key mdType: 0x00001301  Key Value:               1  Key Comment: I am a boolean
     8Key Name:  myItem2  Key mdType: 0x00000104  Key Value:              55  Key Comment: I am a integer
     9Key Name:  myItem3  Key mdType: 0x00001301  Key Value:               0  Key Comment: I am a boolean
     10Key Name:  myItem4  Key mdType: 0x00000104  Key Value:              66  Key Comment: I am a integer
     11Key Name:  myItem5  Key mdType: 0x00000408  Key Value:           3.140  Key Comment: I am a double
    1212
    1313---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_04.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_05.stdout

    r3341 r3407  
    55\**********************************************************************************/
    66
    7 Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
    8 Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
    9 Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
    10 Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
     7Key Name:  myItem1  Key mdType: 0x00001301  Key Value:               1  Key Comment: I am a boolean
     8Key Name:  myItem2  Key mdType: 0x00000104  Key Value:              55  Key Comment: I am a integer
     9Key Name:  myItem3  Key mdType: 0x00001301  Key Value:               0  Key Comment: I am a boolean
     10Key Name:  myItem4  Key mdType: 0x00000104  Key Value:              66  Key Comment: I am a integer
    1111
    1212---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_05.c)
  • trunk/psLib/test/astronomy/verified/tst_psMetadata_06.stdout

    r3381 r3407  
    55\**********************************************************************************/
    66
    7 Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
    8 Key Name:  myItem1  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
    9 Key Name:  myItem1  Key mdType:  0  Key Value:             222  Key Comment: I am a signed integer
    10 Key Name:  myItem2  Key mdType:  0  Key Value:             333  Key Comment: I am a signed integer
    11 Key Name:  myItem2  Key mdType:  4  Key Value:          psList  Key Comment: I am a list
     7Key Name:  myItem1  Key mdType: 0x00001301  Key Value:               1  Key Comment: I am a boolean
     8Key Name:  myItem1  Key mdType: 0x00000104  Key Value:             111  Key Comment: I am a signed integer
     9Key Name:  myItem1  Key mdType: 0x00000104  Key Value:             222  Key Comment: I am a signed integer
     10Key Name:  myItem2  Key mdType: 0x00000104  Key Value:             333  Key Comment: I am a signed integer
     11Key Name:  myItem2  Key mdType: 0x00010000  Key Value:          psList  Key Comment: I am a list
    1212
    1313---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata and items} | tst_psMetadata_06.c)
  • trunk/psLib/test/collections/tst_psMetadataIO.c

    r3381 r3407  
    1414 *  @author  Robert DeSonia, MHPCC
    1515 *
    16  *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-03-07 20:58:50 $
     16 *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-03-11 20:38:56 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6666static void printMetadataItem(psMetadataItem *metadataItem, char *spaces)
    6767{
     68    char* vecStr;
     69
    6870    printf("%sKey Name: %8s  ", spaces, metadataItem->name);
    69     printf("Key mdType: %d ", metadataItem->type);
     71    printf("Key mdType: 0x%08x ", metadataItem->type);
    7072
    7173    switch (metadataItem->type) {
     
    8587        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    8688        break;
     89    case PS_META_VEC:
     90        vecStr = (char*)psVectorToString((psVector*)metadataItem->data.V, 15);
     91        printf("Key Value: %15s  ", vecStr);
     92        psFree(vecStr);
     93        break;
    8794    case PS_META_STR:
    8895        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    8996        break;
    9097    default:
    91         printf("Bad type: %d ", metadataItem->type);
     98        printf("Bad type: 0x%08x ", metadataItem->type);
    9299    }
    93100    printf("Key Comment: %s\n", metadataItem->comment);
  • trunk/psLib/test/collections/tst_psMetadata_01.c

    r3381 r3407  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-03-07 20:58:50 $
     20*  @version $Revision: 1.23 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-03-11 20:38:56 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7272{
    7373    printf("%sKey Name: %8s  ", spaces, metadataItem->name);
    74     printf("Key mdType: %d  ", metadataItem->type);
     74    printf("Key mdType: 0x%08x  ", metadataItem->type);
    7575
    7676    switch (metadataItem->type) {
     
    126126    printFooter(stdout, "psMetadata", "Test A - Read 1st hdr from simple FITS file", true);
    127127
     128    printf("ID=%d\n",(int)psMemGetId());
    128129
    129130    // Test B - Read 2nd hdr from complex FITS file
     
    173174    printFooter(stdout, "psMetadata", "Test B - Read 2nd hdr from complex FITS file", true);
    174175
     176    printf("ID=%d\n",(int)psMemGetId());
    175177
    176178    // Test C - Read named hdr from complex FITS file
  • trunk/psLib/test/collections/tst_psMetadata_02.c

    r3381 r3407  
    1515 *  @author  Robert DeSonia, MHPCC
    1616 *
    17  *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2005-03-07 20:58:50 $
     17 *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2005-03-11 20:38:56 $
    1919 *
    2020 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929{
    3030    printf("Key Name: %8s  ", metadataItem->name);
    31     printf("Key mdType: %2d  ", metadataItem->type);
     31    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3232
    3333    switch (metadataItem->type) {
     
    9898    printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
    9999                            "Invalid psMetadataType: 6", 0);
    100     badItem = psMetadataItemAlloc("badItem", PS_META_NTYPE, "I am bad", "Bad comment");
     100    badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment");
    101101    printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
    102102
  • trunk/psLib/test/collections/tst_psMetadata_03.c

    r3381 r3407  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-03-07 20:58:50 $
     20*  @version $Revision: 1.16 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-03-11 20:38:56 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232{
    3333    printf("Key Name: %8s  ", metadataItem->name);
    34     printf("Key mdType: %2d  ", metadataItem->type);
     34    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3535
    3636    switch (metadataItem->type) {
  • trunk/psLib/test/collections/tst_psMetadata_04.c

    r3381 r3407  
    2323*  @author  Ross Harman, MHPCC
    2424*
    25 *  @version $Revision: 1.16 $  $Name: not supported by cvs2svn $
    26 *  @date  $Date: 2005-03-07 20:58:50 $
     25*  @version $Revision: 1.17 $  $Name: not supported by cvs2svn $
     26*  @date  $Date: 2005-03-11 20:38:56 $
    2727*
    2828*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737{
    3838    printf("Key Name: %8s  ", metadataItem->name);
    39     printf("Key mdType: %2d  ", metadataItem->type);
     39    printf("Key mdType: 0x%08x  ", metadataItem->type);
    4040
    4141    switch (metadataItem->type) {
  • trunk/psLib/test/collections/tst_psMetadata_05.c

    r3381 r3407  
    2222*  @author  Ross Harman, MHPCC
    2323*
    24 *  @version $Revision: 1.21 $  $Name: not supported by cvs2svn $
    25 *  @date  $Date: 2005-03-07 20:58:50 $
     24*  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
     25*  @date  $Date: 2005-03-11 20:38:56 $
    2626*
    2727*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636{
    3737    printf("Key Name: %8s  ", metadataItem->name);
    38     printf("Key mdType: %2d  ", metadataItem->type);
     38    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3939
    4040    switch (metadataItem->type) {
  • trunk/psLib/test/collections/tst_psMetadata_06.c

    r3381 r3407  
    1313*  @author  Ross Harman, MHPCC
    1414*
    15 *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
    16 *  @date  $Date: 2005-03-07 20:58:50 $
     15*  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
     16*  @date  $Date: 2005-03-11 20:38:56 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2727{
    2828    printf("Key Name: %8s  ", metadataItem->name);
    29     printf("Key mdType: %2d  ", metadataItem->type);
     29    printf("Key mdType: 0x%08x  ", metadataItem->type);
    3030
    3131    switch (metadataItem->type) {
Note: See TracChangeset for help on using the changeset viewer.