IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3377 for trunk/psLib/ltmain.sh


Ignore:
Timestamp:
Mar 5, 2005, 11:53:03 AM (21 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/ltmain.sh

    r3239 r3377  
    22# NOTE: Changing this file will not affect anything until you rerun configure.
    33#
    4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
     4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
    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
    27 basename="s,^.*/,,g"
    28 
    29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
    30 # is ksh but when the shell is invoked as "sh" and the current value of
    31 # the _XPG environment variable is not equal to 1 (one), the special
    32 # positional parameter $0, within a function call, is the name of the
    33 # function.
    34 progpath="$0"
    35 
    36 # The name of this program:
    37 progname=`echo "$progpath" | $SED $basename`
    38 modename="$progname"
    39 
    40 # Global variables:
    41 EXIT_SUCCESS=0
    42 EXIT_FAILURE=1
    43 
    44 PROGRAM=ltmain.sh
    45 PACKAGE=libtool
    46 VERSION=1.5.8
    47 TIMESTAMP=" (1.1220.2.118 2004/08/07 12:24:38)"
    48 
    49 # See if we are running on zsh, and set the options which allow our
    50 # commands through without removal of \ escapes.
    51 if test -n "${ZSH_VERSION+set}" ; then
    52   setopt NO_GLOB_SUBST
    53 fi
    54 
    5527# Check that we have a working $echo.
    5628if test "X$1" = X--no-reexec; then
     
    6537else
    6638  # Restart under the correct shell, and then maybe $echo will work.
    67   exec $SHELL "$progpath" --no-reexec ${1+"$@"}
     39  exec $SHELL "$0" --no-reexec ${1+"$@"}
    6840fi
    6941
     
    7446$*
    7547EOF
    76   exit $EXIT_SUCCESS
     48  exit 0
    7749fi
     50
     51# define SED for historic ltconfig's generated by Libtool 1.3
     52test -z "$SED" && SED=sed
     53
     54# The name of this program.
     55progname=`$echo "$0" | ${SED} 's%^.*/%%'`
     56modename="$progname"
     57
     58# Constants.
     59PROGRAM=ltmain.sh
     60PACKAGE=libtool
     61VERSION=1.4.3
     62TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
    7863
    7964default_mode=
     
    8873Xsed="${SED}"' -e 1s/^X//'
    8974sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    90 # test EBCDIC or ASCII
    91 case `echo A|tr A '\301'` in
    92  A) # EBCDIC based system
    93   SP2NL="tr '\100' '\n'"
    94   NL2SP="tr '\r\n' '\100\100'"
    95   ;;
    96  *) # Assume ASCII based system
    97   SP2NL="tr '\040' '\012'"
    98   NL2SP="tr '\015\012' '\040\040'"
    99   ;;
    100 esac
     75# test EBCDIC or ASCII                                                         
     76case `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  ;;                                                                           
     85esac                                                                           
    10186
    10287# NLS nuisances.
     
    11398
    11499# Make sure IFS has a sensible default
    115 : ${IFS="       
    116 "}
     100: ${IFS="       "}
    117101
    118102if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
    119   $echo "$modename: not configured to build any kind of library" 1>&2
    120   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    121   exit $EXIT_FAILURE
     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
    122106fi
    123107
     
    134118o2lo="s/\\.${objext}\$/.lo/"
    135119
    136 #####################################
    137 # Shell function definitions:
    138 # This seems to be the best place for them
    139 
    140 # func_win32_libid arg
    141 # return the library type of file 'arg'
    142 #
    143 # Need a lot of goo to handle *both* DLLs and import libs
    144 # Has to be a shell function in order to 'eat' the argument
    145 # that is supplied when $file_magic_command is called.
    146 func_win32_libid () {
    147   win32_libid_type="unknown"
    148   win32_fileres=`file -L $1 2>/dev/null`
    149   case $win32_fileres in
    150   *ar\ archive\ import\ library*) # definitely import
    151     win32_libid_type="x86 archive import"
    152     ;;
    153   *ar\ archive*) # could be an import, or static
    154     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
    155       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
    156       win32_nmres=`eval $NM -f posix -A $1 | \
    157         sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
    158       if test "X$win32_nmres" = "Ximport" ; then
    159         win32_libid_type="x86 archive import"
    160       else
    161         win32_libid_type="x86 archive static"
    162       fi
    163     fi
    164     ;;
    165   *DLL*)
    166     win32_libid_type="x86 DLL"
    167     ;;
    168   *executable*) # but shell scripts are "executable" too...
    169     case $win32_fileres in
    170     *MS\ Windows\ PE\ Intel*)
    171       win32_libid_type="x86 DLL"
    172       ;;
    173     esac
    174     ;;
    175   esac
    176   $echo $win32_libid_type
    177 }
    178 
    179 
    180 # func_infer_tag arg
    181 # Infer tagged configuration to use if any are available and
    182 # if one wasn't chosen via the "--tag" command line option.
    183 # Only attempt this if the compiler in the base compile
    184 # command doesn't match the default compiler.
    185 # arg is usually of the form 'gcc ...'
    186 func_infer_tag () {
    187     if test -n "$available_tags" && test -z "$tagname"; then
    188       CC_quoted=
    189       for arg in $CC; do
    190         case $arg in
    191           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
    192           arg="\"$arg\""
    193           ;;
    194         esac
    195         CC_quoted="$CC_quoted $arg"
    196       done
    197       case $@ in
    198       # Blanks in the command may have been stripped by the calling shell,
    199       # but not from the CC environment variable when configure was run.
    200       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
    201       # Blanks at the start of $base_compile will cause this to fail
    202       # if we don't check for them as well.
    203       *)
    204         for z in $available_tags; do
    205           if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
    206             # Evaluate the configuration.
    207             eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
    208             CC_quoted=
    209             for arg in $CC; do
    210             # Double-quote args containing other shell metacharacters.
    211             case $arg in
    212               *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    213               arg="\"$arg\""
    214               ;;
    215             esac
    216             CC_quoted="$CC_quoted $arg"
    217           done
    218             case "$@ " in
    219               " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
    220               # The compiler in the base compile command matches
    221               # the one in the tagged configuration.
    222               # Assume this is the tagged configuration we want.
    223               tagname=$z
    224               break
    225               ;;
    226             esac
    227           fi
    228         done
    229         # If $tagname still isn't set, then no tagged configuration
    230         # was found and let the user know that the "--tag" command
    231         # line option must be used.
    232         if test -z "$tagname"; then
    233           $echo "$modename: unable to infer tagged configuration"
    234           $echo "$modename: specify a tag with \`--tag'" 1>&2
    235           exit $EXIT_FAILURE
    236 #        else
    237 #          $echo "$modename: using $tagname tagged configuration"
    238         fi
    239         ;;
    240       esac
    241     fi
    242 }
    243 
    244 
    245 # func_extract_archives gentop oldlib ...
    246 func_extract_archives () {
    247     my_gentop="$1"; shift
    248     my_oldlibs=${1+"$@"}
    249     my_oldobjs=""
    250     my_xlib=""
    251     my_xabs=""
    252     my_xdir=""
    253     my_status=""
    254 
    255     $show "${rm}r $my_gentop"
    256     $run ${rm}r "$my_gentop"
    257     $show "$mkdir $my_gentop"
    258     $run $mkdir "$my_gentop"
    259     my_status=$?
    260     if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
    261       exit $my_status
    262     fi
    263 
    264     for my_xlib in $my_oldlibs; do
    265       # Extract the objects.
    266       case $my_xlib in
    267         [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
    268         *) my_xabs=`pwd`"/$my_xlib" ;;
    269       esac
    270       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
    271       my_xdir="$my_gentop/$my_xlib"
    272 
    273       $show "${rm}r $my_xdir"
    274       $run ${rm}r "$my_xdir"
    275       $show "$mkdir $my_xdir"
    276       $run $mkdir "$my_xdir"
    277       status=$?
    278       if test "$status" -ne 0 && test ! -d "$my_xdir"; then
    279         exit $status
    280       fi
    281       case $host in
    282       *-darwin*)
    283         $show "Extracting $my_xabs"
    284         # Do not bother doing anything if just a dry run
    285         if test -z "$run"; then
    286           darwin_orig_dir=`pwd`
    287           cd $my_xdir || exit $?
    288           darwin_archive=$my_xabs
    289           darwin_curdir=`pwd`
    290           darwin_base_archive=`basename $darwin_archive`
    291           darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
    292           if test -n "$darwin_arches"; then
    293             darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
    294             darwin_arch=
    295             $show "$darwin_base_archive has multiple architectures $darwin_arches"
    296             for darwin_arch in  $darwin_arches ; do
    297               mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
    298               lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
    299               # Remove the table of contents from the thin files.
    300               $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
    301               $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
    302               cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
    303               $AR -xo "${darwin_base_archive}"
    304               rm "${darwin_base_archive}"
    305               cd "$darwin_curdir"
    306             done # $darwin_arches
    307       ## Okay now we have a bunch of thin objects, gotta fatten them up :)
    308             darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
    309             darwin_file=
    310             darwin_files=
    311             for darwin_file in $darwin_filelist; do
    312               darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
    313               lipo -create -output "$darwin_file" $darwin_files
    314             done # $darwin_filelist
    315             rm -rf unfat-$$
    316             cd "$darwin_orig_dir"
    317           else
    318             cd $darwin_orig_dir
    319             (cd $my_xdir && $AR x $my_xabs) || exit $?
    320           fi # $darwin_arches
    321         fi # $run
    322       ;;
    323       *)
    324         # We will extract separately just the conflicting names and we will
    325         # no longer touch any unique names. It is faster to leave these
    326         # extract automatically by $AR in one run.
    327         $show "(cd $my_xdir && $AR x $my_xabs)"
    328         $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
    329         if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
    330           :
    331         else
    332           $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
    333           $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
    334           $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
    335           do
    336             i=1
    337             while test "$i" -le "$count"
    338             do
    339               # Put our $i before any first dot (extension)
    340               # Never overwrite any file
    341               name_to="$name"
    342               while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
    343               do
    344                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
    345               done
    346               $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
    347               $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
    348               i=`expr $i + 1`
    349             done
    350           done
    351         fi
    352         ;;
    353       esac
    354       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
    355     done
    356 
    357     func_extract_archives_result="$my_oldobjs"
    358 }
    359 # End of Shell function definitions
    360 #####################################
    361 
    362 # Darwin sucks
    363 eval std_shrext=\"$shrext_cmds\"
    364 
    365120# Parse our command line options once, thoroughly.
    366 while test "$#" -gt 0
     121while test $# -gt 0
    367122do
    368123  arg="$1"
     
    380135      execute_dlfiles="$execute_dlfiles $arg"
    381136      ;;
    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       ;;
    410137    *)
    411138      eval "$prev=\$arg"
     
    425152
    426153  --version)
    427     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
    428     $echo
    429     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
    430     $echo "This is free software; see the source for copying conditions.  There is NO"
    431     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    432     exit $EXIT_SUCCESS
     154    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
     155    exit 0
    433156    ;;
    434157
    435158  --config)
    436     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
    437     # Now print the configurations for the tags.
    438     for tagname in $taglist; do
    439       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
    440     done
    441     exit $EXIT_SUCCESS
     159    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
     160    exit 0
    442161    ;;
    443162
    444163  --debug)
    445     $echo "$progname: enabling shell trace mode"
     164    echo "$progname: enabling shell trace mode"
    446165    set -x
    447     preserve_args="$preserve_args $arg"
    448166    ;;
    449167
     
    453171
    454172  --features)
    455     $echo "host: $host"
     173    echo "host: $host"
    456174    if test "$build_libtool_libs" = yes; then
    457       $echo "enable shared libraries"
     175      echo "enable shared libraries"
    458176    else
    459       $echo "disable shared libraries"
     177      echo "disable shared libraries"
    460178    fi
    461179    if test "$build_old_libs" = yes; then
    462       $echo "enable static libraries"
     180      echo "enable static libraries"
    463181    else
    464       $echo "disable static libraries"
     182      echo "disable static libraries"
    465183    fi
    466     exit $EXIT_SUCCESS
     184    exit 0
    467185    ;;
    468186
     
    476194  --quiet | --silent)
    477195    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"
    487196    ;;
    488197
     
    495204    $echo "$modename: unrecognized option \`$arg'" 1>&2
    496205    $echo "$help" 1>&2
    497     exit $EXIT_FAILURE
     206    exit 1
    498207    ;;
    499208
     
    508217  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
    509218  $echo "$help" 1>&2
    510   exit $EXIT_FAILURE
     219  exit 1
    511220fi
    512221
     
    520229  # Infer the operation mode.
    521230  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
    524231    case $nonopt in
    525     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
     232    *cc | *++ | gcc* | *-gcc* | xlc*)
    526233      mode=link
    527234      for arg
     
    564271    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
    565272    $echo "$help" 1>&2
    566     exit $EXIT_FAILURE
     273    exit 1
    567274  fi
    568275
     
    578285    # Get the compilation command and the source file.
    579286    base_compile=
    580     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
    581     suppress_opt=yes
     287    prev=
     288    lastarg=
     289    srcfile="$nonopt"
    582290    suppress_output=
    583     arg_mode=normal
    584     libobj=
    585     later=
    586 
     291
     292    user_target=no
    587293    for arg
    588294    do
    589       case "$arg_mode" in
    590       arg  )
    591         # do not "continue".  Instead, add this to base_compile
    592         lastarg="$arg"
    593         arg_mode=normal
    594         ;;
    595 
    596       target )
     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
     302        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
     315          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
    597390        libobj="$arg"
    598         arg_mode=normal
    599391        continue
    600392        ;;
    601 
    602       normal )
    603         # Accept any command-line options.
    604         case $arg in
    605         -o)
    606           if test -n "$libobj" ; then
    607             $echo "$modename: you cannot specify \`-o' more than once" 1>&2
    608             exit $EXIT_FAILURE
    609           fi
    610           arg_mode=target
    611           continue
    612           ;;
    613 
    614         -static | -prefer-pic | -prefer-non-pic)
    615           later="$later $arg"
    616           continue
    617           ;;
    618 
    619         -no-suppress)
    620           suppress_opt=no
    621           continue
    622           ;;
    623 
    624         -Xcompiler)
    625           arg_mode=arg  #  the next one goes into the "base_compile" arg list
    626           continue      #  The current "srcfile" will either be retained or
    627           ;;            #  replaced later.  I would guess that would be a bug.
    628 
    629         -Wc,*)
    630           args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
    631           lastarg=
    632           save_ifs="$IFS"; IFS=','
    633           for arg in $args; do
    634             IFS="$save_ifs"
    635 
    636             # Double-quote args containing other shell metacharacters.
    637             # Many Bourne shells cannot handle close brackets correctly
    638             # in scan sets, so we specify it separately.
    639             case $arg in
    640               *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    641               arg="\"$arg\""
    642               ;;
    643             esac
    644             lastarg="$lastarg $arg"
    645           done
    646           IFS="$save_ifs"
    647           lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
    648 
    649           # Add the arguments to base_compile.
    650           base_compile="$base_compile $lastarg"
    651           continue
    652           ;;
    653 
    654         * )
    655           # Accept the current argument as the source file.
    656           # The previous "srcfile" becomes the current argument.
    657           #
    658           lastarg="$srcfile"
    659           srcfile="$arg"
    660           ;;
    661         esac  #  case $arg
    662         ;;
    663       esac    #  case $arg_mode
     393      esac
     394
     395      # Accept the current argument as the source file.
     396      lastarg="$srcfile"
     397      srcfile="$arg"
    664398
    665399      # 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.
    666404      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
    667405
    668       case $lastarg in
    669406      # Double-quote args containing other shell metacharacters.
    670407      # Many Bourne shells cannot handle close brackets correctly
    671408      # in scan sets, so we specify it separately.
     409      case $lastarg in
    672410      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    673411        lastarg="\"$lastarg\""
     
    675413      esac
    676414
    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
     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)
    684425      ;;
    685     target)
    686       $echo "$modename: you must specify a target with \`-o'" 1>&2
    687       exit $EXIT_FAILURE
     426    no)
     427      # Get the name of the library object.
     428      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
    688429      ;;
    689430    *)
    690       # Get the name of the library object.
    691       [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
     431      $echo "$modename: you must specify a target with \`-o'" 1>&2
     432      exit 1
    692433      ;;
    693434    esac
     
    695436    # Recognize several different file suffixes.
    696437    # If the user specifies -o file.o, it is replaced with file.lo
    697     xform='[cCFSifmso]'
     438    xform='[cCFSfmso]'
    698439    case $libobj in
    699440    *.ada) xform=ada ;;
     
    703444    *.c++) xform=c++ ;;
    704445    *.cc) xform=cc ;;
    705     *.ii) xform=ii ;;
    706     *.class) xform=class ;;
    707446    *.cpp) xform=cpp ;;
    708447    *.cxx) xform=cxx ;;
    709448    *.f90) xform=f90 ;;
    710449    *.for) xform=for ;;
    711     *.java) xform=java ;;
    712450    esac
    713451
     
    718456    *)
    719457      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
    720       exit $EXIT_FAILURE
     458      exit 1
    721459      ;;
    722460    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
    753461
    754462    if test -z "$base_compile"; then
    755463      $echo "$modename: you must specify a compilation command" 1>&2
    756464      $echo "$help" 1>&2
    757       exit $EXIT_FAILURE
     465      exit 1
    758466    fi
    759467
    760468    # Delete any leftover library objects.
    761469    if test "$build_old_libs" = yes; then
    762       removelist="$obj $lobj $libobj ${libobj}T"
     470      removelist="$obj $libobj"
    763471    else
    764       removelist="$lobj $libobj ${libobj}T"
     472      removelist="$libobj"
    765473    fi
    766474
    767475    $run $rm $removelist
    768     trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     476    trap "$run $rm $removelist; exit 1" 1 2 15
    769477
    770478    # On Cygwin there's no "real" PIC flag so we must build both object types
     
    785493      lockfile="$output_obj.lock"
    786494      removelist="$removelist $output_obj $lockfile"
    787       trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     495      trap "$run $rm $removelist; exit 1" 1 2 15
    788496    else
    789       output_obj=
    790497      need_locks=no
    791498      lockfile=
     
    795502    # We use this script file to make the link, it avoids creating a new file
    796503    if test "$need_locks" = yes; then
    797       until $run ln "$progpath" "$lockfile" 2>/dev/null; do
     504      until $run ln "$0" "$lockfile" 2>/dev/null; do
    798505        $show "Waiting for $lockfile to be removed"
    799506        sleep 2
     
    801508    elif test "$need_locks" = warn; then
    802509      if test -f "$lockfile"; then
    803         $echo "\
     510        echo "\
    804511*** ERROR, $lockfile exists and contains:
    805512`cat $lockfile 2>/dev/null`
     
    813520
    814521        $run $rm $removelist
    815         exit $EXIT_FAILURE
    816       fi
    817       $echo $srcfile > "$lockfile"
     522        exit 1
     523      fi
     524      echo $srcfile > "$lockfile"
    818525    fi
    819526
     
    821528      eval srcfile=\"$fix_srcfile_path\"
    822529    fi
    823 
    824     $run $rm "$libobj" "${libobj}T"
    825 
    826     # Create a libtool object file (analogous to a ".la" file),
    827     # but don't create it if we're doing a dry run.
    828     test -z "$run" && cat > ${libobj}T <<EOF
    829 # $libobj - a libtool object file
    830 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
    831 #
    832 # Please DO NOT delete this file!
    833 # It is necessary for linking the library.
    834 
    835 # Name of the PIC object.
    836 EOF
    837530
    838531    # Only build a PIC object if we are building libtool libraries.
     
    842535
    843536      if test "$pic_mode" != no; then
    844         command="$base_compile $srcfile $pic_flag"
     537        # All platforms use -DPIC, to notify preprocessed assembler code.
     538        command="$base_compile $srcfile $pic_flag -DPIC"
    845539      else
    846540        # Don't build PIC code
    847541        command="$base_compile $srcfile"
    848542      fi
    849 
    850       if test ! -d "${xdir}$objdir"; then
    851         $show "$mkdir ${xdir}$objdir"
    852         $run $mkdir ${xdir}$objdir
    853         status=$?
    854         if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
    855           exit $status
    856         fi
    857       fi
    858 
    859       if test -z "$output_obj"; then
    860         # Place PIC objects in $objdir
    861         command="$command -o $lobj"
    862       fi
    863 
    864       $run $rm "$lobj" "$output_obj"
    865 
     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"
    866574      $show "$command"
    867575      if $run eval "$command"; then :
    868576      else
    869577        test -n "$output_obj" && $run $rm $removelist
    870         exit $EXIT_FAILURE
     578        exit 1
    871579      fi
    872580
    873581      if test "$need_locks" = warn &&
    874          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    875         $echo "\
     582         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
     583        echo "\
    876584*** ERROR, $lockfile contains:
    877585`cat $lockfile 2>/dev/null`
     
    888596
    889597        $run $rm $removelist
    890         exit $EXIT_FAILURE
     598        exit 1
    891599      fi
    892600
    893601      # Just move the object if needed, then go on to compile the next one
    894       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
    895         $show "$mv $output_obj $lobj"
    896         if $run $mv $output_obj $lobj; then :
     602      if test x"$output_obj" != x"$libobj"; then
     603        $show "$mv $output_obj $libobj"
     604        if $run $mv $output_obj $libobj; then :
    897605        else
    898606          error=$?
     
    902610      fi
    903611
    904       # Append the name of the PIC object to the libtool object file.
    905       test -z "$run" && cat >> ${libobj}T <<EOF
    906 pic_object='$objdir/$objname'
    907 
    908 EOF
     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
    909651
    910652      # Allow error messages only from the first compilation.
    911       if test "$suppress_opt" = yes; then
    912         suppress_output=' >/dev/null 2>&1'
    913       fi
    914     else
    915       # No PIC object so indicate it doesn't exist in the libtool
    916       # object file.
    917       test -z "$run" && cat >> ${libobj}T <<EOF
    918 pic_object=none
    919 
    920 EOF
     653      suppress_output=' >/dev/null 2>&1'
    921654    fi
    922655
     
    927660        command="$base_compile $srcfile"
    928661      else
    929         command="$base_compile $srcfile $pic_flag"
     662        # All platforms use -DPIC, to notify preprocessed assembler code.
     663        command="$base_compile $srcfile $pic_flag -DPIC"
    930664      fi
    931665      if test "$compiler_c_o" = yes; then
    932666        command="$command -o $obj"
     667        output_obj="$obj"
    933668      fi
    934669
    935670      # Suppress compiler output if we already did a PIC compilation.
    936671      command="$command$suppress_output"
    937       $run $rm "$obj" "$output_obj"
     672      $run $rm "$output_obj"
    938673      $show "$command"
    939674      if $run eval "$command"; then :
    940675      else
    941676        $run $rm $removelist
    942         exit $EXIT_FAILURE
     677        exit 1
    943678      fi
    944679
    945680      if test "$need_locks" = warn &&
    946          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    947         $echo "\
     681         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
     682        echo "\
    948683*** ERROR, $lockfile contains:
    949684`cat $lockfile 2>/dev/null`
     
    960695
    961696        $run $rm $removelist
    962         exit $EXIT_FAILURE
     697        exit 1
    963698      fi
    964699
    965700      # Just move the object if needed
    966       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
     701      if test x"$output_obj" != x"$obj"; then
    967702        $show "$mv $output_obj $obj"
    968703        if $run $mv $output_obj $obj; then :
     
    974709      fi
    975710
    976       # Append the name of the non-PIC object the libtool object file.
    977       # Only append if the libtool object file exists.
    978       test -z "$run" && cat >> ${libobj}T <<EOF
    979 # Name of the non-PIC object.
    980 non_pic_object='$objname'
    981 
    982 EOF
    983     else
    984       # Append the name of the non-PIC object the libtool object file.
    985       # Only append if the libtool object file exists.
    986       test -z "$run" && cat >> ${libobj}T <<EOF
    987 # Name of the non-PIC object.
    988 non_pic_object=none
    989 
    990 EOF
     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
    991726    fi
    992 
    993     $run $mv "${libobj}T" "${libobj}"
    994727
    995728    # Unlock the critical section if it was locked
     
    998731    fi
    999732
    1000     exit $EXIT_SUCCESS
     733    exit 0
    1001734    ;;
    1002735
     
    1009742      # we shouldn't force the makefile maintainer to figure out
    1010743      # which system we are compiling for in order to pass an extra
    1011       # flag for every libtool invocation.
     744      # flag for every libtool invokation.
    1012745      # allow_undefined=no
    1013746
     
    1024757    esac
    1025758    libtool_args="$nonopt"
    1026     base_compile="$nonopt $@"
    1027759    compile_command="$nonopt"
    1028760    finalize_command="$nonopt"
     
    1055787    no_install=no
    1056788    objs=
    1057     non_pic_objects=
    1058     precious_files_regex=
    1059789    prefer_static_libs=no
    1060790    preload=no
     
    1068798    thread_safe=no
    1069799    vinfo=
    1070     vinfo_number=no
    1071 
    1072     func_infer_tag $base_compile
    1073800
    1074801    # We need to know -static, to get the right output filenames.
     
    1101828
    1102829    # Go through the arguments, transforming them on the way.
    1103     while test "$#" -gt 0; do
     830    while test $# -gt 0; do
    1104831      arg="$1"
    1105832      shift
     
    1166893          if test ! -f "$arg"; then
    1167894            $echo "$modename: symbol file \`$arg' does not exist"
    1168             exit $EXIT_FAILURE
     895            exit 1
    1169896          fi
    1170897          prev=
     
    1176903          continue
    1177904          ;;
    1178         inst_prefix)
     905        inst_prefix)
    1179906          inst_prefix_dir="$arg"
    1180907          prev=
    1181908          continue
    1182909          ;;
    1183         precious_regex)
    1184           precious_files_regex="$arg"
    1185           prev=
    1186           continue
    1187           ;;
    1188910        release)
    1189911          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
    1297912          prev=
    1298913          continue
     
    1304919          *)
    1305920            $echo "$modename: only absolute run-paths are allowed" 1>&2
    1306             exit $EXIT_FAILURE
     921            exit 1
    1307922            ;;
    1308923          esac
     
    1336951          continue
    1337952          ;;
    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           ;;
    1351953        *)
    1352954          eval "$prev=\"\$arg\""
     
    1355957          ;;
    1356958        esac
    1357       fi # test -n "$prev"
     959      fi # test -n $prev
    1358960
    1359961      prevarg="$arg"
     
    1397999        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
    13981000          $echo "$modename: more than one -exported-symbols argument is not allowed"
    1399           exit $EXIT_FAILURE
     1001          exit 1
    14001002        fi
    14011003        if test "X$arg" = "X-export-symbols"; then
     
    14161018      -L[A-Z][A-Z]*:*)
    14171019        case $with_gcc/$host in
    1418         no/*-*-irix* | /*-*-irix*)
     1020        no/*-*-irix* | no/*-*-nonstopux*)
    14191021          compile_command="$compile_command $arg"
    14201022          finalize_command="$finalize_command $arg"
     
    14331035          if test -z "$absdir"; then
    14341036            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
    1435             exit $EXIT_FAILURE
     1037            exit 1
    14361038          fi
    14371039          dir="$absdir"
     
    14711073            test "X$arg" = "X-lc" && continue
    14721074            ;;
    1473           *-*-rhapsody* | *-*-darwin1.[012])
    1474             # Rhapsody C and math libraries are in the System framework
    1475             deplibs="$deplibs -framework System"
     1075          esac
     1076         elif test "X$arg" = "X-lc_r"; then
     1077          case $host in
     1078         *-*-openbsd* | *-*-freebsd*)
     1079            # Do not include libc_r directly, use -pthread flag.
    14761080            continue
     1081            ;;
    14771082          esac
    1478         elif test "X$arg" = "X-lc_r"; then
    1479          case $host in
    1480          *-*-openbsd* | *-*-freebsd*)
    1481            # Do not include libc_r directly, use -pthread flag.
    1482            continue
    1483            ;;
    1484          esac
    14851083        fi
    14861084        deplibs="$deplibs $arg"
     
    14881086        ;;
    14891087
    1490      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
    1491         deplibs="$deplibs $arg"
    1492         continue
    1493         ;;
    1494 
    14951088      -module)
    14961089        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
    15251090        continue
    15261091        ;;
     
    15501115        ;;
    15511116
    1552       -objectlist)
    1553         prev=objectlist
    1554         continue
    1555         ;;
    1556 
    15571117      -o) prev=output ;;
    1558 
    1559       -precious-files-regex)
    1560         prev=precious_regex
    1561         continue
    1562         ;;
    15631118
    15641119      -release)
     
    15841139        *)
    15851140          $echo "$modename: only absolute run-paths are allowed" 1>&2
    1586           exit $EXIT_FAILURE
     1141          exit 1
    15871142          ;;
    15881143        esac
     
    16101165      -version-info)
    16111166        prev=vinfo
    1612         continue
    1613         ;;
    1614       -version-number)
    1615         prev=vinfo
    1616         vinfo_number=yes
    16171167        continue
    16181168        ;;
     
    16651215        ;;
    16661216
    1667       -XCClinker)
    1668         prev=xcclinker
    1669         continue
    1670         ;;
    1671 
    16721217      # Some other compiler flag.
    16731218      -* | +*)
     
    16821227        ;;
    16831228
    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.
     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
     1237          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
    16991248          case $arg in
    1700           */* | *\\*) . $arg ;;
    1701           *) . ./$arg ;;
     1249          *.lo) libobjs="$libobjs $arg" ;;
     1250          *) objs="$objs $arg" ;;
    17021251          esac
    1703 
    1704           if test -z "$pic_object" || \
    1705              test -z "$non_pic_object" ||
    1706              test "$pic_object" = none && \
    1707              test "$non_pic_object" = none; then
    1708             $echo "$modename: cannot find name of object for \`$arg'" 1>&2
    1709             exit $EXIT_FAILURE
    1710           fi
    1711 
    1712           # Extract subdirectory from the argument.
    1713           xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
    1714           if test "X$xdir" = "X$arg"; then
    1715             xdir=
    1716           else
    1717             xdir="$xdir/"
    1718           fi
    1719 
    1720           if test "$pic_object" != none; then
    1721             # Prepend the subdirectory the object is found in.
    1722             pic_object="$xdir$pic_object"
    1723 
    1724             if test "$prev" = dlfiles; then
    1725               if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
    1726                 dlfiles="$dlfiles $pic_object"
    1727                 prev=
    1728                 continue
    1729               else
    1730                 # If libtool objects are unsupported, then we need to preload.
    1731                 prev=dlprefiles
    1732               fi
    1733             fi
    1734 
    1735             # CHECK ME:  I think I busted this.  -Ossama
    1736             if test "$prev" = dlprefiles; then
    1737               # Preload the old-style object.
    1738               dlprefiles="$dlprefiles $pic_object"
    1739               prev=
    1740             fi
    1741 
    1742             # A PIC object.
    1743             libobjs="$libobjs $pic_object"
    1744             arg="$pic_object"
    1745           fi
    1746 
    1747           # Non-PIC object.
    1748           if test "$non_pic_object" != none; then
    1749             # Prepend the subdirectory the object is found in.
    1750             non_pic_object="$xdir$non_pic_object"
    1751 
    1752             # A standard non-PIC object
    1753             non_pic_objects="$non_pic_objects $non_pic_object"
    1754             if test -z "$pic_object" || test "$pic_object" = none ; then
    1755               arg="$non_pic_object"
    1756             fi
    1757           fi
    1758         else
    1759           # Only an error if not doing a dry-run.
    1760           if test -z "$run"; then
    1761             $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
    1762             exit $EXIT_FAILURE
    1763           else
    1764             # Dry-run case.
    1765 
    1766             # Extract subdirectory from the argument.
    1767             xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
    1768             if test "X$xdir" = "X$arg"; then
    1769               xdir=
    1770             else
    1771               xdir="$xdir/"
    1772             fi
    1773 
    1774             pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
    1775             non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
    1776             libobjs="$libobjs $pic_object"
    1777             non_pic_objects="$non_pic_objects $non_pic_object"
    1778           fi
    17791252        fi
    17801253        ;;
     
    18271300      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
    18281301      $echo "$help" 1>&2
    1829       exit $EXIT_FAILURE
     1302      exit 1
    18301303    fi
    18311304
     
    18361309    fi
    18371310
    1838     oldlibs=
    18391311    # calculate the name of the file, without its directory
    18401312    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
     
    18571329    fi
    18581330    # Create the object directory.
    1859     if test ! -d "$output_objdir"; then
     1331    if test ! -d $output_objdir; then
    18601332      $show "$mkdir $output_objdir"
    18611333      $run $mkdir $output_objdir
    18621334      status=$?
    1863       if test "$status" -ne 0 && test ! -d "$output_objdir"; then
     1335      if test $status -ne 0 && test ! -d $output_objdir; then
    18641336        exit $status
    18651337      fi
     
    18711343      $echo "$modename: you must specify an output file" 1>&2
    18721344      $echo "$help" 1>&2
    1873       exit $EXIT_FAILURE
     1345      exit 1
    18741346      ;;
    18751347    *.$libext) linkmode=oldlib ;;
     
    18791351    esac
    18801352
    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
    18901353    specialdeplibs=
    1891 
    18921354    libs=
    18931355    # Find all interdependent deplibs by searching for libraries
     
    19011363      libs="$libs $deplib"
    19021364    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 
    19221365    deplibs=
    19231366    newdependency_libs=
     
    19341377          *)
    19351378            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
    1936             exit $EXIT_FAILURE
     1379            exit 1
    19371380            ;;
    19381381          esac
     
    19511394    esac
    19521395    for pass in $passes; do
    1953       if test "$linkmode,$pass" = "lib,link" ||
    1954          test "$linkmode,$pass" = "prog,scan"; then
    1955         libs="$deplibs"
    1956         deplibs=
    1957       fi
    1958       if test "$linkmode" = prog; then
     1396      if test $linkmode = prog; then
     1397        # Determine which files to process
    19591398        case $pass in
    1960         dlopen) libs="$dlfiles" ;;
     1399        dlopen)
     1400          libs="$dlfiles"
     1401          save_deplibs="$deplibs" # Collect dlpreopened libraries
     1402          deplibs=
     1403          ;;
    19611404        dlpreopen) libs="$dlprefiles" ;;
    19621405        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
    19631406        esac
    1964       fi
    1965       if test "$pass" = dlopen; then
    1966         # Collect dlpreopened libraries
    1967         save_deplibs="$deplibs"
    1968         deplibs=
    19691407      fi
    19701408      for deplib in $libs; do
     
    19721410        found=no
    19731411        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           ;;
    19831412        -l*)
    1984           if test "$linkmode" != lib && test "$linkmode" != prog; then
    1985             $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
     1413          if test $linkmode = oldlib && test $linkmode = obj; then
     1414            $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
    19861415            continue
    19871416          fi
    1988           if test "$pass" = conv; then
     1417          if test $pass = conv; then
    19891418            deplibs="$deplib $deplibs"
    19901419            continue
     
    19921421          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
    19931422          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
    1994             for search_ext in .la $std_shrext .so .a; do
    1995               # Search the libtool library
    1996               lib="$searchdir/lib${name}${search_ext}"
    1997               if test -f "$lib"; then
    1998                 if test "$search_ext" = ".la"; then
    1999                   found=yes
    2000                 else
    2001                   found=no
    2002                 fi
    2003                 break 2
    2004               fi
    2005             done
     1423            # Search the libtool library
     1424            lib="$searchdir/lib${name}.la"
     1425            if test -f "$lib"; then
     1426              found=yes
     1427              break
     1428            fi
    20061429          done
    20071430          if test "$found" != yes; then
     
    20121435            else
    20131436              deplibs="$deplib $deplibs"
    2014               test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
     1437              test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
    20151438            fi
    20161439            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
    20531440          fi
    20541441          ;; # -l
     
    20571444          lib)
    20581445            deplibs="$deplib $deplibs"
    2059             test "$pass" = conv && continue
     1446            test $pass = conv && continue
    20601447            newdependency_libs="$deplib $newdependency_libs"
    20611448            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    20621449            ;;
    20631450          prog)
    2064             if test "$pass" = conv; then
     1451            if test $pass = conv; then
    20651452              deplibs="$deplib $deplibs"
    20661453              continue
    20671454            fi
    2068             if test "$pass" = scan; then
     1455            if test $pass = scan; then
    20691456              deplibs="$deplib $deplibs"
     1457              newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    20701458            else
    20711459              compile_deplibs="$deplib $compile_deplibs"
    20721460              finalize_deplibs="$deplib $finalize_deplibs"
    20731461            fi
    2074             newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
    20751462            ;;
    20761463          *)
    2077             $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
     1464            $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
    20781465            ;;
    20791466          esac # linkmode
     
    20811468          ;; # -L
    20821469        -R*)
    2083           if test "$pass" = link; then
     1470          if test $pass = link; then
    20841471            dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
    20851472            # Make sure the xrpath contains only unique directories.
     
    20941481        *.la) lib="$deplib" ;;
    20951482        *.$libext)
    2096           if test "$pass" = conv; then
     1483          if test $pass = conv; then
    20971484            deplibs="$deplib $deplibs"
    20981485            continue
     
    21001487          case $linkmode in
    21011488          lib)
    2102             valid_a_lib=no
    2103             case $deplibs_check_method in
    2104               match_pattern*)
    2105                 set dummy $deplibs_check_method
    2106                 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
    2107                 if eval $echo \"$deplib\" 2>/dev/null \
    2108                     | $SED 10q \
    2109                     | $EGREP "$match_pattern_regex" > /dev/null; then
    2110                   valid_a_lib=yes
    2111                 fi
    2112                 ;;
    2113               pass_all)
    2114                 valid_a_lib=yes
    2115                 ;;
    2116             esac
    2117             if test "$valid_a_lib" != yes; then
    2118               $echo
    2119               $echo "*** Warning: Trying to link with static lib archive $deplib."
    2120               $echo "*** I have the capability to make that library automatically link in when"
    2121               $echo "*** you link to this library.  But I can only do this if you have a"
    2122               $echo "*** shared version of the library, which you do not appear to have"
    2123               $echo "*** because the file extensions .$libext of this argument makes me believe"
    2124               $echo "*** that it is just a static archive that I should not used here."
     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."
    21251497            else
    2126               $echo
    2127               $echo "*** Warning: Linking the shared library $output against the"
    2128               $echo "*** static library $deplib is not portable!"
     1498              echo
     1499              echo "*** Warning: Linking the shared library $output against the"
     1500              echo "*** static library $deplib is not portable!"
    21291501              deplibs="$deplib $deplibs"
    21301502            fi
     
    21321504            ;;
    21331505          prog)
    2134             if test "$pass" != link; then
     1506            if test $pass != link; then
    21351507              deplibs="$deplib $deplibs"
    21361508            else
     
    21431515          ;; # *.$libext
    21441516        *.lo | *.$objext)
    2145           if test "$pass" = conv; then
    2146             deplibs="$deplib $deplibs"
    2147           elif test "$linkmode" = prog; then
    2148             if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
    2149               # If there is no dlopen support or we're linking statically,
    2150               # we need to preload.
    2151               newdlprefiles="$newdlprefiles $deplib"
    2152               compile_deplibs="$deplib $compile_deplibs"
    2153               finalize_deplibs="$deplib $finalize_deplibs"
    2154             else
    2155               newdlfiles="$newdlfiles $deplib"
    2156             fi
     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"
    21571525          fi
    21581526          continue
     
    21631531          ;;
    21641532        esac # case $deplib
    2165         if test "$found" = yes || test -f "$lib"; then :
     1533        if test $found = yes || test -f "$lib"; then :
    21661534        else
    21671535          $echo "$modename: cannot find the library \`$lib'" 1>&2
    2168           exit $EXIT_FAILURE
     1536          exit 1
    21691537        fi
    21701538
    21711539        # Check to see that this really is a libtool archive.
    2172         if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     1540        if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    21731541        else
    21741542          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    2175           exit $EXIT_FAILURE
     1543          exit 1
    21761544        fi
    21771545
     
    21861554        old_library=
    21871555        # If the library was installed with an old release of libtool,
    2188         # it will not redefine variables installed, or shouldnotlink
     1556        # it will not redefine variable installed.
    21891557        installed=yes
    2190         shouldnotlink=no
    21911558
    21921559        # Read the .la file
     
    21981565        if test "$linkmode,$pass" = "lib,link" ||
    21991566           test "$linkmode,$pass" = "prog,scan" ||
    2200            { test "$linkmode" != prog && test "$linkmode" != lib; }; then
     1567           { test $linkmode = oldlib && test $linkmode = obj; }; then
     1568           # Add dl[pre]opened files of deplib
    22011569          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
    22021570          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
    22031571        fi
    22041572
    2205         if test "$pass" = conv; then
     1573        if test $pass = conv; then
    22061574          # Only check for convenience libraries
    22071575          deplibs="$lib $deplibs"
     
    22091577            if test -z "$old_library"; then
    22101578              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
    2211               exit $EXIT_FAILURE
     1579              exit 1
    22121580            fi
    22131581            # It is a libtool convenience library, so add in its objects.
     
    22241592              tmp_libs="$tmp_libs $deplib"
    22251593            done
    2226           elif test "$linkmode" != prog && test "$linkmode" != lib; then
     1594          elif test $linkmode != prog && test $linkmode != lib; then
    22271595            $echo "$modename: \`$lib' is not a convenience library" 1>&2
    2228             exit $EXIT_FAILURE
     1596            exit 1
    22291597          fi
    22301598          continue
    22311599        fi # $pass = conv
    2232 
    22331600
    22341601        # Get the name of the library we link against.
     
    22391606        if test -z "$linklib"; then
    22401607          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
    2241           exit $EXIT_FAILURE
     1608          exit 1
    22421609        fi
    22431610
    22441611        # This library was specified with -dlopen.
    2245         if test "$pass" = dlopen; then
     1612        if test $pass = dlopen; then
    22461613          if test -z "$libdir"; then
    22471614            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
    2248             exit $EXIT_FAILURE
    2249           fi
    2250           if test -z "$dlname" ||
    2251              test "$dlopen_support" != yes ||
    2252              test "$build_libtool_libs" = no; then
     1615            exit 1
     1616          fi
     1617          if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
    22531618            # If there is no dlname, no dlopen support or we're linking
    2254             # statically, we need to preload.  We also need to preload any
    2255             # dependent libraries so libltdl's deplib preloader doesn't
    2256             # bomb out in the load deplibs phase.
    2257             dlprefiles="$dlprefiles $lib $dependency_libs"
     1619            # statically, we need to preload.
     1620            dlprefiles="$dlprefiles $lib"
    22581621          else
    22591622            newdlfiles="$newdlfiles $lib"
     
    22881651          fi
    22891652        else
    2290           if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
    2291             dir="$ladir"
    2292             absdir="$abs_ladir"
    2293             # Remove this search path later
    2294             notinst_path="$notinst_path $abs_ladir"
    2295           else
    2296             dir="$ladir/$objdir"
    2297             absdir="$abs_ladir/$objdir"
    2298             # Remove this search path later
    2299             notinst_path="$notinst_path $abs_ladir"
    2300           fi
     1653          dir="$ladir/$objdir"
     1654          absdir="$abs_ladir/$objdir"
     1655          # Remove this search path later
     1656          notinst_path="$notinst_path $abs_ladir"
    23011657        fi # $installed = yes
    23021658        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    23031659
    23041660        # This library was specified with -dlpreopen.
    2305         if test "$pass" = dlpreopen; then
     1661        if test $pass = dlpreopen; then
    23061662          if test -z "$libdir"; then
    23071663            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
    2308             exit $EXIT_FAILURE
     1664            exit 1
    23091665          fi
    23101666          # Prefer using a static library (so that no silly _DYNAMIC symbols
     
    23221678        if test -z "$libdir"; then
    23231679          # Link the convenience library
    2324           if test "$linkmode" = lib; then
     1680          if test $linkmode = lib; then
    23251681            deplibs="$dir/$old_library $deplibs"
    23261682          elif test "$linkmode,$pass" = "prog,link"; then
     
    23281684            finalize_deplibs="$dir/$old_library $finalize_deplibs"
    23291685          else
    2330             deplibs="$lib $deplibs" # used for prog,scan pass
     1686            deplibs="$lib $deplibs"
    23311687          fi
    23321688          continue
    23331689        fi
    23341690
    2335 
    2336         if test "$linkmode" = prog && test "$pass" != link; then
     1691        if test $linkmode = prog && test $pass != link; then
    23371692          newlib_search_path="$newlib_search_path $ladir"
    23381693          deplibs="$lib $deplibs"
     
    23501705            esac
    23511706            # Need to link against all dependency_libs?
    2352             if test "$linkalldeplibs" = yes; then
     1707            if test $linkalldeplibs = yes; then
    23531708              deplibs="$deplib $deplibs"
    23541709            else
     
    23671722        fi # $linkmode = prog...
    23681723
    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 
     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
    23821731            # Hardcode the library path.
    23831732            # Skip directories that are in the system default run-time
     
    24011750              ;;
    24021751            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
    24031763          fi # $linkmode,$pass = prog,link...
    24041764
     
    24101770            continue
    24111771          fi
    2412         fi
    2413 
    2414         link_static=no # Whether the deplib will be linked statically
    2415         if test -n "$library_names" &&
    2416            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
     1772
    24171773          if test "$installed" = no; then
    24181774            notinst_deplibs="$notinst_deplibs $lib"
    24191775            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
    24571776          fi
    24581777
     
    24691788              # bleh windows
    24701789              case $host in
    2471               *cygwin* | mingw*)
     1790              *cygwin*)
    24721791                major=`expr $current - $age`
    24731792                versuffix="-$major"
     
    24811800            # Make a new name for the extract_expsyms_cmds to use
    24821801            soroot="$soname"
    2483             soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
    2484             newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
     1802            soname=`echo $soroot | ${SED} -e 's/^.*\///'`
     1803            newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
    24851804
    24861805            # If the library has no export list, then create one now
     
    24891808              $show "extracting exported symbol list from \`$soname'"
    24901809              save_ifs="$IFS"; IFS='~'
    2491               cmds=$extract_expsyms_cmds
     1810              eval cmds=\"$extract_expsyms_cmds\"
    24921811              for cmd in $cmds; do
    24931812                IFS="$save_ifs"
    2494                 eval cmd=\"$cmd\"
    24951813                $show "$cmd"
    24961814                $run eval "$cmd" || exit $?
     
    25031821              $show "generating import library for \`$soname'"
    25041822              save_ifs="$IFS"; IFS='~'
    2505               cmds=$old_archive_from_expsyms_cmds
     1823              eval cmds=\"$old_archive_from_expsyms_cmds\"
    25061824              for cmd in $cmds; do
    25071825                IFS="$save_ifs"
    2508                 eval cmd=\"$cmd\"
    25091826                $show "$cmd"
    25101827                $run eval "$cmd" || exit $?
     
    25151832            dir=$output_objdir
    25161833            linklib=$newlib
    2517           fi # test -n "$old_archive_from_expsyms_cmds"
    2518 
    2519           if test "$linkmode" = prog || test "$mode" != relink; then
     1834          fi # test -n $old_archive_from_expsyms_cmds
     1835
     1836          if test $linkmode = prog || test "$mode" != relink; then
    25201837            add_shlibpath=
    25211838            add_dir=
     
    25261843              if test "$hardcode_direct" = no; then
    25271844                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
    25441845              elif test "$hardcode_minus_L" = no; then
    25451846                case $host in
     
    25601861              elif test "$hardcode_minus_L" = yes; then
    25611862                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
    25701863                add="-l$name"
    25711864              elif test "$hardcode_shlibpath_var" = yes; then
     
    25811874            if test "$lib_linked" != yes; then
    25821875              $echo "$modename: configuration error: unsupported hardcode properties"
    2583               exit $EXIT_FAILURE
     1876              exit 1
    25841877            fi
    25851878
     
    25901883              esac
    25911884            fi
    2592             if test "$linkmode" = prog; then
     1885            if test $linkmode = prog; then
    25931886              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
    25941887              test -n "$add" && compile_deplibs="$add $compile_deplibs"
     
    26071900          fi
    26081901
    2609           if test "$linkmode" = prog || test "$mode" = relink; then
     1902          if test $linkmode = prog || test "$mode" = relink; then
    26101903            add_shlibpath=
    26111904            add_dir=
     
    26151908              add="$libdir/$linklib"
    26161909            elif test "$hardcode_minus_L" = yes; then
    2617               add_dir="-L$libdir"
     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"
    26181920              add="-l$name"
    26191921            elif test "$hardcode_shlibpath_var" = yes; then
     
    26231925              esac
    26241926              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
    26321927            else
    26331928              # We cannot seem to hardcode it, guess we'll fake it.
    2634               add_dir="-L$libdir"
    26351929              # Try looking first in the location we're being installed to.
     1930              add_dir=
    26361931              if test -n "$inst_prefix_dir"; then
    26371932                case "$libdir" in
    2638                   [\\/]*)
    2639                     add_dir="$add_dir -L$inst_prefix_dir$libdir"
    2640                     ;;
     1933                [\\/]*)
     1934                  add_dir="-L$inst_prefix_dir$libdir"
     1935                  ;;
    26411936                esac
    26421937              fi
     1938              add_dir="$add_dir -L$libdir"
    26431939              add="-l$name"
    26441940            fi
    26451941
    2646             if test "$linkmode" = prog; then
     1942            if test $linkmode = prog; then
    26471943              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
    26481944              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
     
    26521948            fi
    26531949          fi
    2654         elif test "$linkmode" = prog; then
     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
    26551960          # Here we assume that one of hardcode_direct or hardcode_minus_L
    26561961          # is not unsupported.  This is valid on all known static and
     
    26721977            # Just print a warning and add the library to dependency_libs so
    26731978            # that the program can be linked against the static library.
    2674             $echo
    2675             $echo "*** Warning: This system can not link to static lib archive $lib."
    2676             $echo "*** I have the capability to make that library automatically link in when"
    2677             $echo "*** you link to this library.  But I can only do this if you have a"
    2678             $echo "*** shared version of the library, which you do not appear to have."
     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."
    26791984            if test "$module" = yes; then
    2680               $echo "*** But as you try to build a module library, libtool will still create "
    2681               $echo "*** a static module, that should work as long as the dlopening application"
    2682               $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
     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."
    26831988              if test -z "$global_symbol_pipe"; then
    2684                 $echo
    2685                 $echo "*** However, this would only work if libtool was able to extract symbol"
    2686                 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    2687                 $echo "*** not find such a program.  So, this module is probably useless."
    2688                 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
     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."
    26891994              fi
    26901995              if test "$build_old_libs" = no; then
     
    27032008        fi # link shared/static library?
    27042009
    2705         if test "$linkmode" = lib; then
     2010        if test $linkmode = lib; then
    27062011          if test -n "$dependency_libs" &&
    2707              { test "$hardcode_into_libs" != yes ||
    2708                test "$build_old_libs" = yes ||
    2709                test "$link_static" = yes; }; then
     2012             { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
     2013               test $link_static = yes; }; then
    27102014            # Extract -R from dependency_libs
    27112015            temp_deplibs=
     
    27382042          done
    27392043
    2740           if test "$link_all_deplibs" != no; then
     2044          if test $link_all_deplibs != no; then
    27412045            # Add the search paths of all dependency libraries
    27422046            for deplib in $dependency_libs; do
     
    27582062                esac
    27592063                if grep "^installed=no" $deplib > /dev/null; then
    2760                   path="$absdir/$objdir"
     2064                  path="-L$absdir/$objdir"
    27612065                else
    27622066                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
    27632067                  if test -z "$libdir"; then
    27642068                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
    2765                     exit $EXIT_FAILURE
     2069                    exit 1
    27662070                  fi
    27672071                  if test "$absdir" != "$libdir"; then
    27682072                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
    27692073                  fi
    2770                   path="$absdir"
     2074                  path="-L$absdir"
    27712075                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
    28132076                ;;
    28142077              *) continue ;;
    2815               esac
    2816               case " $deplibs " in
    2817               *" $depdepl "*) ;;
    2818               *) deplibs="$depdepl $deplibs" ;;
    28192078              esac
    28202079              case " $deplibs " in
     
    28262085        fi # linkmode = lib
    28272086      done # for deplib in $libs
    2828       dependency_libs="$newdependency_libs"
    2829       if test "$pass" = dlpreopen; then
     2087      if test $pass = dlpreopen; then
    28302088        # Link the dlpreopened libraries before other libraries
    28312089        for deplib in $save_deplibs; do
     
    28332091        done
    28342092      fi
    2835       if test "$pass" != dlopen; then
    2836         if test "$pass" != conv; then
     2093      if test $pass != dlopen; then
     2094        test $pass != scan && dependency_libs="$newdependency_libs"
     2095        if test $pass != conv; then
    28372096          # Make sure lib_search_path contains only unique directories.
    28382097          lib_search_path=
     
    28562115          new_libs=
    28572116          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:
    28642117            case $deplib in
    28652118            -L*) new_libs="$deplib $new_libs" ;;
    2866             -R*) ;;
    28672119            *)
    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.
    28822120              case " $specialdeplibs " in
    28832121              *" $deplib "*) new_libs="$deplib $new_libs" ;;
     
    29072145        done # for var
    29082146      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
     2147      if test "$pass" = "conv" &&
     2148       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
     2149        libs="$deplibs" # reset libs
     2150        deplibs=
     2151      fi
    29232152    done # for pass
    2924     if test "$linkmode" = prog; then
     2153    if test $linkmode = prog; then
    29252154      dlfiles="$newdlfiles"
    29262155      dlprefiles="$newdlprefiles"
     
    29292158    case $linkmode in
    29302159    oldlib)
    2931       if test -n "$deplibs"; then
    2932         $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
    2933       fi
    2934 
    29352160      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    29362161        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
     
    29462171
    29472172      if test -n "$vinfo"; then
    2948         $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
     2173        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
    29492174      fi
    29502175
     
    29682193      lib*)
    29692194        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
    2970         eval shared_ext=\"$shrext_cmds\"
    29712195        eval libname=\"$libname_spec\"
    29722196        ;;
     
    29752199          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
    29762200          $echo "$help" 1>&2
    2977           exit $EXIT_FAILURE
     2201          exit 1
    29782202        fi
    29792203        if test "$need_lib_prefix" != no; then
    29802204          # Add the "lib" prefix for modules if required
    29812205          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
    2982           eval shared_ext=\"$shrext_cmds\"
    29832206          eval libname=\"$libname_spec\"
    29842207        else
     
    29912214        if test "$deplibs_check_method" != pass_all; then
    29922215          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
    2993           exit $EXIT_FAILURE
     2216          exit 1
    29942217        else
    2995           $echo
    2996           $echo "*** Warning: Linking the shared library $output against the non-libtool"
    2997           $echo "*** objects $objs is not portable!"
     2218          echo
     2219          echo "*** Warning: Linking the shared library $output against the non-libtool"
     2220          echo "*** objects $objs is not portable!"
    29982221          libobjs="$libobjs $objs"
    29992222        fi
     
    30052228
    30062229      set dummy $rpath
    3007       if test "$#" -gt 2; then
     2230      if test $# -gt 2; then
    30082231        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
    30092232      fi
     
    30142237        if test "$build_libtool_libs" = yes; then
    30152238          # Building a libtool convenience library.
    3016           # Some compilers have problems with a `.al' extension so
    3017           # convenience libraries should have the same extension an
    3018           # archive normally would.
     2239          libext=al
    30192240          oldlibs="$output_objdir/$libname.$libext $oldlibs"
    30202241          build_libtool_libs=convenience
     
    30232244
    30242245        if test -n "$vinfo"; then
    3025           $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
     2246          $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
    30262247        fi
    30272248
     
    30392260          $echo "$modename: too many parameters to \`-version-info'" 1>&2
    30402261          $echo "$help" 1>&2
    3041           exit $EXIT_FAILURE
    3042         fi
    3043 
    3044         # convert absolute version numbers to libtool ages
    3045         # this retains compatibility with .la files and attempts
    3046         # to make the code below a bit more comprehensible
    3047 
    3048         case $vinfo_number in
    3049         yes)
    3050           number_major="$2"
    3051           number_minor="$3"
    3052           number_revision="$4"
    3053           #
    3054           # There are really only two kinds -- those that
    3055           # use the current revision as the major version
    3056           # and those that subtract age and use age as
    3057           # a minor version.  But, then there is irix
    3058           # which has an extra 1 added just for fun
    3059           #
    3060           case $version_type in
    3061           darwin|linux|osf|windows)
    3062             current=`expr $number_major + $number_minor`
    3063             age="$number_minor"
    3064             revision="$number_revision"
    3065             ;;
    3066           freebsd-aout|freebsd-elf|sunos)
    3067             current="$number_major"
    3068             revision="$number_minor"
    3069             age="0"
    3070             ;;
    3071           irix|nonstopux)
    3072             current=`expr $number_major + $number_minor - 1`
    3073             age="$number_minor"
    3074             revision="$number_minor"
    3075             ;;
    3076           esac
    3077           ;;
    3078         no)
    3079           current="$2"
    3080           revision="$3"
    3081           age="$4"
    3082           ;;
    3083         esac
     2262          exit 1
     2263        fi
     2264
     2265        current="$2"
     2266        revision="$3"
     2267        age="$4"
    30842268
    30852269        # Check that each of the things are valid numbers.
    30862270        case $current in
    3087         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2271        [0-9]*) ;;
    30882272        *)
    30892273          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    30902274          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    3091           exit $EXIT_FAILURE
     2275          exit 1
    30922276          ;;
    30932277        esac
    30942278
    30952279        case $revision in
    3096         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2280        [0-9]*) ;;
    30972281        *)
    30982282          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    30992283          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    3100           exit $EXIT_FAILURE
     2284          exit 1
    31012285          ;;
    31022286        esac
    31032287
    31042288        case $age in
    3105         0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
     2289        [0-9]*) ;;
    31062290        *)
    31072291          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    31082292          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    3109           exit $EXIT_FAILURE
     2293          exit 1
    31102294          ;;
    31112295        esac
    31122296
    3113         if test "$age" -gt "$current"; then
     2297        if test $age -gt $current; then
    31142298          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    31152299          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    3116           exit $EXIT_FAILURE
     2300          exit 1
    31172301        fi
    31182302
     
    31312315          # Darwin ld doesn't like 0 for these options...
    31322316          minor_current=`expr $current + 1`
    3133           verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     2317          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
    31342318          ;;
    31352319
     
    31552339          # Add in all the interfaces that we are compatible with.
    31562340          loop=$revision
    3157           while test "$loop" -ne 0; do
     2341          while test $loop != 0; do
    31582342            iface=`expr $revision - $loop`
    31592343            loop=`expr $loop - 1`
     
    31782362          # Add in all the interfaces that we are compatible with.
    31792363          loop=$age
    3180           while test "$loop" -ne 0; do
     2364          while test $loop != 0; do
    31812365            iface=`expr $current - $loop`
    31822366            loop=`expr $loop - 1`
     
    32022386        *)
    32032387          $echo "$modename: unknown library version type \`$version_type'" 1>&2
    3204           $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    3205           exit $EXIT_FAILURE
     2388          echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
     2389          exit 1
    32062390          ;;
    32072391        esac
     
    32102394        if test -z "$vinfo" && test -n "$release"; then
    32112395          major=
     2396          verstring="0.0"
    32122397          case $version_type in
    32132398          darwin)
    32142399            # we can't check for "0.0" in archive_cmds due to quoting
    32152400            # problems, so we reset it completely
    3216             verstring=
     2401            verstring=""
    32172402            ;;
    32182403          *)
     
    32482433
    32492434      if test "$mode" != relink; then
    3250         # Remove our outputs, but don't remove object files since they
    3251         # may have been created when compiling PIC objects.
    3252         removelist=
    3253         tempremovelist=`$echo "$output_objdir/*"`
    3254         for p in $tempremovelist; do
    3255           case $p in
    3256             *.$objext)
    3257                ;;
    3258             $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
    3259                if test "X$precious_files_regex" != "X"; then
    3260                  if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
    3261                  then
    3262                    continue
    3263                  fi
    3264                fi
    3265                removelist="$removelist $p"
    3266                ;;
    3267             *) ;;
    3268           esac
    3269         done
    3270         if test -n "$removelist"; then
    3271           $show "${rm}r $removelist"
    3272           $run ${rm}r $removelist
    3273         fi
     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}.*
    32742438      fi
    32752439
     
    32842448      # Eliminate all temporary directories.
    32852449      for path in $notinst_path; do
    3286         lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
    3287         deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
    3288         dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
     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'`
    32892453      done
    32902454
     
    32992463          esac
    33002464        done
    3301         if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
     2465        if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
    33022466          dependency_libs="$temp_xrpath $dependency_libs"
    33032467        fi
     
    33392503          *-*-openbsd* | *-*-freebsd*)
    33402504            # Do not include libc due to us having libc/libc_r.
    3341             test "X$arg" = "X-lc" && continue
    33422505            ;;
    3343           *)
     2506          *)
    33442507            # Add libc to deplibs on all other systems if necessary.
    3345             if test "$build_libtool_need_lc" = "yes"; then
     2508            if test $build_libtool_need_lc = "yes"; then
    33462509              deplibs="$deplibs -lc"
    33472510            fi
     
    33702533          # whether the library exists or not.  But this is on
    33712534          # osf3 & osf4 and I'm not really sure... Just
    3372           # implementing what was already the behavior.
     2535          # implementing what was already the behaviour.
    33732536          newdeplibs=$deplibs
    33742537          ;;
     
    33832546EOF
    33842547          $rm conftest
    3385           $LTCC -o conftest conftest.c $deplibs
    3386           if test "$?" -eq 0 ; then
     2548          $CC -o conftest conftest.c $deplibs
     2549          if test $? -eq 0 ; then
    33872550            ldd_output=`ldd conftest`
    33882551            for i in $deplibs; do
    33892552              name="`expr $i : '-l\(.*\)'`"
    33902553              # If $name is empty we are operating on a -L argument.
    3391               if test "$name" != "" && test "$name" -ne "0"; then
    3392                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    3393                   case " $predeps $postdeps " in
    3394                   *" $i "*)
    3395                     newdeplibs="$newdeplibs $i"
    3396                     i=""
    3397                     ;;
    3398                   esac
    3399                 fi
    3400                 if test -n "$i" ; then
     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`
    34012587                  libname=`eval \\$echo \"$libname_spec\"`
    34022588                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
     
    34072593                  else
    34082594                    droppeddeps=yes
    3409                     $echo
    3410                     $echo "*** Warning: dynamic linker does not accept needed library $i."
    3411                     $echo "*** I have the capability to make that library automatically link in when"
    3412                     $echo "*** you link to this library.  But I can only do this if you have a"
    3413                     $echo "*** shared version of the library, which I believe you do not have"
    3414                     $echo "*** because a test_compile did reveal that the linker did not use it for"
    3415                     $echo "*** its dynamic dependency list that programs get resolved with at runtime."
    3416                   fi
    3417                 fi
    3418               else
    3419                 newdeplibs="$newdeplibs $i"
    3420               fi
    3421             done
    3422           else
    3423             # Error occurred in the first compile.  Let's try to salvage
    3424             # the situation: Compile a separate program for each library.
    3425             for i in $deplibs; do
    3426               name="`expr $i : '-l\(.*\)'`"
    3427               # If $name is empty we are operating on a -L argument.
    3428               if test "$name" != "" && test "$name" != "0"; then
    3429                 $rm conftest
    3430                 $LTCC -o conftest conftest.c $i
    3431                 # Did it work?
    3432                 if test "$?" -eq 0 ; then
    3433                   ldd_output=`ldd conftest`
    3434                   if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    3435                     case " $predeps $postdeps " in
    3436                     *" $i "*)
    3437                       newdeplibs="$newdeplibs $i"
    3438                       i=""
    3439                       ;;
    3440                     esac
    3441                   fi
    3442                   if test -n "$i" ; then
    3443                     libname=`eval \\$echo \"$libname_spec\"`
    3444                     deplib_matches=`eval \\$echo \"$library_names_spec\"`
    3445                     set dummy $deplib_matches
    3446                     deplib_match=$2
    3447                     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    3448                       newdeplibs="$newdeplibs $i"
    3449                     else
    3450                       droppeddeps=yes
    3451                       $echo
    3452                       $echo "*** Warning: dynamic linker does not accept needed library $i."
    3453                       $echo "*** I have the capability to make that library automatically link in when"
    3454                       $echo "*** you link to this library.  But I can only do this if you have a"
    3455                       $echo "*** shared version of the library, which you do not appear to have"
    3456                       $echo "*** because a test_compile did reveal that the linker did not use this one"
    3457                       $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
    3458                     fi
     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."
    34592602                  fi
    34602603                else
    34612604                  droppeddeps=yes
    3462                   $echo
    3463                   $echo "*** Warning!  Library $i is needed by this library but I was not able to"
    3464                   $echo "***  make it link in!  You will probably need to install it or some"
    3465                   $echo "*** library that it depends on before this library will be fully"
    3466                   $echo "*** functional.  Installing it before continuing would be even better."
     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."
    34672610                fi
    34682611              else
     
    34782621            name="`expr $a_deplib : '-l\(.*\)'`"
    34792622            # If $name is empty we are operating on a -L argument.
    3480             if test "$name" != "" && test  "$name" != "0"; then
    3481               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    3482                 case " $predeps $postdeps " in
    3483                 *" $a_deplib "*)
    3484                   newdeplibs="$newdeplibs $a_deplib"
    3485                   a_deplib=""
    3486                   ;;
    3487                 esac
    3488               fi
    3489               if test -n "$a_deplib" ; then
    3490                 libname=`eval \\$echo \"$libname_spec\"`
    3491                 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    3492                   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    3493                   for potent_lib in $potential_libs; do
     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
    34942628                      # Follow soft links.
    34952629                      if ls -lLd "$potent_lib" 2>/dev/null \
     
    35122646                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
    35132647                         | ${SED} 10q \
    3514                          | $EGREP "$file_magic_regex" > /dev/null; then
     2648                         | egrep "$file_magic_regex" > /dev/null; then
    35152649                        newdeplibs="$newdeplibs $a_deplib"
    35162650                        a_deplib=""
    35172651                        break 2
    35182652                      fi
    3519                   done
    3520                 done
    3521               fi
     2653                    done
     2654              done
    35222655              if test -n "$a_deplib" ; then
    35232656                droppeddeps=yes
    3524                 $echo
    3525                 $echo "*** Warning: linker path does not have real file for library $a_deplib."
    3526                 $echo "*** I have the capability to make that library automatically link in when"
    3527                 $echo "*** you link to this library.  But I can only do this if you have a"
    3528                 $echo "*** shared version of the library, which you do not appear to have"
    3529                 $echo "*** because I did check the linker path looking for a file starting"
     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"
    35302663                if test -z "$potlib" ; then
    3531                   $echo "*** with $libname but no candidates were found. (...for file magic test)"
     2664                  echo "*** with $libname but no candidates were found. (...for file magic test)"
    35322665                else
    3533                   $echo "*** with $libname and none of the candidates passed a file format test"
    3534                   $echo "*** using a file magic. Last file checked: $potlib"
     2666                  echo "*** with $libname and none of the candidates passed a file format test"
     2667                  echo "*** using a file magic. Last file checked: $potlib"
    35352668                fi
    35362669              fi
     
    35482681            # If $name is empty we are operating on a -L argument.
    35492682            if test -n "$name" && test "$name" != "0"; then
    3550               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    3551                 case " $predeps $postdeps " in
    3552                 *" $a_deplib "*)
    3553                   newdeplibs="$newdeplibs $a_deplib"
    3554                   a_deplib=""
    3555                   ;;
    3556                 esac
    3557               fi
    3558               if test -n "$a_deplib" ; then
    3559                 libname=`eval \\$echo \"$libname_spec\"`
    3560                 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    3561                   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    3562                   for potent_lib in $potential_libs; do
    3563                     potlib="$potent_lib" # see symlink-check above in file_magic test
    3564                     if eval $echo \"$potent_lib\" 2>/dev/null \
    3565                         | ${SED} 10q \
    3566                         | $EGREP "$match_pattern_regex" > /dev/null; then
    3567                       newdeplibs="$newdeplibs $a_deplib"
    3568                       a_deplib=""
    3569                       break 2
    3570                     fi
    3571                   done
     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
    35722695                done
    3573               fi
     2696              done
    35742697              if test -n "$a_deplib" ; then
    35752698                droppeddeps=yes
    3576                 $echo
    3577                 $echo "*** Warning: linker path does not have real file for library $a_deplib."
    3578                 $echo "*** I have the capability to make that library automatically link in when"
    3579                 $echo "*** you link to this library.  But I can only do this if you have a"
    3580                 $echo "*** shared version of the library, which you do not appear to have"
    3581                 $echo "*** because I did check the linker path looking for a file starting"
     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"
    35822705                if test -z "$potlib" ; then
    3583                   $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
     2706                  echo "*** with $libname but no candidates were found. (...for regex pattern test)"
    35842707                else
    3585                   $echo "*** with $libname and none of the candidates passed a file format test"
    3586                   $echo "*** using a regex pattern. Last file checked: $potlib"
     2708                  echo "*** with $libname and none of the candidates passed a file format test"
     2709                  echo "*** using a regex pattern. Last file checked: $potlib"
    35872710                fi
    35882711              fi
     
    35952718        none | unknown | *)
    35962719          newdeplibs=""
    3597           tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
    3598             -e 's/ -[LR][^ ]*//g'`
    3599           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    3600             for i in $predeps $postdeps ; do
    3601               # can't use Xsed below, because $i might contain '/'
    3602               tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
    3603             done
    3604           fi
    3605           if $echo "X $tmp_deplibs" | $Xsed -e 's/[     ]//g' \
    3606             | grep . >/dev/null; then
    3607             $echo
     2720          if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
     2721               -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
     2722             grep . >/dev/null; then
     2723            echo
    36082724            if test "X$deplibs_check_method" = "Xnone"; then
    3609               $echo "*** Warning: inter-library dependencies are not supported in this platform."
     2725              echo "*** Warning: inter-library dependencies are not supported in this platform."
    36102726            else
    3611               $echo "*** Warning: inter-library dependencies are not known to be supported."
     2727              echo "*** Warning: inter-library dependencies are not known to be supported."
    36122728            fi
    3613             $echo "*** All declared inter-library dependencies are being dropped."
     2729            echo "*** All declared inter-library dependencies are being dropped."
    36142730            droppeddeps=yes
    36152731          fi
     
    36312747        if test "$droppeddeps" = yes; then
    36322748          if test "$module" = yes; then
    3633             $echo
    3634             $echo "*** Warning: libtool could not satisfy all declared inter-library"
    3635             $echo "*** dependencies of module $libname.  Therefore, libtool will create"
    3636             $echo "*** a static module, that should work as long as the dlopening"
    3637             $echo "*** application is linked with the -dlopen flag."
     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."
    36382754            if test -z "$global_symbol_pipe"; then
    3639               $echo
    3640               $echo "*** However, this would only work if libtool was able to extract symbol"
    3641               $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    3642               $echo "*** not find such a program.  So, this module is probably useless."
    3643               $echo "*** \`nm' from GNU binutils and a full rebuild may help."
     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."
    36442760            fi
    36452761            if test "$build_old_libs" = no; then
     
    36512767            fi
    36522768          else
    3653             $echo "*** The inter-library dependencies that have been dropped here will be"
    3654             $echo "*** automatically added whenever a program is linked with this library"
    3655             $echo "*** or is declared to -dlopen it."
    3656 
    3657             if test "$allow_undefined" = no; then
    3658               $echo
    3659               $echo "*** Since this library must not contain undefined symbols,"
    3660               $echo "*** because either the platform does not support them or"
    3661               $echo "*** it was explicitly requested with -no-undefined,"
    3662               $echo "*** libtool will only create a static version of it."
     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."
    36632779              if test "$build_old_libs" = no; then
    36642780                oldlibs="$output_objdir/$libname.$libext"
     
    36822798      # Test again, we may have decided not to build it any more
    36832799      if test "$build_libtool_libs" = yes; then
    3684         if test "$hardcode_into_libs" = yes; then
     2800        if test $hardcode_into_libs = yes; then
    36852801          # Hardcode the library paths
    36862802          hardcode_libdirs=
     
    37182834             test -n "$hardcode_libdirs"; then
    37192835            libdir="$hardcode_libdirs"
    3720             if test -n "$hardcode_libdir_flag_spec_ld"; then
    3721               eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
    3722             else
    3723               eval dep_rpath=\"$hardcode_libdir_flag_spec\"
    3724             fi
     2836            eval dep_rpath=\"$hardcode_libdir_flag_spec\"
    37252837          fi
    37262838          if test -n "$runpath_var" && test -n "$perm_rpath"; then
     
    37422854
    37432855        # Get the real and link names of the library.
    3744         eval shared_ext=\"$shrext_cmds\"
    37452856        eval library_names=\"$library_names_spec\"
    37462857        set dummy $library_names
     
    37532864          soname="$realname"
    37542865        fi
    3755         if test -z "$dlname"; then
    3756           dlname=$soname
    3757         fi
     2866        test -z "$dlname" && dlname=$soname
    37582867
    37592868        lib="$output_objdir/$realname"
     
    37612870        do
    37622871          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
    37632889        done
    37642890
     
    37722898            export_symbols="$output_objdir/$libname.exp"
    37732899            $run $rm $export_symbols
    3774             cmds=$export_symbols_cmds
     2900            eval cmds=\"$export_symbols_cmds\"
    37752901            save_ifs="$IFS"; IFS='~'
    37762902            for cmd in $cmds; do
    37772903              IFS="$save_ifs"
    3778               eval cmd=\"$cmd\"
    3779               if len=`expr "X$cmd" : ".*"` &&
    3780                test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    3781                 $show "$cmd"
    3782                 $run eval "$cmd" || exit $?
    3783                 skipped_export=false
    3784               else
    3785                 # The command line is too long to execute in one step.
    3786                 $show "using reloadable object file for export list..."
    3787                 skipped_export=:
    3788               fi
     2904              $show "$cmd"
     2905              $run eval "$cmd" || exit $?
    37892906            done
    37902907            IFS="$save_ifs"
    37912908            if test -n "$export_symbols_regex"; then
    3792               $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
    3793               $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
     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"'
    37942911              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
    37952912              $run eval '$mv "${export_symbols}T" "$export_symbols"'
     
    38022919        fi
    38032920
    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 
    38152921        if test -n "$convenience"; then
    38162922          if test -n "$whole_archive_flag_spec"; then
    3817             save_libobjs=$libobjs
    38182923            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    38192924          else
    38202925            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
    38212934            generated="$generated $gentop"
    38222935
    3823             func_extract_archives $gentop $convenience
    3824             libobjs="$libobjs $func_extract_archives_result"
    3825           fi
    3826         fi
    3827        
     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
    38282961        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
    38292962          eval flag=\"$thread_safe_flag_spec\"
     
    38372970
    38382971        # 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
     2972        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
     2973          eval cmds=\"$archive_expsym_cmds\"
    38472974        else
    3848         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    3849           eval test_cmds=\"$archive_expsym_cmds\"
    3850           cmds=$archive_expsym_cmds
    3851         else
    3852           eval test_cmds=\"$archive_cmds\"
    3853           cmds=$archive_cmds
    3854           fi
    3855         fi
    3856 
    3857         if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
    3858            test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    3859           :
    3860         else
    3861           # The command line is too long to link in one step, link piecewise.
    3862           $echo "creating reloadable object files..."
    3863 
    3864           # Save the value of $output and $libobjs because we want to
    3865           # use them later.  If we have whole_archive_flag_spec, we
    3866           # want to use save_libobjs as it was before
    3867           # whole_archive_flag_spec was expanded, because we can't
    3868           # assume the linker understands whole_archive_flag_spec.
    3869           # This may have to be revisited, in case too many
    3870           # convenience libraries get linked in and end up exceeding
    3871           # the spec.
    3872           if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
    3873             save_libobjs=$libobjs
    3874           fi
    3875           save_output=$output
    3876 
    3877           # Clear the reloadable object creation command queue and
    3878           # initialize k to one.
    3879           test_cmds=
    3880           concat_cmds=
    3881           objlist=
    3882           delfiles=
    3883           last_robj=
    3884           k=1
    3885           output=$output_objdir/$save_output-${k}.$objext
    3886           # Loop over the list of objects to be linked.
    3887           for obj in $save_libobjs
    3888           do
    3889             eval test_cmds=\"$reload_cmds $objlist $last_robj\"
    3890             if test "X$objlist" = X ||
    3891                { len=`expr "X$test_cmds" : ".*"` &&
    3892                  test "$len" -le "$max_cmd_len"; }; then
    3893               objlist="$objlist $obj"
    3894             else
    3895               # The command $test_cmds is almost too long, add a
    3896               # command to the queue.
    3897               if test "$k" -eq 1 ; then
    3898                 # The first file doesn't have a previous command to add.
    3899                 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
    3900               else
    3901                 # All subsequent reloadable object files will link in
    3902                 # the last one created.
    3903                 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
     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"
    39042981              fi
    3905               last_robj=$output_objdir/$save_output-${k}.$objext
    3906               k=`expr $k + 1`
    3907               output=$output_objdir/$save_output-${k}.$objext
    3908               objlist=$obj
    3909               len=1
    3910             fi
     2982            done
     2983            deplibs="$tmp_deplibs"
    39112984          done
    3912           # Handle the remaining objects by creating one last
    3913           # reloadable object file.  All subsequent reloadable object
    3914           # files will link in the last one created.
    3915           test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    3916           eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
    3917 
    3918           if ${skipped_export-false}; then
    3919             $show "generating symbol list for \`$libname.la'"
    3920             export_symbols="$output_objdir/$libname.exp"
    3921             $run $rm $export_symbols
    3922             libobjs=$output
    3923             # Append the command to create the export file.
    3924             eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
    3925           fi
    3926 
    3927           # Set up a command to remove the reloadale object files
    3928           # after they are used.
    3929           i=0
    3930           while test "$i" -lt "$k"
    3931           do
    3932             i=`expr $i + 1`
    3933             delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
    3934           done
    3935 
    3936           $echo "creating a temporary reloadable object file: $output"
    3937 
    3938           # Loop through the commands generated above and execute them.
    3939           save_ifs="$IFS"; IFS='~'
    3940           for cmd in $concat_cmds; do
    3941             IFS="$save_ifs"
    3942             $show "$cmd"
    3943             $run eval "$cmd" || exit $?
    3944           done
    3945           IFS="$save_ifs"
    3946 
    3947           libobjs=$output
    3948           # Restore the value of output.
    3949           output=$save_output
    3950 
    3951           if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
    3952             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    3953           fi
    3954           # Expand the library linking commands again to reset the
    3955           # value of $libobjs for piecewise linking.
    3956 
    3957           # Do each of the archive commands.
    3958           if test "$module" = yes && test -n "$module_cmds" ; then
    3959             if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    3960               cmds=$module_expsym_cmds
    3961             else
    3962               cmds=$module_cmds
    3963             fi
    3964           else
    3965           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    3966             cmds=$archive_expsym_cmds
    3967           else
    3968             cmds=$archive_cmds
    3969             fi
    3970           fi
    3971 
    3972           # Append the command to remove the reloadable object files
    3973           # to the just-reset $cmds.
    3974           eval cmds=\"\$cmds~\$rm $delfiles\"
     2985          eval cmds=\"$archive_cmds\"
     2986          deplibs="$save_deplibs"
    39752987        fi
    39762988        save_ifs="$IFS"; IFS='~'
    39772989        for cmd in $cmds; do
    39782990          IFS="$save_ifs"
    3979           eval cmd=\"$cmd\"
    39802991          $show "$cmd"
    39812992          $run eval "$cmd" || exit $?
     
    39862997        if test "$mode" = relink; then
    39872998          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
    3988           exit $EXIT_SUCCESS
     2999          exit 0
    39893000        fi
    39903001
     
    40343045        if test -n "$objs$old_deplibs"; then
    40353046          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
    4036           exit $EXIT_FAILURE
     3047          exit 1
    40373048        fi
    40383049        libobj="$output"
     
    40633074        else
    40643075          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
    40653084          generated="$generated $gentop"
    40663085
    4067           func_extract_archives $gentop $convenience
    4068           reload_conv_objs="$reload_objs $func_extract_archives_result"
     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
    40693108        fi
    40703109      fi
     
    40743113
    40753114      output="$obj"
    4076       cmds=$reload_cmds
     3115      eval cmds=\"$reload_cmds\"
    40773116      save_ifs="$IFS"; IFS='~'
    40783117      for cmd in $cmds; do
    40793118        IFS="$save_ifs"
    4080         eval cmd=\"$cmd\"
    40813119        $show "$cmd"
    40823120        $run eval "$cmd" || exit $?
     
    40913129        fi
    40923130
    4093         exit $EXIT_SUCCESS
     3131        exit 0
    40943132      fi
    40953133
     
    41023140        # Create an invalid libtool object if no PIC, so that we don't
    41033141        # accidentally link it into a program.
    4104         # $show "echo timestamp > $libobj"
    4105         # $run eval "echo timestamp > $libobj" || exit $?
    4106         exit $EXIT_SUCCESS
     3142        $show "echo timestamp > $libobj"
     3143        $run eval "echo timestamp > $libobj" || exit $?
     3144        exit 0
    41073145      fi
    41083146
     
    41113149        reload_objs="$libobjs $reload_conv_objs"
    41123150        output="$libobj"
    4113         cmds=$reload_cmds
     3151        eval cmds=\"$reload_cmds\"
    41143152        save_ifs="$IFS"; IFS='~'
    41153153        for cmd in $cmds; do
    41163154          IFS="$save_ifs"
    4117           eval cmd=\"$cmd\"
    41183155          $show "$cmd"
    41193156          $run eval "$cmd" || exit $?
    41203157        done
    41213158        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 $?
    41223173      fi
    41233174
     
    41273178      fi
    41283179
    4129       exit $EXIT_SUCCESS
     3180      exit 0
    41303181      ;;
    41313182
    41323183    prog)
    41333184      case $host in
    4134         *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
     3185        *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
    41353186      esac
    41363187      if test -n "$vinfo"; then
     
    41543205        compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
    41553206        finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
    4156         ;;
    4157       esac
    4158 
    4159       case $host in
    4160       *darwin*)
    4161         # Don't allow lazy linking, it breaks C++ global constructors
    4162         if test "$tagname" = CXX ; then
    4163         compile_command="$compile_command ${wl}-bind_at_load"
    4164         finalize_command="$finalize_command ${wl}-bind_at_load"
    4165         fi
    4166         ;;
     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        ;;
    41673215      esac
    41683216
     
    43173365
    43183366            if test -n "$exclude_expsyms"; then
    4319               $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
     3367              $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
    43203368              $run eval '$mv "$nlist"T "$nlist"'
    43213369            fi
    43223370
    43233371            if test -n "$export_symbols_regex"; then
    4324               $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
     3372              $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
    43253373              $run eval '$mv "$nlist"T "$nlist"'
    43263374            fi
     
    43403388          for arg in $dlprefiles; do
    43413389            $show "extracting global C symbols from \`$arg'"
    4342             name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
    4343             $run eval '$echo ": $name " >> "$nlist"'
     3390            name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
     3391            $run eval 'echo ": $name " >> "$nlist"'
    43443392            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
    43453393          done
     
    43503398
    43513399            if test -n "$exclude_expsyms"; then
    4352               $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
     3400              egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
    43533401              $mv "$nlist"T "$nlist"
    43543402            fi
     
    43703418              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
    43713419            else
    4372               $echo '/* NONE */' >> "$output_objdir/$dlsyms"
     3420              echo '/* NONE */' >> "$output_objdir/$dlsyms"
    43733421            fi
    43743422
     
    44223470            case "$compile_command " in
    44233471            *" -static "*) ;;
    4424             *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
     3472            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
    44253473            esac;;
    44263474          *-*-hpux*)
    44273475            case "$compile_command " in
    44283476            *" -static "*) ;;
    4429             *) pic_flag_for_symtable=" $pic_flag";;
     3477            *) pic_flag_for_symtable=" $pic_flag -DPIC";;
    44303478            esac
    44313479          esac
    44323480
    44333481          # Now compile the dynamic symbol file.
    4434           $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
    4435           $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
     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 $?
    44363484
    44373485          # Clean up the generated files.
     
    44453493        *)
    44463494          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
    4447           exit $EXIT_FAILURE
     3495          exit 1
    44483496          ;;
    44493497        esac
     
    44583506      fi
    44593507
    4460       if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
     3508      if test $need_relink = no || test "$build_libtool_libs" != yes; then
    44613509        # Replace the output file specification.
    44623510        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
     
    45333581        $show "$link_command"
    45343582        $run eval "$link_command" || exit $?
    4535         exit $EXIT_SUCCESS
     3583        exit 0
    45363584      fi
    45373585
     
    45883636
    45893637      # Quote $echo for shipping.
    4590       if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
    4591         case $progpath in
    4592         [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
    4593         *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
     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";;
    45943642        esac
    45953643        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
     
    46033651        # a .exe suffix, so we strip it off here.
    46043652        case $output in
    4605           *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
     3653          *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
    46063654        esac
    46073655        # test for cygwin because mv fails w/o .exe extensions
    46083656        case $host in
    4609           *cygwin*)
    4610             exeext=.exe
    4611             outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
     3657          *cygwin*) exeext=.exe ;;
    46123658          *) exeext= ;;
    46133659        esac
    4614         case $host in
    4615           *cygwin* | *mingw* )
    4616             cwrappersource=`$echo ${objdir}/lt-${output}.c`
    4617             cwrapper=`$echo ${output}.exe`
    4618             $rm $cwrappersource $cwrapper
    4619             trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
    4620 
    4621             cat > $cwrappersource <<EOF
    4622 
    4623 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
    4624    Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
    4625 
    4626    The $output program cannot be directly executed until all the libtool
    4627    libraries that it depends on are installed.
    4628 
    4629    This wrapper executable should never be moved out of the build directory.
    4630    If it is, it will not operate correctly.
    4631 
    4632    Currently, it simply execs the wrapper *script* "/bin/sh $output",
    4633    but could eventually absorb all of the scripts functionality and
    4634    exec $objdir/$outputname directly.
    4635 */
    4636 EOF
    4637             cat >> $cwrappersource<<"EOF"
    4638 #include <stdio.h>
    4639 #include <stdlib.h>
    4640 #include <unistd.h>
    4641 #include <malloc.h>
    4642 #include <stdarg.h>
    4643 #include <assert.h>
    4644 
    4645 #if defined(PATH_MAX)
    4646 # define LT_PATHMAX PATH_MAX
    4647 #elif defined(MAXPATHLEN)
    4648 # define LT_PATHMAX MAXPATHLEN
    4649 #else
    4650 # define LT_PATHMAX 1024
    4651 #endif
    4652 
    4653 #ifndef DIR_SEPARATOR
    4654 #define DIR_SEPARATOR '/'
    4655 #endif
    4656 
    4657 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
    4658   defined (__OS2__)
    4659 #define HAVE_DOS_BASED_FILE_SYSTEM
    4660 #ifndef DIR_SEPARATOR_2
    4661 #define DIR_SEPARATOR_2 '\\'
    4662 #endif
    4663 #endif
    4664 
    4665 #ifndef DIR_SEPARATOR_2
    4666 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
    4667 #else /* DIR_SEPARATOR_2 */
    4668 # define IS_DIR_SEPARATOR(ch) \
    4669         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
    4670 #endif /* DIR_SEPARATOR_2 */
    4671 
    4672 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
    4673 #define XFREE(stale) do { \
    4674   if (stale) { free ((void *) stale); stale = 0; } \
    4675 } while (0)
    4676 
    4677 const char *program_name = NULL;
    4678 
    4679 void * xmalloc (size_t num);
    4680 char * xstrdup (const char *string);
    4681 char * basename (const char *name);
    4682 char * fnqualify(const char *path);
    4683 char * strendzap(char *str, const char *pat);
    4684 void lt_fatal (const char *message, ...);
    4685 
    4686 int
    4687 main (int argc, char *argv[])
    4688 {
    4689   char **newargz;
    4690   int i;
    4691 
    4692   program_name = (char *) xstrdup ((char *) basename (argv[0]));
    4693   newargz = XMALLOC(char *, argc+2);
    4694 EOF
    4695 
    4696             cat >> $cwrappersource <<EOF
    4697   newargz[0] = "$SHELL";
    4698 EOF
    4699 
    4700             cat >> $cwrappersource <<"EOF"
    4701   newargz[1] = fnqualify(argv[0]);
    4702   /* we know the script has the same name, without the .exe */
    4703   /* so make sure newargz[1] doesn't end in .exe */
    4704   strendzap(newargz[1],".exe");
    4705   for (i = 1; i < argc; i++)
    4706     newargz[i+1] = xstrdup(argv[i]);
    4707   newargz[argc+1] = NULL;
    4708 EOF
    4709 
    4710             cat >> $cwrappersource <<EOF
    4711   execv("$SHELL",newargz);
    4712 EOF
    4713 
    4714             cat >> $cwrappersource <<"EOF"
    4715 }
    4716 
    4717 void *
    4718 xmalloc (size_t num)
    4719 {
    4720   void * p = (void *) malloc (num);
    4721   if (!p)
    4722     lt_fatal ("Memory exhausted");
    4723 
    4724   return p;
    4725 }
    4726 
    4727 char *
    4728 xstrdup (const char *string)
    4729 {
    4730   return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
    4731 ;
    4732 }
    4733 
    4734 char *
    4735 basename (const char *name)
    4736 {
    4737   const char *base;
    4738 
    4739 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    4740   /* Skip over the disk name in MSDOS pathnames. */
    4741   if (isalpha (name[0]) && name[1] == ':')
    4742     name += 2;
    4743 #endif
    4744 
    4745   for (base = name; *name; name++)
    4746     if (IS_DIR_SEPARATOR (*name))
    4747       base = name + 1;
    4748   return (char *) base;
    4749 }
    4750 
    4751 char *
    4752 fnqualify(const char *path)
    4753 {
    4754   size_t size;
    4755   char *p;
    4756   char tmp[LT_PATHMAX + 1];
    4757 
    4758   assert(path != NULL);
    4759 
    4760   /* Is it qualified already? */
    4761 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    4762   if (isalpha (path[0]) && path[1] == ':')
    4763     return xstrdup (path);
    4764 #endif
    4765   if (IS_DIR_SEPARATOR (path[0]))
    4766     return xstrdup (path);
    4767 
    4768   /* prepend the current directory */
    4769   /* doesn't handle '~' */
    4770   if (getcwd (tmp, LT_PATHMAX) == NULL)
    4771     lt_fatal ("getcwd failed");
    4772   size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
    4773   p = XMALLOC(char, size);
    4774   sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
    4775   return p;
    4776 }
    4777 
    4778 char *
    4779 strendzap(char *str, const char *pat)
    4780 {
    4781   size_t len, patlen;
    4782 
    4783   assert(str != NULL);
    4784   assert(pat != NULL);
    4785 
    4786   len = strlen(str);
    4787   patlen = strlen(pat);
    4788 
    4789   if (patlen <= len)
    4790   {
    4791     str += len - patlen;
    4792     if (strcmp(str, pat) == 0)
    4793       *str = '\0';
    4794   }
    4795   return str;
    4796 }
    4797 
    4798 static void
    4799 lt_error_core (int exit_status, const char * mode,
    4800           const char * message, va_list ap)
    4801 {
    4802   fprintf (stderr, "%s: %s: ", program_name, mode);
    4803   vfprintf (stderr, message, ap);
    4804   fprintf (stderr, ".\n");
    4805 
    4806   if (exit_status >= 0)
    4807     exit (exit_status);
    4808 }
    4809 
    4810 void
    4811 lt_fatal (const char *message, ...)
    4812 {
    4813   va_list ap;
    4814   va_start (ap, message);
    4815   lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
    4816   va_end (ap);
    4817 }
    4818 EOF
    4819           # we should really use a build-platform specific compiler
    4820           # here, but OTOH, the wrappers (shell script and this C one)
    4821           # are only useful if you want to execute the "real" binary.
    4822           # Since the "real" binary is built for $host, then this
    4823           # wrapper might as well be built for $host, too.
    4824           $run $LTCC -s -o $cwrapper $cwrappersource
    4825           ;;
    4826         esac
    48273660        $rm $output
    4828         trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
     3661        trap "$rm $output; exit 1" 1 2 15
    48293662
    48303663        $echo > $output "\
     
    48423675# Sed substitution that helps us do robust quoting.  It backslashifies
    48433676# metacharacters that are still active within double-quoted strings.
    4844 Xsed='${SED} -e 1s/^X//'
     3677Xsed="${SED}"' -e 1s/^X//'
    48453678sed_quote_subst='$sed_quote_subst'
    48463679
    48473680# The HP-UX ksh and POSIX shell print the target directory to stdout
    48483681# if CDPATH is set.
    4849 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
     3682if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
    48503683
    48513684relink_command=\"$relink_command\"
     
    49023735
    49033736        if test "$fast_install" = yes; then
    4904           $echo >> $output "\
     3737          echo >> $output "\
    49053738  program=lt-'$outputname'$exeext
    49063739  progdir=\"\$thisdir/$objdir\"
     
    49183751    fi"
    49193752
    4920           $echo >> $output "\
     3753          echo >> $output "\
    49213754
    49223755    # relink executable if necessary
     
    49263759        $echo \"\$relink_command_output\" >&2
    49273760        $rm \"\$progdir/\$file\"
    4928         exit $EXIT_FAILURE
     3761        exit 1
    49293762      fi
    49303763    fi
     
    49363769  fi"
    49373770        else
    4938           $echo >> $output "\
     3771          echo >> $output "\
    49393772  program='$outputname'
    49403773  progdir=\"\$thisdir/$objdir\"
     
    49423775        fi
    49433776
    4944         $echo >> $output "\
     3777        echo >> $output "\
    49453778
    49463779  if test -f \"\$progdir/\$program\"; then"
     
    49533786
    49543787    # Some systems cannot cope with colon-terminated $shlibpath_var
    4955     # The second colon is a workaround for a bug in BeOS R4 sed
     3788    # The second colon is a workaround for a bug in BeOS R4 ${SED}
    49563789    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
    49573790
     
    49733806"
    49743807        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
    49753816        # Backslashes separate directories on plain windows
    49763817        *-*-mingw | *-*-os2*)
     
    49823823        *)
    49833824          $echo >> $output "\
    4984       exec \$progdir/\$program \${1+\"\$@\"}
     3825      # Export the path to the program.
     3826      PATH=\"\$progdir:\$PATH\"
     3827      export PATH
     3828
     3829      exec \$program \${1+\"\$@\"}
    49853830"
    49863831          ;;
     
    49883833        $echo >> $output "\
    49893834      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
    4990       exit $EXIT_FAILURE
     3835      exit 1
    49913836    fi
    49923837  else
     
    49943839    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
    49953840    \$echo \"This script is just a wrapper for \$program.\" 1>&2
    4996     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
    4997     exit $EXIT_FAILURE
     3841    echo \"See the $PACKAGE documentation for more information.\" 1>&2
     3842    exit 1
    49983843  fi
    49993844fi\
     
    50013846        chmod +x $output
    50023847      fi
    5003       exit $EXIT_SUCCESS
     3848      exit 0
    50043849      ;;
    50053850    esac
     
    50173862          build_libtool_libs=no
    50183863        else
    5019           oldobjs="$old_deplibs $non_pic_objects"
     3864          oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
    50203865        fi
    50213866        addlibs="$old_convenience"
     
    50243869      if test -n "$addlibs"; then
    50253870        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
    50263879        generated="$generated $gentop"
    50273880
    5028         func_extract_archives $gentop $addlibs
    5029         oldobjs="$oldobjs $func_extract_archives_result"
     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
    50303904      fi
    50313905
    50323906      # Do each command in the archive commands.
    50333907      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
    5034        cmds=$old_archive_from_new_cmds
     3908        eval cmds=\"$old_archive_from_new_cmds\"
    50353909      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="."
     3918            else
     3919              xdir="$xdir"
     3920            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
    50363928        eval cmds=\"$old_archive_cmds\"
    5037 
    5038         if len=`expr "X$cmds" : ".*"` &&
    5039              test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    5040           cmds=$old_archive_cmds
    5041         else
    5042           # the command line is too long to link in one step, link in parts
    5043           $echo "using piecewise archive linking..."
    5044           save_RANLIB=$RANLIB
    5045           RANLIB=:
    5046           objlist=
    5047           concat_cmds=
    5048           save_oldobjs=$oldobjs
    5049           # GNU ar 2.10+ was changed to match POSIX; thus no paths are
    5050           # encoded into archives.  This makes 'ar r' malfunction in
    5051           # this piecewise linking case whenever conflicting object
    5052           # names appear in distinct ar calls; check, warn and compensate.
    5053             if (for obj in $save_oldobjs
    5054             do
    5055               $echo "X$obj" | $Xsed -e 's%^.*/%%'
    5056             done | sort | sort -uc >/dev/null 2>&1); then
    5057             :
    5058           else
    5059             $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
    5060             $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
    5061             AR_FLAGS=cq
    5062           fi
    5063           # Is there a better way of finding the last object in the list?
    5064           for obj in $save_oldobjs
    5065           do
    5066             last_oldobj=$obj
    5067           done
    5068           for obj in $save_oldobjs
    5069           do
    5070             oldobjs="$objlist $obj"
    5071             objlist="$objlist $obj"
    5072             eval test_cmds=\"$old_archive_cmds\"
    5073             if len=`expr "X$test_cmds" : ".*"` &&
    5074                test "$len" -le "$max_cmd_len"; then
    5075               :
    5076             else
    5077               # the above command should be used before it gets too long
    5078               oldobjs=$objlist
    5079               if test "$obj" = "$last_oldobj" ; then
    5080                 RANLIB=$save_RANLIB
    5081               fi
    5082               test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    5083               eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
    5084               objlist=
    5085             fi
    5086           done
    5087           RANLIB=$save_RANLIB
    5088           oldobjs=$objlist
    5089           if test "X$oldobjs" = "X" ; then
    5090             eval cmds=\"\$concat_cmds\"
    5091           else
    5092             eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
    5093           fi
    5094         fi
    50953929      fi
    50963930      save_ifs="$IFS"; IFS='~'
    50973931      for cmd in $cmds; do
    5098         eval cmd=\"$cmd\"
    50993932        IFS="$save_ifs"
    51003933        $show "$cmd"
     
    51283961      done
    51293962      # Quote the link command for shipping.
    5130       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
     3963      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
    51313964      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
    5132       if test "$hardcode_automatic" = yes ; then
    5133         relink_command=
    5134       fi
    5135 
    51363965
    51373966      # Only create the output if not a dry run.
     
    51523981                if test -z "$libdir"; then
    51533982                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
    5154                   exit $EXIT_FAILURE
     3983                  exit 1
    51553984                fi
    51563985                newdependency_libs="$newdependency_libs $libdir/$name"
     
    51663995              if test -z "$libdir"; then
    51673996                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    5168                 exit $EXIT_FAILURE
     3997                exit 1
    51693998              fi
    51703999              newdlfiles="$newdlfiles $libdir/$name"
     
    51774006              if test -z "$libdir"; then
    51784007                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    5179                 exit $EXIT_FAILURE
     4008                exit 1
    51804009              fi
    51814010              newdlprefiles="$newdlprefiles $libdir/$name"
    51824011            done
    51834012            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"
    52034013          fi
    52044014          $rm $output
     
    52064016          tdlname=$dlname
    52074017          case $host,$output,$installed,$module,$dlname in
    5208             *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
     4018            *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
    52094019          esac
    52104020          $echo > $output "\
     
    52354045installed=$installed
    52364046
    5237 # Should we warn about portability when linking against -modules?
    5238 shouldnotlink=$module
    5239 
    52404047# Files to dlopen/dlpreopen
    52414048dlopen='$dlfiles'
     
    52444051# Directory that this library needs to be installed in:
    52454052libdir='$install_libdir'"
    5246           if test "$installed" = no && test "$need_relink" = yes; then
     4053          if test "$installed" = no && test $need_relink = yes; then
    52474054            $echo >> $output "\
    52484055relink_command=\"$relink_command\""
     
    52574064      ;;
    52584065    esac
    5259     exit $EXIT_SUCCESS
     4066    exit 0
    52604067    ;;
    52614068
     
    53464153      $echo "$modename: you must specify an install program" 1>&2
    53474154      $echo "$help" 1>&2
    5348       exit $EXIT_FAILURE
     4155      exit 1
    53494156    fi
    53504157
     
    53524159      $echo "$modename: the \`$prev' option requires an argument" 1>&2
    53534160      $echo "$help" 1>&2
    5354       exit $EXIT_FAILURE
     4161      exit 1
    53554162    fi
    53564163
     
    53624169      fi
    53634170      $echo "$help" 1>&2
    5364       exit $EXIT_FAILURE
     4171      exit 1
    53654172    fi
    53664173
     
    53804187      # Not a directory, so check to see that there is only one file specified.
    53814188      set dummy $files
    5382       if test "$#" -gt 2; then
     4189      if test $# -gt 2; then
    53834190        $echo "$modename: \`$dest' is not a directory" 1>&2
    53844191        $echo "$help" 1>&2
    5385         exit $EXIT_FAILURE
     4192        exit 1
    53864193      fi
    53874194    fi
     
    53954202          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
    53964203          $echo "$help" 1>&2
    5397           exit $EXIT_FAILURE
     4204          exit 1
    53984205          ;;
    53994206        esac
     
    54204227      *.la)
    54214228        # Check to see that this really is a libtool archive.
    5422         if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     4229        if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    54234230        else
    54244231          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
    54254232          $echo "$help" 1>&2
    5426           exit $EXIT_FAILURE
     4233          exit 1
    54274234        fi
    54284235
     
    54564263        if test -n "$relink_command"; then
    54574264          # Determine the prefix the user has applied to our future dir.
    5458           inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
     4265          inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
    54594266
    54604267          # Don't allow the user to place us outside of our expected
    54614268          # location b/c this prevents finding dependent libraries that
    54624269          # 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.
    54664270          if test "$inst_prefix_dir" = "$destdir"; then
    54674271            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
    5468             exit $EXIT_FAILURE
     4272            exit 1
    54694273          fi
    54704274
    54714275          if test -n "$inst_prefix_dir"; then
    54724276            # Stick the inst_prefix_dir data into the link command.
    5473             relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
     4277            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
    54744278          else
    5475             relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
     4279            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
    54764280          fi
    54774281
     
    54814285          else
    54824286            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
    5483             exit $EXIT_FAILURE
     4287            exit 1
    54844288          fi
    54854289        fi
     
    55034307          fi
    55044308
    5505           if test "$#" -gt 0; then
     4309          if test $# -gt 0; then
    55064310            # Delete the old symlinks, and create new ones.
    55074311            for linkname
     
    55164320          # Do each command in the postinstall commands.
    55174321          lib="$destdir/$realname"
    5518           cmds=$postinstall_cmds
     4322          eval cmds=\"$postinstall_cmds\"
    55194323          save_ifs="$IFS"; IFS='~'
    55204324          for cmd in $cmds; do
    55214325            IFS="$save_ifs"
    5522             eval cmd=\"$cmd\"
    55234326            $show "$cmd"
    55244327            $run eval "$cmd" || exit $?
     
    55604363          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
    55614364          $echo "$help" 1>&2
    5562           exit $EXIT_FAILURE
     4365          exit 1
    55634366          ;;
    55644367        esac
     
    55784381          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
    55794382        fi
    5580         exit $EXIT_SUCCESS
     4383        exit 0
    55814384        ;;
    55824385
     
    55904393        fi
    55914394
    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 
    56054395        # Do a test to see if this is really a libtool program.
    56064396        case $host in
    56074397        *cygwin*|*mingw*)
    5608             wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
     4398            wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
    56094399            ;;
    56104400        *)
     
    56124402            ;;
    56134403        esac
    5614         if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
     4404        if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
    56154405          notinst_deplibs=
    56164406          relink_command=
    56174407
    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
    56254408          # If there is no directory component, then add one.
    56264409          case $file in
    5627           */* | *\\*) . ${wrapperdot} ;;
    5628           *) . ./${wrapperdot} ;;
     4410          */* | *\\*) . $wrapper ;;
     4411          *) . ./$wrapper ;;
    56294412          esac
    56304413
     
    56324415          if test -z "$notinst_deplibs"; then
    56334416            $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
    5634             exit $EXIT_FAILURE
     4417            exit 1
    56354418          fi
    56364419
     
    56544437
    56554438          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
    56634439          # If there is no directory component, then add one.
    56644440          case $file in
    5665           */* | *\\*) . ${wrapperdot} ;;
    5666           *) . ./${wrapperdot} ;;
     4441          */* | *\\*) . $wrapper ;;
     4442          *) . ./$wrapper ;;
    56674443          esac
    56684444
     
    56724448              tmpdir="/tmp"
    56734449              test -n "$TMPDIR" && tmpdir="$TMPDIR"
    5674               tmpdir="$tmpdir/libtool-$$"
    5675               save_umask=`umask`
    5676               umask 0077
    5677               if $mkdir "$tmpdir"; then
    5678                 umask $save_umask
     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 :
    56794458              else
    5680                 umask $save_umask
    56814459                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
    56824460                continue
    56834461              fi
    5684               file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
     4462              file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    56854463              outputname="$tmpdir/$file"
    56864464              # Replace the output file specification.
     
    57004478          else
    57014479            # Install the binary that we compiled earlier.
    5702             file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
     4480            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
    57034481          fi
    57044482        fi
     
    57074485        # one anyways
    57084486        case $install_prog,$host in
    5709         */usr/bin/install*,*cygwin*)
     4487        /usr/bin/install*,*cygwin*)
    57104488          case $file:$destfile in
    57114489          *.exe:*.exe)
     
    57164494            ;;
    57174495          *:*.exe)
    5718             destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
     4496            destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
    57194497            ;;
    57204498          esac
     
    57374515      $run eval "$install_prog \$file \$oldlib" || exit $?
    57384516
    5739       if test -n "$stripme" && test -n "$old_striplib"; then
     4517      if test -n "$stripme" && test -n "$striplib"; then
    57404518        $show "$old_striplib $oldlib"
    57414519        $run eval "$old_striplib $oldlib" || exit $?
     
    57434521
    57444522      # Do each command in the postinstall commands.
    5745       cmds=$old_postinstall_cmds
     4523      eval cmds=\"$old_postinstall_cmds\"
    57464524      save_ifs="$IFS"; IFS='~'
    57474525      for cmd in $cmds; do
    57484526        IFS="$save_ifs"
    5749         eval cmd=\"$cmd\"
    57504527        $show "$cmd"
    57514528        $run eval "$cmd" || exit $?
     
    57614538      # Maybe just do a dry run.
    57624539      test -n "$run" && current_libdirs=" -n$current_libdirs"
    5763       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     4540      exec_cmd='$SHELL $0 --finish$current_libdirs'
    57644541    else
    5765       exit $EXIT_SUCCESS
     4542      exit 0
    57664543    fi
    57674544    ;;
     
    57824559        if test -n "$finish_cmds"; then
    57834560          # Do each command in the finish commands.
    5784           cmds=$finish_cmds
     4561          eval cmds=\"$finish_cmds\"
    57854562          save_ifs="$IFS"; IFS='~'
    57864563          for cmd in $cmds; do
    57874564            IFS="$save_ifs"
    5788             eval cmd=\"$cmd\"
    57894565            $show "$cmd"
    57904566            $run eval "$cmd" || admincmds="$admincmds
     
    58034579
    58044580    # Exit here if they wanted silent mode.
    5805     test "$show" = : && exit $EXIT_SUCCESS
    5806 
    5807     $echo "----------------------------------------------------------------------"
    5808     $echo "Libraries have been installed in:"
     4581    test "$show" = ":" && exit 0
     4582
     4583    echo "----------------------------------------------------------------------"
     4584    echo "Libraries have been installed in:"
    58094585    for libdir in $libdirs; do
    5810       $echo "   $libdir"
     4586      echo "   $libdir"
    58114587    done
    5812     $echo
    5813     $echo "If you ever happen to want to link against installed libraries"
    5814     $echo "in a given directory, LIBDIR, you must either use libtool, and"
    5815     $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
    5816     $echo "flag during linking and do at least one of the following:"
     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:"
    58174593    if test -n "$shlibpath_var"; then
    5818       $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
    5819       $echo "     during execution"
     4594      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
     4595      echo "     during execution"
    58204596    fi
    58214597    if test -n "$runpath_var"; then
    5822       $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
    5823       $echo "     during linking"
     4598      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
     4599      echo "     during linking"
    58244600    fi
    58254601    if test -n "$hardcode_libdir_flag_spec"; then
     
    58274603      eval flag=\"$hardcode_libdir_flag_spec\"
    58284604
    5829       $echo "   - use the \`$flag' linker flag"
     4605      echo "   - use the \`$flag' linker flag"
    58304606    fi
    58314607    if test -n "$admincmds"; then
    5832       $echo "   - have your system administrator run these commands:$admincmds"
     4608      echo "   - have your system administrator run these commands:$admincmds"
    58334609    fi
    58344610    if test -f /etc/ld.so.conf; then
    5835       $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
     4611      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
    58364612    fi
    5837     $echo
    5838     $echo "See any operating system documentation about shared libraries for"
    5839     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
    5840     $echo "----------------------------------------------------------------------"
    5841     exit $EXIT_SUCCESS
     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
    58424618    ;;
    58434619
     
    58514627      $echo "$modename: you must specify a COMMAND" 1>&2
    58524628      $echo "$help"
    5853       exit $EXIT_FAILURE
     4629      exit 1
    58544630    fi
    58554631
     
    58594635        $echo "$modename: \`$file' is not a file" 1>&2
    58604636        $echo "$help" 1>&2
    5861         exit $EXIT_FAILURE
     4637        exit 1
    58624638      fi
    58634639
     
    58664642      *.la)
    58674643        # Check to see that this really is a libtool archive.
    5868         if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
     4644        if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
    58694645        else
    58704646          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
    58714647          $echo "$help" 1>&2
    5872           exit $EXIT_FAILURE
     4648          exit 1
    58734649        fi
    58744650
     
    58974673        else
    58984674          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
    5899           exit $EXIT_FAILURE
     4675          exit 1
    59004676        fi
    59014677        ;;
     
    59374713      *)
    59384714        # Do a test to see if this is really a libtool program.
    5939         if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     4715        if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    59404716          # If there is no directory component, then add one.
    59414717          case $file in
     
    59604736      fi
    59614737
    5962       # Restore saved environment variables
     4738      # Restore saved enviroment variables
    59634739      if test "${save_LC_ALL+set}" = set; then
    59644740        LC_ALL="$save_LC_ALL"; export LC_ALL
     
    59694745
    59704746      # Now prepare to actually exec the command.
    5971       exec_cmd="\"\$cmd\"$args"
     4747      exec_cmd="\$cmd$args"
    59724748    else
    59734749      # Display what would be done.
     
    59764752        $echo "export $shlibpath_var"
    59774753      fi
    5978       eval \$echo \"\$cmd\"$args
    5979       exit $EXIT_SUCCESS
     4754      $echo "$cmd$args"
     4755      exit 0
    59804756    fi
    59814757    ;;
     
    60054781      $echo "$modename: you must specify an RM program" 1>&2
    60064782      $echo "$help" 1>&2
    6007       exit $EXIT_FAILURE
     4783      exit 1
    60084784    fi
    60094785
    60104786    rmdirs=
    60114787
    6012     origobjdir="$objdir"
    60134788    for file in $files; do
    60144789      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
    60154790      if test "X$dir" = "X$file"; then
    60164791        dir=.
    6017         objdir="$origobjdir"
     4792        objdir="$objdir"
    60184793      else
    6019         objdir="$dir/$origobjdir"
     4794        objdir="$dir/$objdir"
    60204795      fi
    60214796      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    6022       test "$mode" = uninstall && objdir="$dir"
     4797      test $mode = uninstall && objdir="$dir"
    60234798
    60244799      # Remember objdir for removal later, being careful to avoid duplicates
    6025       if test "$mode" = clean; then
     4800      if test $mode = clean; then
    60264801        case " $rmdirs " in
    60274802          *" $objdir "*) ;;
     
    60474822      *.la)
    60484823        # Possibly a libtool archive, so verify it.
    6049         if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
     4824        if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    60504825          . $dir/$name
    60514826
     
    60554830          done
    60564831          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
    6057           test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
    6058 
    6059           if test "$mode" = uninstall; then
     4832          test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
     4833
     4834          if test $mode = uninstall; then
    60604835            if test -n "$library_names"; then
    60614836              # Do each command in the postuninstall commands.
    6062               cmds=$postuninstall_cmds
     4837              eval cmds=\"$postuninstall_cmds\"
    60634838              save_ifs="$IFS"; IFS='~'
    60644839              for cmd in $cmds; do
    60654840                IFS="$save_ifs"
    6066                 eval cmd=\"$cmd\"
    60674841                $show "$cmd"
    60684842                $run eval "$cmd"
    6069                 if test "$?" -ne 0 && test "$rmforce" != yes; then
     4843                if test $? != 0 && test "$rmforce" != yes; then
    60704844                  exit_status=1
    60714845                fi
     
    60764850            if test -n "$old_library"; then
    60774851              # Do each command in the old_postuninstall commands.
    6078               cmds=$old_postuninstall_cmds
     4852              eval cmds=\"$old_postuninstall_cmds\"
    60794853              save_ifs="$IFS"; IFS='~'
    60804854              for cmd in $cmds; do
    60814855                IFS="$save_ifs"
    6082                 eval cmd=\"$cmd\"
    60834856                $show "$cmd"
    60844857                $run eval "$cmd"
    6085                 if test "$?" -ne 0 && test "$rmforce" != yes; then
     4858                if test $? != 0 && test "$rmforce" != yes; then
    60864859                  exit_status=1
    60874860                fi
     
    60954868
    60964869      *.lo)
    6097         # Possibly a libtool object, so verify it.
    6098         if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
    6099 
    6100           # Read the .lo file
    6101           . $dir/$name
    6102 
    6103           # Add PIC object to the list of files to remove.
    6104           if test -n "$pic_object" \
    6105              && test "$pic_object" != none; then
    6106             rmfiles="$rmfiles $dir/$pic_object"
    6107           fi
    6108 
    6109           # Add non-PIC object to the list of files to remove.
    6110           if test -n "$non_pic_object" \
    6111              && test "$non_pic_object" != none; then
    6112             rmfiles="$rmfiles $dir/$non_pic_object"
    6113           fi
     4870        if test "$build_old_libs" = yes; then
     4871          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
     4872          rmfiles="$rmfiles $dir/$oldobj"
    61144873        fi
    61154874        ;;
    61164875
    61174876      *)
    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
     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"
    61434886          fi
    61444887        fi
     
    61484891      $run $rm $rmfiles || exit_status=1
    61494892    done
    6150     objdir="$origobjdir"
    61514893
    61524894    # Try to remove the ${objdir}s in the directories where we deleted files
     
    61644906    $echo "$modename: you must specify a MODE" 1>&2
    61654907    $echo "$generic_help" 1>&2
    6166     exit $EXIT_FAILURE
     4908    exit 1
    61674909    ;;
    61684910  esac
     
    61714913    $echo "$modename: invalid operation mode \`$mode'" 1>&2
    61724914    $echo "$generic_help" 1>&2
    6173     exit $EXIT_FAILURE
     4915    exit 1
    61744916  fi
    61754917fi # test -z "$show_help"
     
    61774919if test -n "$exec_cmd"; then
    61784920  eval exec $exec_cmd
    6179   exit $EXIT_FAILURE
     4921  exit 1
    61804922fi
    61814923
     
    61964938    --quiet           same as \`--silent'
    61974939    --silent          don't print informational messages
    6198     --tag=TAG         use configuration variables from tag TAG
    61994940    --version         print version information
    62004941
     
    62104951
    62114952MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
    6212 a more detailed description of MODE.
    6213 
    6214 Report bugs to <bug-libtool@gnu.org>."
    6215   exit $EXIT_SUCCESS
     4953a more detailed description of MODE."
     4954  exit 0
    62164955  ;;
    62174956
     
    63245063  -no-undefined     declare that a library does not refer to external symbols
    63255064  -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
    63295065  -release RELEASE  specify package release information
    63305066  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
     
    63685104  $echo "$modename: invalid operation mode \`$mode'" 1>&2
    63695105  $echo "$help" 1>&2
    6370   exit $EXIT_FAILURE
     5106  exit 1
    63715107  ;;
    63725108esac
    63735109
    6374 $echo
     5110echo
    63755111$echo "Try \`$modename --help' for more information about other modes."
    63765112
    6377 exit $EXIT_SUCCESS
    6378 
    6379 # The TAGs below are defined such that we never get into a situation
    6380 # in which we disable both kinds of libraries.  Given conflicting
    6381 # choices, we go for a static library, that is the most portable,
    6382 # since we can't tell whether shared libraries were disabled because
    6383 # the user asked for that or because the platform doesn't support
    6384 # them.  This is particularly important on AIX, because we don't
    6385 # support having both static and shared libraries enabled at the same
    6386 # time on that platform, so we default to a shared-only configuration.
    6387 # If a disable-shared tag is given, we'll fallback to a static-only
    6388 # configuration.  But we'll never go from static-only to shared-only.
    6389 
    6390 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
    6391 build_libtool_libs=no
    6392 build_old_libs=yes
    6393 # ### END LIBTOOL TAG CONFIG: disable-shared
    6394 
    6395 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
    6396 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
    6397 # ### END LIBTOOL TAG CONFIG: disable-static
     5113exit 0
    63985114
    63995115# Local Variables:
Note: See TracChangeset for help on using the changeset viewer.