Ignore:
Timestamp:
Aug 16, 2003, 6:41:03 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/ltmain.sh

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r604 r605  
    22# NOTE: Changing this file will not affect anything until you rerun ltconfig.
    33#
    4 # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
     4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
     5# Free Software Foundation, Inc.
    56# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    67#
     
    5556PROGRAM=ltmain.sh
    5657PACKAGE=libtool
    57 VERSION=1.4a
    58 TIMESTAMP=" (1.641.2.122 2000/09/30 05:27:52)"
     58VERSION=1.4a-GCC3.0
     59TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
    5960
    6061default_mode=
     
    107108lo2o="s/\\.lo\$/.${objext}/"
    108109o2lo="s/\\.${objext}\$/.lo/"
     110taglist=
    109111
    110112# Parse our command line options once, thoroughly.
     
    114116  shift
    115117
    116   case "$arg" in
     118  case $arg in
    117119  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
    118120  *) optarg= ;;
     
    121123  # If the previous option needs an argument, assign it.
    122124  if test -n "$prev"; then
    123     case "$prev" in
     125    case $prev in
    124126    execute_dlfiles)
    125       eval "$prev=\"\$$prev \$arg\""
     127      execute_dlfiles="$execute_dlfiles $arg"
    126128      ;;
    127129    tag)
     
    129131
    130132      # Check whether tagname contains only valid characters
    131       case "$tagname" in
     133      case $tagname in
    132134      *[!-_A-Za-z0-9,/]*)
    133135        echo "$progname: invalid tag name: $tagname" 1>&2
     
    136138      esac
    137139
    138       if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
    139         taglist="$taglist $tagname"
    140         # Evaluate the configuration.
    141         eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
    142       else
    143         echo "$progname: ignoring unknown tag $tagname" 1>&2
    144       fi
     140      case $tagname in
     141      CC)
     142        # Don't test for the "default" C tag, as we know, it's there, but
     143        # not specially marked.
     144        taglist="$taglist $tagname"
     145        ;;
     146      *)
     147        if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
     148          taglist="$taglist $tagname"
     149          # Evaluate the configuration.
     150          eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
     151        else
     152          echo "$progname: ignoring unknown tag $tagname" 1>&2
     153        fi
     154        ;;
     155      esac
    145156      ;;
    146157    *)
     
    155166
    156167  # Have we seen a non-optional argument yet?
    157   case "$arg" in
     168  case $arg in
    158169  --help)
    159170    show_help=yes
     
    238249fi
    239250
     251# If this variable is set in any of the actions, the command in it
     252# will be execed at the end.  This prevents here-documents from being
     253# left over by shells.
     254exec_cmd=
     255
    240256if test -z "$show_help"; then
    241257
    242258  # Infer the operation mode.
    243259  if test -z "$mode"; then
    244     case "$nonopt" in
     260    case $nonopt in
    245261    *cc | *++ | gcc* | *-gcc*)
    246262      mode=link
    247263      for arg
    248264      do
    249         case "$arg" in
     265        case $arg in
    250266        -c)
    251267           mode=compile
     
    292308
    293309  # These modes are in order of execution frequency so that they run quickly.
    294   case "$mode" in
     310  case $mode in
    295311  # libtool compile mode
    296312  compile)
     
    306322    for arg
    307323    do
    308       case "$prev" in
     324      case $prev in
    309325      "") ;;
    310326      xcompiler)
     
    313329        lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    314330
    315         case "$arg" in
     331        case $arg in
    316332        # Double-quote args containing other shell metacharacters.
    317333        # Many Bourne shells cannot handle close brackets correctly
     
    333349
    334350      # Accept any command-line options.
    335       case "$arg" in
     351      case $arg in
    336352      -o)
    337353        if test "$user_target" != "no"; then
     
    372388          # Many Bourne shells cannot handle close brackets correctly
    373389          # in scan sets, so we specify it separately.
    374           case "$arg" in
     390          case $arg in
    375391            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
    376392            arg="\"$arg\""
     
    392408      esac
    393409
    394       case "$user_target" in
     410      case $user_target in
    395411      next)
    396412        # The next one is the -o target name
     
    420436      # Many Bourne shells cannot handle close brackets correctly
    421437      # in scan sets, so we specify it separately.
    422       case "$lastarg" in
     438      case $lastarg in
    423439      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    424440        lastarg="\"$lastarg\""
     
    434450    done
    435451
    436     case "$user_target" in
     452    case $user_target in
    437453    set)
    438454      ;;
     
    450466    # If the user specifies -o file.o, it is replaced with file.lo
    451467    xform='[cCFSfmso]'
    452     case "$libobj" in
     468    case $libobj in
    453469    *.ada) xform=ada ;;
    454470    *.adb) xform=adb ;;
     
    467483    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
    468484
    469     case "$libobj" in
     485    case $libobj in
    470486    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
    471487    *)
     
    545561
    546562    # On Cygwin there's no "real" PIC flag so we must build both object types
    547     case "$host_os" in
     563    case $host_os in
    548564    cygwin* | mingw* | pw32* | os2*)
    549565      pic_mode=default
     
    778794  link | relink)
    779795    modename="$modename: link"
    780     case "$host" in
     796    case $host in
    781797    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
    782798      # It is impossible to link a dll without this setting, and
     
    844860    for arg
    845861    do
    846       case "$arg" in
     862      case $arg in
    847863      -all-static | -static)
    848864        if test "X$arg" = "X-all-static"; then
     
    874890      base_compile="$base_compile $arg"
    875891      shift
    876       case "$arg" in
     892      case $arg in
    877893      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    878894        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
     
    884900      # If the previous option needs an argument, assign it.
    885901      if test -n "$prev"; then
    886         case "$prev" in
     902        case $prev in
    887903        output)
    888904          compile_command="$compile_command @OUTPUT@"
     
    891907        esac
    892908
    893         case "$prev" in
     909        case $prev in
    894910        dlfiles|dlprefiles)
    895911          if test "$preload" = no; then
     
    899915            preload=yes
    900916          fi
    901           case "$arg" in
     917          case $arg in
    902918          *.la | *.lo) ;;  # We handle these cases below.
    903919          force)
     
    951967          continue
    952968          ;;
     969        objectlist)
     970          if test -f "$arg"; then
     971            save_arg=$arg
     972            moreargs=
     973            for fil in `cat $save_arg`
     974            do
     975#             moreargs="$moreargs $fil"
     976              arg=$fil
     977              # A libtool-controlled object.
     978
     979              # Check to see that this really is a libtool object.
     980              if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     981                pic_object=
     982                non_pic_object=
     983
     984                # Read the .lo file
     985                # If there is no directory component, then add one.
     986                case $arg in
     987                */* | *\\*) . $arg ;;
     988                *) . ./$arg ;;
     989                esac
     990
     991                if test -z "$pic_object" || \
     992                   test -z "$non_pic_object" ||
     993                   test "$pic_object" = none && \
     994                   test "$non_pic_object" = none; then
     995                  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
     996                  exit 1
     997                fi
     998
     999                # Extract subdirectory from the argument.
     1000                xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
     1001                if test "X$xdir" = "X$arg"; then
     1002                  xdir=
     1003                else
     1004                  xdir="$xdir/"
     1005                fi
     1006
     1007                if test "$pic_object" != none; then
     1008                  # Prepend the subdirectory the object is found in.
     1009                  pic_object="$xdir$pic_object"
     1010
     1011                  if test "$prev" = dlfiles; then
     1012                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
     1013                      dlfiles="$dlfiles $pic_object"
     1014                      prev=
     1015                      continue
     1016                    else
     1017                      # If libtool objects are unsupported, then we need to preload.
     1018                      prev=dlprefiles
     1019                    fi
     1020                  fi
     1021
     1022                  # CHECK ME:  I think I busted this.  -Ossama
     1023                  if test "$prev" = dlprefiles; then
     1024                    # Preload the old-style object.
     1025                    dlprefiles="$dlprefiles $pic_object"
     1026                    prev=
     1027                  fi
     1028
     1029                  # A PIC object.
     1030                  libobjs="$libobjs $pic_object"
     1031                  arg="$pic_object"
     1032                fi
     1033
     1034                # Non-PIC object.
     1035                if test "$non_pic_object" != none; then
     1036                  # Prepend the subdirectory the object is found in.
     1037                  non_pic_object="$xdir$non_pic_object"
     1038
     1039                  # A standard non-PIC object
     1040                  non_pic_objects="$non_pic_objects $non_pic_object"
     1041                  if test -z "$pic_object" || test "$pic_object" = none ; then
     1042                    arg="$non_pic_object"
     1043                  fi
     1044                fi
     1045              else
     1046                # Only an error if not doing a dry-run.
     1047                if test -z "$run"; then
     1048                  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
     1049                  exit 1
     1050                else
     1051                  # Dry-run case.
     1052
     1053                  # Extract subdirectory from the argument.
     1054                  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
     1055                  if test "X$xdir" = "X$arg"; then
     1056                    xdir=
     1057                  else
     1058                    xdir="$xdir/"
     1059                  fi
     1060
     1061                  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
     1062                  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
     1063                  libobjs="$libobjs $pic_object"
     1064                  non_pic_objects="$non_pic_objects $non_pic_object"
     1065                fi
     1066              fi
     1067            done
     1068          else
     1069            $echo "$modename: link input file \`$save_arg' does not exist"
     1070            exit 1
     1071          fi
     1072          arg=$save_arg
     1073          prev=
     1074          continue
     1075          ;;
    9531076        rpath | xrpath)
    9541077          # We need an absolute path.
    955           case "$arg" in
     1078          case $arg in
    9561079          [\\/]* | [A-Za-z]:[\\/]*) ;;
    9571080          *)
     
    9951118          ;;
    9961119        esac
    997       fi
     1120      fi # test -n $prev
    9981121
    9991122      prevarg="$arg"
    10001123
    1001       case "$arg" in
     1124      case $arg in
    10021125      -all-static)
    10031126        if test -n "$link_static_flag"; then
     
    10361159      -export-symbols | -export-symbols-regex)
    10371160        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
    1038           $echo "$modename: not more than one -exported-symbols argument allowed"
     1161          $echo "$modename: more than one -exported-symbols argument is not allowed"
    10391162          exit 1
    10401163        fi
     
    10581181        continue
    10591182        ;;
    1060        
     1183
    10611184      -L*)
    10621185        dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
    10631186        # We need an absolute path.
    1064         case "$dir" in
     1187        case $dir in
    10651188        [\\/]* | [A-Za-z]:[\\/]*) ;;
    10661189        *)
     
    10801203          ;;
    10811204        esac
    1082         case "$host" in
     1205        case $host in
    10831206        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
    1084           case ":$dllsearchpath:" in
     1207          case :$dllsearchpath: in
    10851208          *":$dir:"*) ;;
    10861209          *) dllsearchpath="$dllsearchpath:$dir";;
     
    10921215
    10931216      -l*)
    1094         if test "$arg" = "-lc"; then
    1095           case "$host" in
    1096           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
    1097             # These systems don't actually have c library (as such)
     1217        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
     1218          case $host in
     1219          *-*-cygwin* | *-*-pw32* | *-*-beos*)
     1220            # These systems don't actually have a C or math library (as such)
    10981221            continue
    10991222            ;;
    1100           esac
    1101         elif test "$arg" = "-lm"; then
    1102           case "$host" in
    1103           *-*-cygwin* | *-*-pw32* | *-*-beos*)
    1104             # These systems don't actually have math library (as such)
    1105             continue
     1223          *-*-mingw* | *-*-os2*)
     1224            # These systems don't actually have a C library (as such)
     1225            test "X$arg" = "X-lc" && continue
    11061226            ;;
    11071227          esac
     
    11221242
    11231243      -no-install)
    1124         case "$host" in
     1244        case $host in
    11251245        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
    11261246          # The PATH hackery in wrapper scripts is required on Windows
     
    11301250          fast_install=no
    11311251          ;;
    1132         *-*-rhapsody*)
    1133           # rhapsody is a little odd...
    1134           deplibs="$deplibs -framework System"
    1135           ;;
    1136         *)
    1137           no_install=yes
    1138           ;;
     1252        *) no_install=yes ;;
    11391253        esac
    11401254        continue
     
    11461260        ;;
    11471261
     1262      -objectlist)
     1263        prev=objectlist
     1264        continue
     1265        ;;
     1266
    11481267      -o) prev=output ;;
    11491268
     
    11661285        dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
    11671286        # We need an absolute path.
    1168         case "$dir" in
     1287        case $dir in
    11691288        [\\/]* | [A-Za-z]:[\\/]*) ;;
    11701289        *)
     
    11811300
    11821301      -static)
    1183         # The effects of -static are defined in a previous loop.
     1302        # The effects of -static are defined in a previous loop.
    11841303        # We used to do the same as -all-static on platforms that
    11851304        # didn't have a PIC flag, but the assumption that the effects
     
    12051324        for flag in $args; do
    12061325          IFS="$save_ifs"
    1207           case "$flag" in
     1326          case $flag in
    12081327            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
    12091328            flag="\"$flag\""
     
    12231342        for flag in $args; do
    12241343          IFS="$save_ifs"
    1225           case "$flag" in
     1344          case $flag in
    12261345            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
    12271346            flag="\"$flag\""
     
    12511370        # to be aesthetically quoted because they are evaled later.
    12521371        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    1253         case "$arg" in
     1372        case $arg in
    12541373        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
    12551374          arg="\"$arg\""
     
    12731392          # Read the .lo file
    12741393          # If there is no directory component, then add one.
    1275           case "$arg" in
     1394          case $arg in
    12761395          */* | *\\*) . $arg ;;
    12771396          *) . ./$arg ;;
     
    13851504        # to be aesthetically quoted because they are evaled later.
    13861505        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    1387         case "$arg" in
     1506        case $arg in
    13881507        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
    13891508          arg="\"$arg\""
     
    13911510        esac
    13921511        ;;
    1393       esac
     1512      esac # arg
    13941513
    13951514      # Now actually substitute the argument into the commands.
     
    13981517        finalize_command="$finalize_command $arg"
    13991518      fi
    1400     done
     1519    done # argument parsing loop
    14011520
    14021521    if test -n "$prev"; then
     
    14561575    fi
    14571576
    1458     oldlibs=
    14591577    # calculate the name of the file, without its directory
    14601578    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
     
    14871605
    14881606    # Determine the type of output
    1489     case "$output" in
     1607    case $output in
    14901608    "")
    14911609      $echo "$modename: you must specify an output file" 1>&2
     
    15121630    if test $linkmode = lib; then
    15131631      libs="$predeps $libs $compiler_lib_search_path $postdeps"
     1632
     1633      # Compute libraries that are listed more than once in $predeps
     1634      # $postdeps and mark them as special (i.e., whose duplicates are
     1635      # not to be eliminated).
     1636      pre_post_deps=
     1637      for pre_post_dep in $predeps $postdeps; do
     1638        case "$pre_post_deps " in
     1639        *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
     1640        esac
     1641        pre_post_deps="$pre_post_deps $pre_post_dep"
     1642      done
     1643      pre_post_deps=
    15141644    fi
    15151645
     
    15181648    newlib_search_path=
    15191649    need_relink=no # whether we're linking any uninstalled libtool libraries
    1520     uninst_deplibs= # uninstalled libtool libraries
    1521     uninst_path= # paths that contain uninstalled libtool libraries
     1650    notinst_deplibs= # not-installed libtool libraries
     1651    notinst_path= # paths that contain not-installed libtool libraries
    15221652    case $linkmode in
    15231653    lib)
    15241654        passes="conv link"
    15251655        for file in $dlfiles $dlprefiles; do
    1526           case "$file" in
     1656          case $file in
    15271657          *.la) ;;
    15281658          *)
     
    15411671        passes="conv scan dlopen dlpreopen link"
    15421672        ;;
    1543     *)  passes="conv"
     1673    *)  passes="conv"
    15441674        ;;
    15451675    esac
    15461676    for pass in $passes; do
    1547       if test "$linkmode,$pass" = "lib,link" ||
    1548          test "$linkmode,$pass" = "prog,scan"; then
    1549         libs="$deplibs"
    1550         deplibs=
    1551       fi
    15521677      if test $linkmode = prog; then
     1678        # Determine which files to process
    15531679        case $pass in
    1554         dlopen) libs="$dlfiles" ;;
     1680        dlopen)
     1681          libs="$dlfiles"
     1682          save_deplibs="$deplibs" # Collect dlpreopened libraries
     1683          deplibs=
     1684          ;;
    15551685        dlpreopen) libs="$dlprefiles" ;;
    15561686        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
    15571687        esac
    15581688      fi
    1559       if test $pass = dlopen; then
    1560         # Collect dlpreopened libraries
    1561         save_deplibs="$deplibs"
    1562         deplibs=
    1563       fi
    15641689      for deplib in $libs; do
    15651690        lib=
    15661691        found=no
    1567         case "$deplib" in
     1692        case $deplib in
    15681693        -l*)
    1569           if test $linkmode != lib && test $linkmode != prog; then
    1570             $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
     1694          if test $linkmode = oldlib && test $linkmode = obj; then
     1695            $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
    15711696            continue
    15721697          fi
     
    15851710          done
    15861711          if test "$found" != yes; then
     1712            # deplib doesn't seem to be a libtool library
    15871713            if test "$linkmode,$pass" = "prog,link"; then
    15881714              compile_deplibs="$deplib $compile_deplibs"
     
    15941720            continue
    15951721          fi
    1596           ;;
     1722          ;; # -l
    15971723        -L*)
    15981724          case $linkmode in
     
    16171743            ;;
    16181744          *)
    1619             $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
     1745            $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
    16201746            ;;
    1621           esac
     1747          esac # linkmode
    16221748          continue
    1623           ;;
     1749          ;; # -L
    16241750        -R*)
    16251751          if test $pass = link; then
     
    16651791            continue
    16661792            ;;
    1667           esac
    1668           ;;
     1793          esac # linkmode
     1794          ;; # *.$libext
    16691795        *.lo | *.$objext)
    1670           if test $pass = conv; then
    1671             deplibs="$deplib $deplibs"
    1672           elif test $linkmode = prog; then
    1673             if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
    1674               # If there is no dlopen support or we're linking statically,
    1675               # we need to preload.
    1676               newdlprefiles="$newdlprefiles $deplib"
    1677               compile_deplibs="$deplib $compile_deplibs"
    1678               finalize_deplibs="$deplib $finalize_deplibs"
    1679             else
    1680               newdlfiles="$newdlfiles $deplib"
    1681             fi
     1796          if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
     1797            # If there is no dlopen support or we're linking statically,
     1798            # we need to preload.
     1799            newdlprefiles="$newdlprefiles $deplib"
     1800            compile_deplibs="$deplib $compile_deplibs"
     1801            finalize_deplibs="$deplib $finalize_deplibs"
     1802          else
     1803            newdlfiles="$newdlfiles $deplib"
    16821804          fi
    16831805          continue
     
    16871809          continue
    16881810          ;;
    1689         esac
     1811        esac # case $deplib
    16901812        if test $found = yes || test -f "$lib"; then :
    16911813        else
     
    17151837
    17161838        # Read the .la file
    1717         case "$lib" in
     1839        case $lib in
    17181840        */* | *\\*) . $lib ;;
    17191841        *) . ./$lib ;;
     
    17221844        if test "$linkmode,$pass" = "lib,link" ||
    17231845           test "$linkmode,$pass" = "prog,scan" ||
    1724            { test $linkmode != prog && test $linkmode != lib; }; then
     1846           { test $linkmode = oldlib && test $linkmode = obj; }; then
     1847           # Add dl[pre]opened files of deplib
    17251848          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
    17261849          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
     
    17281851
    17291852        if test $pass = conv; then
    1730           # only check for convenience libraries
     1853          # Only check for convenience libraries
    17311854          deplibs="$lib $deplibs"
    17321855          if test -z "$libdir"; then
     
    17511874          fi
    17521875          continue
    1753         fi
     1876        fi # $pass = conv
    17541877
    17551878        # Get the name of the library we link against.
     
    17701893          fi
    17711894          if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
    1772             # If there is no dlname, no dlopen support or we're linking statically,
    1773             # we need to preload.
     1895            # If there is no dlname, no dlopen support or we're linking
     1896            # statically, we need to preload.
    17741897            dlprefiles="$dlprefiles $lib"
    17751898          else
     
    17771900          fi
    17781901          continue
    1779         fi
     1902        fi # $pass = dlopen
    17801903
    17811904        # We need an absolute path.
    1782         case "$ladir" in
     1905        case $ladir in
    17831906        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
    17841907        *)
     
    18081931          absdir="$abs_ladir/$objdir"
    18091932          # Remove this search path later
    1810           uninst_path="$uninst_path $abs_ladir"
    1811         fi
     1933          notinst_path="$notinst_path $abs_ladir"
     1934        fi # $installed = yes
    18121935        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    18131936
     
    18281951            newdlprefiles="$newdlprefiles $dir/$linklib"
    18291952          fi
    1830         fi
     1953        fi # $pass = dlpreopen
    18311954
    18321955        if test -z "$libdir"; then
    1833           # link the convenience library
     1956          # Link the convenience library
    18341957          if test $linkmode = lib; then
    18351958            deplibs="$dir/$old_library $deplibs"
     
    18381961            finalize_deplibs="$dir/$old_library $finalize_deplibs"
    18391962          else
    1840             deplibs="$lib $deplibs" # used for prog,scan pass
     1963            deplibs="$lib $deplibs"
    18411964          fi
    18421965          continue
     
    18551978          tmp_libs=
    18561979          for deplib in $dependency_libs; do
    1857             case "$deplib" in
     1980            case $deplib in
    18581981            -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
    18591982            esac
     
    18701993            esac
    18711994            tmp_libs="$tmp_libs $deplib"
    1872           done
     1995          done # for deplib
    18731996          continue
    1874         fi
    1875 
    1876         if test "$linkmode,$pass" = "prog,link"; then
    1877           if test -n "$library_names" &&
    1878              { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
    1879             # We need to hardcode the library path
    1880             if test -n "$shlibpath_var"; then
    1881               # Make sure the rpath contains only unique directories.
    1882               case "$temp_rpath " in
    1883               *" $dir "*) ;;
    1884               *" $absdir "*) ;;
    1885               *) temp_rpath="$temp_rpath $dir" ;;
    1886               esac
    1887             fi
    1888 
    1889             # Hardcode the library path.
    1890             # Skip directories that are in the system default run-time
    1891             # search path.
    1892             case " $sys_lib_dlsearch_path " in
    1893             *" $absdir "*) ;;
    1894             *)
    1895               case "$compile_rpath " in
    1896               *" $absdir "*) ;;
    1897               *) compile_rpath="$compile_rpath $absdir"
    1898               esac
    1899               ;;
    1900             esac
    1901 
    1902             case " $sys_lib_dlsearch_path " in
    1903             *" $libdir "*) ;;
    1904             *)
    1905               case "$finalize_rpath " in
    1906               *" $libdir "*) ;;
    1907               *) finalize_rpath="$finalize_rpath $libdir"
    1908               esac
    1909               ;;
    1910             esac
    1911           fi
    1912 
    1913           if test "$alldeplibs" = yes &&
    1914              { test "$deplibs_check_method" = pass_all ||
    1915                { test "$build_libtool_libs" = yes &&
    1916                  test -n "$library_names"; }; }; then
    1917             # We only need to search for static libraries
    1918             continue
    1919           fi
    1920         fi
     1997        fi # $linkmode = prog...
    19211998
    19221999        link_static=no # Whether the deplib will be linked statically
    19232000        if test -n "$library_names" &&
    19242001           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
    1925           if test "$installed" = no; then
    1926             uninst_deplibs="$uninst_deplibs $lib"
    1927             need_relink=yes
    1928           fi
    1929           # This is a shared library
    1930           if test $linkmode = lib &&
    1931              test $hardcode_into_libs = yes; then
     2002          # Link against this shared library
     2003
     2004          if test "$linkmode,$pass" = "prog,link" ||
     2005           { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
    19322006            # Hardcode the library path.
    19332007            # Skip directories that are in the system default run-time
     
    19512025              ;;
    19522026            esac
     2027            if test $linkmode = prog; then
     2028              # We need to hardcode the library path
     2029              if test -n "$shlibpath_var"; then
     2030                # Make sure the rpath contains only unique directories.
     2031                case "$temp_rpath " in
     2032                *" $dir "*) ;;
     2033                *" $absdir "*) ;;
     2034                *) temp_rpath="$temp_rpath $dir" ;;
     2035                esac
     2036              fi
     2037            fi
     2038          fi # $linkmode,$pass = prog,link...
     2039
     2040          if test "$alldeplibs" = yes &&
     2041             { test "$deplibs_check_method" = pass_all ||
     2042               { test "$build_libtool_libs" = yes &&
     2043                 test -n "$library_names"; }; }; then
     2044            # We only need to search for static libraries
     2045            continue
     2046          fi
     2047
     2048          if test "$installed" = no; then
     2049            notinst_deplibs="$notinst_deplibs $lib"
     2050            need_relink=yes
    19532051          fi
    19542052
     
    19592057            shift; shift
    19602058            libname=`eval \\$echo \"$libname_spec\"`
    1961             if test -n "$soname_spec"; then
     2059            # use dlname if we got it. it's perfectly good, no?
     2060            if test -n "$dlname"; then
     2061              soname="$dlname"
     2062            elif test -n "$soname_spec"; then
     2063              # bleh windows
     2064              case $host in
     2065              *cygwin*)
     2066                major=`expr $current - $age`
     2067                versuffix="-$major"
     2068                ;;
     2069              esac
    19622070              eval soname=\"$soname_spec\"
    19632071            else
     
    19662074
    19672075            # Make a new name for the extract_expsyms_cmds to use
     2076            soroot="$soname"
     2077            soname=`echo $soroot | sed -e 's/^.*\///'`
    19682078            newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
    19692079
     
    19972107            dir=$output_objdir
    19982108            linklib=$newlib
    1999           fi
     2109          fi # test -n $old_archive_from_expsyms_cmds
    20002110
    20012111          if test $linkmode = prog || test "$mode" != relink; then
     
    20042114            add=
    20052115            lib_linked=yes
    2006             case "$hardcode_action" in
     2116            case $hardcode_action in
    20072117            immediate | unsupported)
    20082118              if test "$hardcode_direct" = no; then
    20092119                add="$dir/$linklib"
    20102120              elif test "$hardcode_minus_L" = no; then
    2011                 case "$host" in
     2121                case $host in
    20122122                *-*-sunos*) add_shlibpath="$dir" ;;
    20132123                esac
     
    20432153
    20442154            if test -n "$add_shlibpath"; then
    2045               case ":$compile_shlibpath:" in
     2155              case :$compile_shlibpath: in
    20462156              *":$add_shlibpath:"*) ;;
    20472157              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
     
    20572167                 test "$hardcode_minus_L" != yes && \
    20582168                 test "$hardcode_shlibpath_var" = yes; then
    2059                 case ":$finalize_shlibpath:" in
     2169                case :$finalize_shlibpath: in
    20602170                *":$libdir:"*) ;;
    20612171                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
     
    20762186              add="-l$name"
    20772187            elif test "$hardcode_shlibpath_var" = yes; then
    2078               case ":$finalize_shlibpath:" in
     2188              case :$finalize_shlibpath: in
    20792189              *":$libdir:"*) ;;
    20802190              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
     
    20962206          fi
    20972207        elif test $linkmode = prog; then
     2208          if test "$alldeplibs" = yes &&
     2209             { test "$deplibs_check_method" = pass_all ||
     2210               { test "$build_libtool_libs" = yes &&
     2211                 test -n "$library_names"; }; }; then
     2212            # We only need to search for static libraries
     2213            continue
     2214          fi
     2215
     2216          # Try to link the static library
    20982217          # Here we assume that one of hardcode_direct or hardcode_minus_L
    20992218          # is not unsupported.  This is valid on all known static and
     
    21122231            # We're trying link a shared library against a static one
    21132232            # but the system doesn't support it.
     2233
    21142234            # Just print a warning and add the library to dependency_libs so
    21152235            # that the program can be linked against the static library.
     
    21192239            echo "*** you link to this library.  But I can only do this if you have a"
    21202240            echo "*** shared version of the library, which you do not appear to have."
     2241            if test "$module" = yes; then
     2242              echo "*** Therefore, libtool will create a static module, that should work "
     2243              echo "*** as long as the dlopening application is linked with the -dlopen flag."
     2244              if test -z "$global_symbol_pipe"; then
     2245                echo
     2246                echo "*** However, this would only work if libtool was able to extract symbol"
     2247                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
     2248                echo "*** not find such a program.  So, this module is probably useless."
     2249                echo "*** \`nm' from GNU binutils and a full rebuild may help."
     2250              fi
     2251              if test "$build_old_libs" = no; then
     2252                build_libtool_libs=module
     2253                build_old_libs=yes
     2254              else
     2255                build_libtool_libs=no
     2256              fi
     2257            fi
    21212258          else
    21222259            convenience="$convenience $dir/$old_library"
     
    21252262            link_static=yes
    21262263          fi
    2127         fi
     2264        fi # link shared/static library?
    21282265
    21292266        if test $linkmode = lib; then
     
    21342271            temp_deplibs=
    21352272            for libdir in $dependency_libs; do
    2136               case "$libdir" in
     2273              case $libdir in
    21372274              -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
    21382275                   case " $xrpath " in
     
    21622299            # Add the search paths of all dependency libraries
    21632300            for deplib in $dependency_libs; do
    2164               case "$deplib" in
     2301              case $deplib in
    21652302              -L*) path="$deplib" ;;
    21662303              *.la)
     
    21682305                test "X$dir" = "X$deplib" && dir="."
    21692306                # We need an absolute path.
    2170                 case "$dir" in
     2307                case $dir in
    21712308                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
    21722309                *)
     
    21992336              esac
    22002337            done
    2201           fi
    2202         fi
    2203       done
    2204       dependency_libs="$newdependency_libs"
     2338          fi # link_all_deplibs != no
     2339        fi # linkmode = lib
     2340      done # for deplib in $libs
    22052341      if test $pass = dlpreopen; then
    22062342        # Link the dlpreopened libraries before other libraries
     
    22102346      fi
    22112347      if test $pass != dlopen; then
     2348        test $pass != scan && dependency_libs="$newdependency_libs"
    22122349        if test $pass != conv; then
    22132350          # Make sure lib_search_path contains only unique directories.
     
    22282365        fi
    22292366        for var in $vars dependency_libs; do
    2230           # Make sure that $var contains only unique libraries
    2231           # and add them in reverse order
     2367          # Add libraries to $var in reverse order
    22322368          eval tmp_libs=\"\$$var\"
    22332369          new_libs=
    22342370          for deplib in $tmp_libs; do
    2235             case "$deplib" in
     2371            case $deplib in
    22362372            -L*) new_libs="$deplib $new_libs" ;;
    22372373            *)
     
    22502386          tmp_libs=
    22512387          for deplib in $new_libs; do
    2252             case "$deplib" in
     2388            case $deplib in
    22532389            -L*)
    22542390              case " $tmp_libs " in
     
    22612397          done
    22622398          eval $var=\"$tmp_libs\"
    2263         done
    2264       fi
    2265     done
     2399        done # for var
     2400      fi
     2401      if test "$pass" = "conv" &&
     2402       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
     2403        libs="$deplibs" # reset libs
     2404        deplibs=
     2405      fi
     2406    done # for pass
    22662407    if test $linkmode = prog; then
    22672408      dlfiles="$newdlfiles"
     
    22712412    case $linkmode in
    22722413    oldlib)
    2273       if test -n "$deplibs"; then
    2274         $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
    2275       fi
    2276 
    22772414      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    22782415        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
     
    23072444    lib)
    23082445      # Make sure we only generate libraries of the form `libNAME.la'.
    2309       case "$outputname" in
     2446      case $outputname in
    23102447      lib*)
    23112448        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
     
    23872524
    23882525        # Check that each of the things are valid numbers.
    2389         case "$current" in
    2390         0 | [1-9] | [1-9][0-9]*) ;;
     2526        case $current in
     2527        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    23912528        *)
    23922529          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
     
    23962533        esac
    23972534
    2398         case "$revision" in
    2399         0 | [1-9] | [1-9][0-9]*) ;;
     2535        case $revision in
     2536        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    24002537        *)
    24012538          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
     
    24052542        esac
    24062543
    2407         case "$age" in
    2408         0 | [1-9] | [1-9][0-9]*) ;;
     2544        case $age in
     2545        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    24092546        *)
    24102547          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
     
    24242561        versuffix=
    24252562        verstring=
    2426         case "$version_type" in
     2563        case $version_type in
    24272564        none) ;;
     2565
     2566        darwin)
     2567          # Like Linux, but with the current version available in
     2568          # verstring for coding it into the library header
     2569          major=.`expr $current - $age`
     2570          versuffix="$major.$age.$revision"
     2571          # Darwin ld doesn't like 0 for these options...
     2572          minor_current=`expr $current + 1`
     2573          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
     2574          ;;
     2575
     2576        freebsd-aout)
     2577          major=".$current"
     2578          versuffix=".$current.$revision";
     2579          ;;
     2580
     2581        freebsd-elf)
     2582          major=".$current"
     2583          versuffix=".$current";
     2584          ;;
    24282585
    24292586        irix)
     
    24692626          major=".$current"
    24702627          versuffix=".$current.$revision"
    2471           ;;
    2472 
    2473         freebsd-aout)
    2474           major=".$current"
    2475           versuffix=".$current.$revision";
    2476           ;;
    2477 
    2478         freebsd-elf)
    2479           major=".$current"
    2480           versuffix=".$current";
    24812628          ;;
    24822629
     
    25322679        tempremovelist=`echo "$output_objdir/*"`
    25332680        for p in $tempremovelist; do
    2534           case "$p" in
     2681          case $p in
    25352682            *.$objext)
    25362683               ;;
     
    25562703
    25572704      # Eliminate all temporary directories.
    2558       for path in $uninst_path; do
     2705      for path in $notinst_path; do
    25592706        lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
    25602707        deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
     
    25992746      if test "$build_libtool_libs" = yes; then
    26002747        if test -n "$rpath"; then
    2601           case "$host" in
     2748          case $host in
    26022749          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
    26032750            # these systems don't actually have a c library (as such)!
    26042751            ;;
     2752          *-*-rhapsody* | *-*-darwin1.[012])
     2753            # Rhapsody C library is in the System framework
     2754            deplibs="$deplibs -framework System"
     2755            ;;
     2756          *-*-netbsd*)
     2757            # Don't link with libc until the a.out ld.so is fixed.
     2758            ;;
    26052759          *)
    2606             # Add libc to deplibs on all other systems if necessary.
    2607             if test $build_libtool_need_lc = "yes"; then
    2608               deplibs="$deplibs -lc"
    2609             fi
     2760            # Add libc to deplibs on all other systems if necessary.
     2761            if test $build_libtool_need_lc = "yes"; then
     2762              deplibs="$deplibs -lc"
     2763            fi
    26102764            ;;
    26112765          esac
     
    26262780        newdeplibs=
    26272781        droppeddeps=no
    2628         case "$deplibs_check_method" in
     2782        case $deplibs_check_method in
    26292783        pass_all)
    26302784          # Don't check for shared/static.  Everything works.
     
    26512805              name="`expr $i : '-l\(.*\)'`"
    26522806              # If $name is empty we are operating on a -L argument.
    2653               if test "$name" != "" ; then
     2807              if test -n "$name" && test "$name" != "0"; then
    26542808                libname=`eval \\$echo \"$libname_spec\"`
    26552809                deplib_matches=`eval \\$echo \"$library_names_spec\"`
     
    26762830              name="`expr $i : '-l\(.*\)'`"
    26772831             # If $name is empty we are operating on a -L argument.
    2678               if test "$name" != "" ; then
     2832              if test -n "$name" && test "$name" != "0"; then
    26792833                $rm conftest
    26802834                $LTCC -o conftest conftest.c $i
     
    27162870            name="`expr $a_deplib : '-l\(.*\)'`"
    27172871            # If $name is empty we are operating on a -L argument.
    2718             if test "$name" != "" ; then
     2872            if test -n "$name" && test "$name" != "0"; then
    27192873              libname=`eval \\$echo \"$libname_spec\"`
    27202874              for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
     
    27342888                      while test -h "$potlib" 2>/dev/null; do
    27352889                        potliblink=`ls -ld $potlib | sed 's/.* -> //'`
    2736                         case "$potliblink" in
     2890                        case $potliblink in
    27372891                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
    27382892                        *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
     
    27472901                      fi
    27482902                    done
     2903              done
     2904              if test -n "$a_deplib" ; then
     2905                droppeddeps=yes
     2906                echo
     2907                echo "*** Warning: This library needs some functionality provided by $a_deplib."
     2908                echo "*** I have the capability to make that library automatically link in when"
     2909                echo "*** you link to this library.  But I can only do this if you have a"
     2910                echo "*** shared version of the library, which you do not appear to have."
     2911              fi
     2912            else
     2913              # Add a -L argument.
     2914              newdeplibs="$newdeplibs $a_deplib"
     2915            fi
     2916          done # Gone through all deplibs.
     2917          ;;
     2918        match_pattern*)
     2919          set dummy $deplibs_check_method
     2920          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
     2921          for a_deplib in $deplibs; do
     2922            name="`expr $a_deplib : '-l\(.*\)'`"
     2923            # If $name is empty we are operating on a -L argument.
     2924            if test -n "$name" && test "$name" != "0"; then
     2925              libname=`eval \\$echo \"$libname_spec\"`
     2926              for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
     2927                potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
     2928                for potent_lib in $potential_libs; do
     2929                  if eval echo \"$potent_lib\" 2>/dev/null \
     2930                      | sed 10q \
     2931                      | egrep "$match_pattern_regex" > /dev/null; then
     2932                    newdeplibs="$newdeplibs $a_deplib"
     2933                    a_deplib=""
     2934                    break 2
     2935                  fi
     2936                done
    27492937              done
    27502938              if test -n "$a_deplib" ; then
     
    27842972        name=$name_save
    27852973
     2974        case $host in
     2975        *-*-rhapsody* | *-*-darwin1.[012])
     2976          # On Rhapsody replace the C library is the System framework
     2977          newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
     2978          ;;
     2979        esac
     2980
    27862981        if test "$droppeddeps" = yes; then
    27872982          if test "$module" = yes; then
     
    28093004            echo "*** automatically added whenever a program is linked with this library"
    28103005            echo "*** or is declared to -dlopen it."
     3006
     3007            if test $allow_undefined = no; then
     3008              echo
     3009              echo "*** Since this library must not contain undefined symbols,"
     3010              echo "*** because either the platform does not support them or"
     3011              echo "*** it was explicitly requested with -no-undefined,"
     3012              echo "*** libtool will only create a static version of it."
     3013              if test "$build_old_libs" = no; then
     3014                oldlibs="$output_objdir/$libname.$libext"
     3015                build_libtool_libs=module
     3016                build_old_libs=yes
     3017              else
     3018                build_libtool_libs=no
     3019              fi
     3020            fi
    28113021          fi
    28123022        fi
     
    28353045                else
    28363046                  # Just accumulate the unique libdirs.
    2837                   case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
     3047                  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
    28383048                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    28393049                    ;;
     
    28883098          soname="$realname"
    28893099        fi
     3100        test -z "$dlname" && dlname=$soname
    28903101
    28913102        lib="$output_objdir/$realname"
     
    29443155        if test -n "$convenience"; then
    29453156          if test -n "$whole_archive_flag_spec"; then
     3157            save_libobjs=$libobjs
    29463158            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    29473159          else
     
    29593171            for xlib in $convenience; do
    29603172              # Extract the objects.
    2961               case "$xlib" in
     3173              case $xlib in
    29623174              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    29633175              *) xabs=`pwd`"/$xlib" ;;
     
    29983210          eval cmds=\"$archive_cmds\"
    29993211        fi
    3000         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
    3001         for cmd in $cmds; do
    3002           IFS="$save_ifs"
    3003           $show "$cmd"
    3004           $run eval "$cmd" || exit $?
    3005         done
    3006         IFS="$save_ifs"
     3212        if len=`expr "X$cmds" : ".*"` &&
     3213           test $len -le $max_cmd_len; then
     3214          :
     3215        else
     3216          # The command line is too long to link in one step, link piecewise.
     3217          $echo "creating reloadable object files..."
     3218
     3219          # Save the value of $output and $libobjs because we want to
     3220          # use them later.  If we have whole_archive_flag_spec, we
     3221          # want to use save_libobjs as it was before
     3222          # whole_archive_flag_spec was expanded, because we can't
     3223          # assume the linker understands whole_archive_flag_spec.
     3224          # This may have to be revisited, in case too many
     3225          # convenience libraries get linked in and end up exceeding
     3226          # the spec.
     3227          if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
     3228            save_libobjs=$libobjs
     3229          fi
     3230          save_output=$output
     3231
     3232          # Clear the reloadable object creation command queue and
     3233          # initialize k to one.
     3234          test_cmds=
     3235          concat_cmds=
     3236          objlist=
     3237          delfiles=
     3238          last_robj=
     3239          k=1
     3240          output=$output_objdir/$save_output-${k}.$objext
     3241          # Loop over the list of objects to be linked.
     3242          for obj in $save_libobjs
     3243          do
     3244            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
     3245            if test "X$objlist" = X ||
     3246               { len=`expr "X$test_cmds" : ".*"` &&
     3247                 test $len -le $max_cmd_len; }; then
     3248              objlist="$objlist $obj"
     3249            else
     3250              # The command $test_cmds is almost too long, add a
     3251              # command to the queue.
     3252              if test $k -eq 1 ; then
     3253                # The first file doesn't have a previous command to add.
     3254                eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
     3255              else
     3256                # All subsequent reloadable object files will link in
     3257                # the last one created.
     3258                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
     3259              fi
     3260              last_robj=$output_objdir/$save_output-${k}.$objext
     3261              k=`expr $k + 1`
     3262              output=$output_objdir/$save_output-${k}.$objext
     3263              objlist=$obj
     3264              len=1
     3265            fi
     3266          done
     3267          # Handle the remaining objects by creating one last
     3268          # reloadable object file.  All subsequent reloadable object
     3269          # files will link in the last one created.
     3270          test -z "$concat_cmds" || concat_cmds=$concat_cmds~
     3271          eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
     3272
     3273          # Set up a command to remove the reloadale object files
     3274          # after they are used.
     3275          i=0
     3276          while test $i -lt $k
     3277          do
     3278            i=`expr $i + 1`
     3279            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
     3280          done
     3281
     3282          $echo "creating a temporary reloadable object file: $output"
     3283
     3284          # Loop through the commands generated above and execute them.
     3285          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
     3286          for cmd in $concat_cmds; do
     3287            IFS="$save_ifs"
     3288            $show "$cmd"
     3289            $run eval "$cmd" || exit $?
     3290          done
     3291          IFS="$save_ifs"
     3292
     3293          libobjs=$output
     3294          # Restore the value of output.
     3295          output=$save_output
     3296
     3297          if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
     3298            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
     3299          fi
     3300          # Expand the library linking commands again to reset the
     3301          # value of $libobjs for piecewise linking.
     3302
     3303          # Do each of the archive commands.
     3304          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
     3305            eval cmds=\"$archive_expsym_cmds\"
     3306          else
     3307            eval cmds=\"$archive_cmds\"
     3308          fi
     3309
     3310          # Append the command to remove the reloadable object files
     3311          # to the just-reset $cmds.
     3312          eval cmds=\"\$cmds~$rm $delfiles\"
     3313        fi
     3314        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
     3315        for cmd in $cmds; do
     3316          IFS="$save_ifs"
     3317          $show "$cmd"
     3318          $run eval "$cmd" || exit $?
     3319        done
     3320        IFS="$save_ifs"
    30073321
    30083322        # Restore the uninstalled library and exit
     
    30533367      fi
    30543368
    3055       case "$output" in
     3369      case $output in
    30563370      *.lo)
    30573371        if test -n "$objs$old_deplibs"; then
     
    30983412          for xlib in $convenience; do
    30993413            # Extract the objects.
    3100             case "$xlib" in
     3414            case $xlib in
    31013415            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    31023416            *) xabs=`pwd`"/$xlib" ;;
     
    31943508
    31953509    prog)
     3510      case $host in
     3511        *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
     3512      esac
    31963513      if test -n "$vinfo"; then
    31973514        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
     
    32083525        fi
    32093526      fi
     3527
     3528      case $host in
     3529      *-*-rhapsody* | *-*-darwin1.[012])
     3530        # On Rhapsody replace the C library is the System framework
     3531        compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
     3532        finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
     3533        ;;
     3534      esac
    32103535
    32113536      compile_command="$compile_command $compile_deplibs"
     
    32333558            else
    32343559              # Just accumulate the unique libdirs.
    3235               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
     3560              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
    32363561              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    32373562                ;;
     
    32513576          esac
    32523577        fi
    3253         case "$host" in
     3578        case $host in
    32543579        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
    3255           case ":$dllsearchpath:" in
     3580          case :$dllsearchpath: in
    32563581          *":$libdir:"*) ;;
    32573582          *) dllsearchpath="$dllsearchpath:$libdir";;
     
    32773602            else
    32783603              # Just accumulate the unique libdirs.
    3279               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
     3604              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
    32803605              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    32813606                ;;
     
    33143639
    33153640      if test -n "$dlsyms"; then
    3316         case "$dlsyms" in
     3641        case $dlsyms in
    33173642        "") ;;
    33183643        *.c)
     
    34453770
    34463771          pic_flag_for_symtable=
    3447           case "$host" in
     3772          case $host in
    34483773          # compiling the symbol table file with pic_flag works around
    34493774          # a FreeBSD bug that causes programs to crash when -lm is
     
    35133838        rpath=
    35143839        for dir in $temp_rpath; do
    3515           case "$dir" in
     3840          case $dir in
    35163841          [\\/]* | [A-Za-z]:[\\/]*)
    35173842            # Absolute path.
     
    36213946      # Quote $echo for shipping.
    36223947      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
    3623         case "$0" in
     3948        case $0 in
    36243949        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
    36253950        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
     
    36363961        case $output in
    36373962          *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
     3963        esac
     3964        # test for cygwin because mv fails w/o .exe extensions
     3965        case $host in
     3966          *cygwin*) exeext=.exe ;;
     3967          *) exeext= ;;
    36383968        esac
    36393969        $rm $output
     
    36663996if test \"\$libtool_install_magic\" = \"$magic\"; then
    36673997  # install mode needs the following variable:
    3668   uninst_deplibs='$uninst_deplibs'
     3998  notinst_deplibs='$notinst_deplibs'
    36693999else
    36704000  # When we are sourced in execute mode, \$file and \$echo are already set.
     
    37154045        if test "$fast_install" = yes; then
    37164046          echo >> $output "\
    3717   program=lt-'$outputname'
     4047  program=lt-'$outputname'$exeext
    37184048  progdir=\"\$thisdir/$objdir\"
    37194049
     
    37344064    # relink executable if necessary
    37354065    if test -n \"\$relink_command\"; then
    3736       if (eval \$relink_command); then :
     4066      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
    37374067      else
     4068        $echo \"\$relink_command_output\" >&2
    37384069        $rm \"\$progdir/\$file\"
    37394070        exit 1
     
    38604191        for xlib in $addlibs; do
    38614192          # Extract the objects.
    3862           case "$xlib" in
     4193          case $xlib in
    38634194          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
    38644195          *) xabs=`pwd`"/$xlib" ;;
     
    39044235#       done
    39054236
    3906         eval cmds=\"$old_archive_cmds\"
     4237        eval cmds=\"$old_archive_cmds\"
     4238
     4239        if len=`expr "X$cmds" : ".*"` &&
     4240             test $len -le $max_cmd_len; then
     4241          :
     4242        else
     4243          # the command line is too long to link in one step, link in parts
     4244          $echo "using piecewise archive linking..."
     4245          save_RANLIB=$RANLIB
     4246          RANLIB=:
     4247          objlist=
     4248          concat_cmds=
     4249          save_oldobjs=$oldobjs
     4250          for obj in $save_oldobjs
     4251          do
     4252            oldobjs="$objlist $obj"
     4253            objlist="$objlist $obj"
     4254            eval test_cmds=\"$old_archive_cmds\"
     4255            if len=`expr "X$test_cmds" : ".*"` &&
     4256               test $len -le $max_cmd_len; then
     4257              :
     4258            else
     4259              # the above command should be used before it gets too long
     4260              oldobjs=$objlist
     4261              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
     4262              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
     4263              objlist=
     4264            fi
     4265          done
     4266          RANLIB=$save_RANLIB
     4267          oldobjs=$objlist
     4268          eval cmds=\"\$concat_cmds~$old_archive_cmds\"
     4269        fi
    39074270      fi
    39084271      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
     
    39214284
    39224285    # Now create the libtool archive.
    3923     case "$output" in
     4286    case $output in
    39244287    *.la)
    39254288      old_library=
     
    39394302      done
    39404303      # Quote the link command for shipping.
    3941       relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
     4304      tagopts=
     4305      for tag in $taglist; do
     4306        tagopts="$tagopts --tag $tag"
     4307      done
     4308      relink_command="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args)"
    39424309      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
    39434310
     
    39534320            newdependency_libs=
    39544321            for deplib in $dependency_libs; do
    3955               case "$deplib" in
     4322              case $deplib in
    39564323              *.la)
    39574324                name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
     
    39914358          fi
    39924359          $rm $output
     4360          # place dlname in correct position for cygwin
     4361          tdlname=$dlname
     4362          case $host,$output,$installed,$module,$dlname in
     4363            *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
     4364          esac
    39934365          $echo > $output "\
    39944366# $outputname - a libtool library file
     
    39994371
    40004372# The name that we can dlopen(3).
    4001 dlname='$dlname'
     4373dlname='$tdlname'
    40024374
    40034375# Names of this library.
     
    40514423      # Aesthetically quote it.
    40524424      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
    4053       case "$arg" in
     4425      case $arg in
    40544426      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
    40554427        arg="\"$arg\""
     
    40674439    # Aesthetically quote it.
    40684440    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    4069     case "$arg" in
     4441    case $arg in
    40704442    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
    40714443      arg="\"$arg\""
     
    40904462      fi
    40914463
    4092       case "$arg" in
     4464      case $arg in
    40934465      -d) isdir=yes ;;
    40944466      -f) prev="-f" ;;
     
    41154487      # Aesthetically quote the argument.
    41164488      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
    4117       case "$arg" in
     4489      case $arg in
    41184490      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
    41194491        arg="\"$arg\""
     
    41664538      fi
    41674539    fi
    4168     case "$destdir" in
     4540    case $destdir in
    41694541    [\\/]* | [A-Za-z]:[\\/]*) ;;
    41704542    *)
    41714543      for file in $files; do
    4172         case "$file" in
     4544        case $file in
    41734545        *.lo) ;;
    41744546        *)
     
    41924564
    41934565      # Do each installation.
    4194       case "$file" in
     4566      case $file in
    41954567      *.$libext)
    41964568        # Do the static libraries later.
     
    42114583        relink_command=
    42124584        # If there is no directory component, then add one.
    4213         case "$file" in
     4585        case $file in
    42144586        */* | *\\*) . $file ;;
    42154587        *) . ./$file ;;
     
    42404612          else
    42414613            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
    4242             continue
     4614            exit 1
    42434615          fi
    42444616        fi
     
    43074679
    43084680        # Deduce the name of the destination old-style object file.
    4309         case "$destfile" in
     4681        case $destfile in
    43104682        *.lo)
    43114683          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
     
    43504722        # Do a test to see if this is really a libtool program.
    43514723        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    4352           uninst_deplibs=
     4724          notinst_deplibs=
    43534725          relink_command=
    43544726
    43554727          # If there is no directory component, then add one.
    4356           case "$file" in
     4728          case $file in
    43574729          */* | *\\*) . $file ;;
    43584730          *) . ./$file ;;
     
    43604732
    43614733          # Check the variables that should have been set.
    4362           if test -z "$uninst_deplibs"; then
     4734          if test -z "$notinst_deplibs"; then
    43634735            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
    43644736            exit 1
     
    43664738
    43674739          finalize=yes
    4368           for lib in $uninst_deplibs; do
     4740          for lib in $notinst_deplibs; do
    43694741            # Check to see that each library is installed.
    43704742            libdir=
    43714743            if test -f "$lib"; then
    43724744              # If there is no directory component, then add one.
    4373               case "$lib" in
     4745              case $lib in
    43744746              */* | *\\*) . $lib ;;
    43754747              *) . ./$lib ;;
     
    43854757          relink_command=
    43864758          # If there is no directory component, then add one.
    4387           case "$file" in
     4759          case $file in
    43884760          */* | *\\*) . $file ;;
    43894761          *) . ./$file ;;
     
    44234795        fi
    44244796
     4797
     4798        # remove .exe since cygwin /usr/bin/install will append another
     4799        # one anyways
     4800        case $install_prog,$host in
     4801        */usr/bin/install*,*cygwin*)
     4802          case $file:$destfile in
     4803          *.exe:*.exe)
     4804            # this is ok
     4805            ;;
     4806          *.exe:*)
     4807            destfile=$destfile.exe
     4808            ;;
     4809          *:*.exe)
     4810            destfile=`echo $destfile | sed -e 's,.exe$,,'`
     4811            ;;
     4812          esac
     4813          ;;
     4814        esac
     4815
    44254816        $show "$install_prog$stripme $file $destfile"
    44264817        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
     
    44624853      # Maybe just do a dry run.
    44634854      test -n "$run" && current_libdirs=" -n$current_libdirs"
    4464       exec $SHELL $0 --finish$current_libdirs
    4465       exit 1
     4855      exec_cmd='$SHELL $0 --finish$current_libdirs'
     4856    else
     4857      exit 0
    44664858    fi
    4467 
    4468     exit 0
    44694859    ;;
    44704860
     
    45044894
    45054895    # Exit here if they wanted silent mode.
    4506     test "$show" = : && exit 0
     4896    test "$show" = ":" && exit 0
    45074897
    45084898    echo "----------------------------------------------------------------------"
     
    45144904    echo "If you ever happen to want to link against installed libraries"
    45154905    echo "in a given directory, LIBDIR, you must either use libtool, and"
    4516     echo "specify the full pathname of the library, or use \`-LLIBDIR'"
     4906    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
    45174907    echo "flag during linking and do at least one of the following:"
    45184908    if test -n "$shlibpath_var"; then
     
    45644954
    45654955      dir=
    4566       case "$file" in
     4956      case $file in
    45674957      *.la)
    45684958        # Check to see that this really is a libtool archive.
     
    45794969
    45804970        # If there is no directory component, then add one.
    4581         case "$file" in
     4971        case $file in
    45824972        */* | *\\*) . $file ;;
    45834973        *) . ./$file ;;
     
    46345024    for file
    46355025    do
    4636       case "$file" in
     5026      case $file in
    46375027      -*) ;;
    46385028      *)
     
    46405030        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    46415031          # If there is no directory component, then add one.
    4642           case "$file" in
     5032          case $file in
    46435033          */* | *\\*) . $file ;;
    46445034          *) . ./$file ;;
     
    46695059      fi
    46705060
    4671       # Now actually exec the command.
    4672       eval "exec \$cmd$args"
    4673 
    4674       $echo "$modename: cannot exec \$cmd$args"
    4675       exit 1
     5061      # Now prepare to actually exec the command.
     5062      exec_cmd='"$cmd"$args'
    46765063    else
    46775064      # Display what would be done.
     
    46905077    rm="$nonopt"
    46915078    files=
     5079    rmforce=
     5080    exit_status=0
    46925081
    46935082    # This variable tells wrapper scripts just to set variables rather
     
    46975086    for arg
    46985087    do
    4699       case "$arg" in
     5088      case $arg in
     5089      -f) rm="$rm $arg"; rmforce=yes ;;
    47005090      -*) rm="$rm $arg" ;;
    47015091      *) files="$files $arg" ;;
     
    47085098      exit 1
    47095099    fi
     5100
     5101    rmdirs=
    47105102
    47115103    for file in $files; do
     
    47205112      test $mode = uninstall && objdir="$dir"
    47215113
     5114      # Remember objdir for removal later, being careful to avoid duplicates
     5115      if test $mode = clean; then
     5116        case " $rmdirs " in
     5117          *" $objdir "*) ;;
     5118          *) rmdirs="$rmdirs $objdir" ;;
     5119        esac
     5120      fi
     5121
     5122      # Don't error if the file doesn't exist and rm -f was used.
     5123      if (test -L "$file") >/dev/null 2>&1 \
     5124        || (test -h "$file") >/dev/null 2>&1 \
     5125        || test -f "$file"; then
     5126        :
     5127      elif test -d "$file"; then
     5128        exit_status=1
     5129        continue
     5130      elif test "$rmforce" = yes; then
     5131        continue
     5132      fi
     5133
    47225134      rmfiles="$file"
    47235135
    4724       case "$name" in
     5136      case $name in
    47255137      *.la)
    47265138        # Possibly a libtool archive, so verify it.
     
    47445156                $show "$cmd"
    47455157                $run eval "$cmd"
     5158                if test $? != 0 && test "$rmforce" != yes; then
     5159                  exit_status=1
     5160                fi
    47465161              done
    47475162              IFS="$save_ifs"
     
    47565171                $show "$cmd"
    47575172                $run eval "$cmd"
     5173                if test $? != 0 && test "$rmforce" != yes; then
     5174                  exit_status=1
     5175                fi
    47585176              done
    47595177              IFS="$save_ifs"
     
    47665184      *.lo)
    47675185        # Possibly a libtool object, so verify it.
    4768         if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     5186        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    47695187
    47705188          # Read the .lo file
    4771           . ./$file
     5189          . $dir/$name
    47725190
    47735191          # Add PIC object to the list of files to remove.
     
    48005218      esac
    48015219      $show "$rm $rmfiles"
    4802       $run $rm $rmfiles
     5220      $run $rm $rmfiles || exit_status=1
    48035221    done
    4804     exit 0
     5222
     5223    # Try to remove the ${objdir}s in the directories where we deleted files
     5224    for dir in $rmdirs; do
     5225      if test -d "$dir"; then
     5226        $show "rmdir $dir"
     5227        $run rmdir $dir >/dev/null 2>&1
     5228      fi
     5229    done
     5230
     5231    exit $exit_status
    48055232    ;;
    48065233
     
    48125239  esac
    48135240
    4814   $echo "$modename: invalid operation mode \`$mode'" 1>&2
    4815   $echo "$generic_help" 1>&2
     5241  if test -z "$exec_cmd"; then
     5242    $echo "$modename: invalid operation mode \`$mode'" 1>&2
     5243    $echo "$generic_help" 1>&2
     5244    exit 1
     5245  fi
     5246fi # test -z "$show_help"
     5247
     5248if test -n "$exec_cmd"; then
     5249  eval exec $exec_cmd
    48165250  exit 1
    4817 fi # test -z "$show_help"
     5251fi
    48185252
    48195253# We need to display help for each of the modes.
    4820 case "$mode" in
     5254case $mode in
    48215255"") $echo \
    48225256"Usage: $modename [OPTION]... [MODE-ARG]...
     
    48745308
    48755309  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
     5310  -prefer-pic       try to building PIC objects only
     5311  -prefer-non-pic   try to building non-PIC objects only
    48765312  -static           always build a \`.o' file suitable for static linking
    48775313
     
    49575393  -no-undefined     declare that a library does not refer to external symbols
    49585394  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
     5395  -objectlist FILE  Use a list of object files found in FILE to specify objects
    49595396  -release RELEASE  specify package release information
    49605397  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
Note: See TracChangeset for help on using the changeset viewer.