ltmain.sh
changeset 0 4ce2db4db959
child 26 25edca541dc9
equal deleted inserted replaced
-1:000000000000 0:4ce2db4db959
       
     1 # ltmain.sh - Provide generalized library-building support services.
       
     2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
       
     3 #
       
     4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
       
     5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
       
     6 #
       
     7 # This program is free software; you can redistribute it and/or modify
       
     8 # it under the terms of the GNU General Public License as published by
       
     9 # the Free Software Foundation; either version 2 of the License, or
       
    10 # (at your option) any later version.
       
    11 #
       
    12 # This program is distributed in the hope that it will be useful, but
       
    13 # WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    15 # General Public License for more details.
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License
       
    18 # along with this program; if not, write to the Free Software
       
    19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
       
    20 #
       
    21 # As a special exception to the GNU General Public License, if you
       
    22 # distribute this file as part of a program that contains a
       
    23 # configuration script generated by Autoconf, you may include it under
       
    24 # the same distribution terms that you use for the rest of that program.
       
    25 
       
    26 # Check that we have a working $echo.
       
    27 if test "X$1" = X--no-reexec; then
       
    28   # Discard the --no-reexec flag, and continue.
       
    29   shift
       
    30 elif test "X$1" = X--fallback-echo; then
       
    31   # Avoid inline document here, it may be left over
       
    32   :
       
    33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
       
    34   # Yippee, $echo works!
       
    35   :
       
    36 else
       
    37   # Restart under the correct shell, and then maybe $echo will work.
       
    38   exec $SHELL "$0" --no-reexec ${1+"$@"}
       
    39 fi
       
    40 
       
    41 if test "X$1" = X--fallback-echo; then
       
    42   # used as fallback echo
       
    43   shift
       
    44   cat <<EOF
       
    45 $*
       
    46 EOF
       
    47   exit 0
       
    48 fi
       
    49 
       
    50 # The name of this program.
       
    51 progname=`$echo "$0" | sed 's%^.*/%%'`
       
    52 modename="$progname"
       
    53 
       
    54 # Constants.
       
    55 PROGRAM=ltmain.sh
       
    56 PACKAGE=libtool
       
    57 VERSION=1.3c
       
    58 TIMESTAMP=" (1.612 1999/09/30 00:26:50)"
       
    59 
       
    60 default_mode=
       
    61 help="Try \`$progname --help' for more information."
       
    62 magic="%%%MAGIC variable%%%"
       
    63 mkdir="mkdir"
       
    64 mv="mv -f"
       
    65 rm="rm -f"
       
    66 
       
    67 # Sed substitution that helps us do robust quoting.  It backslashifies
       
    68 # metacharacters that are still active within double-quoted strings.
       
    69 Xsed='sed -e 1s/^X//'
       
    70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
       
    71 SP2NL='tr \040 \012'
       
    72 NL2SP='tr \015\012 \040\040'
       
    73 
       
    74 # NLS nuisances.
       
    75 # Only set LANG and LC_ALL to C if already set.
       
    76 # These must not be set unconditionally because not all systems understand
       
    77 # e.g. LANG=C (notably SCO).
       
    78 # We save the old values to restore during execute mode.
       
    79 if test "${LC_ALL+set}" = set; then
       
    80   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
       
    81 fi
       
    82 if test "${LANG+set}" = set; then
       
    83   save_LANG="$LANG"; LANG=C; export LANG
       
    84 fi
       
    85 
       
    86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
       
    87   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
       
    88   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
       
    89   exit 1
       
    90 fi
       
    91 
       
    92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
       
    93   echo "$modename: not configured to build any kind of library" 1>&2
       
    94   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
       
    95   exit 1
       
    96 fi
       
    97 
       
    98 # Global variables.
       
    99 mode=$default_mode
       
   100 nonopt=
       
   101 prev=
       
   102 prevopt=
       
   103 run=
       
   104 show="$echo"
       
   105 show_help=
       
   106 execute_dlfiles=
       
   107 lo2o="s/\\.lo\$/.${objext}/"
       
   108 o2lo="s/\\.${objext}\$/.lo/"
       
   109 
       
   110 # Parse our command line options once, thoroughly.
       
   111 while test $# -gt 0
       
   112 do
       
   113   arg="$1"
       
   114   shift
       
   115 
       
   116   case "$arg" in
       
   117   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
       
   118   *) optarg= ;;
       
   119   esac
       
   120 
       
   121   # If the previous option needs an argument, assign it.
       
   122   if test -n "$prev"; then
       
   123     case "$prev" in
       
   124     execute_dlfiles)
       
   125       eval "$prev=\"\$$prev \$arg\""
       
   126       ;;
       
   127     *)
       
   128       eval "$prev=\$arg"
       
   129       ;;
       
   130     esac
       
   131 
       
   132     prev=
       
   133     prevopt=
       
   134     continue
       
   135   fi
       
   136 
       
   137   # Have we seen a non-optional argument yet?
       
   138   case "$arg" in
       
   139   --help)
       
   140     show_help=yes
       
   141     ;;
       
   142 
       
   143   --version)
       
   144     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
       
   145     exit 0
       
   146     ;;
       
   147 
       
   148   --config)
       
   149     sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
       
   150     exit 0
       
   151     ;;
       
   152 
       
   153   --debug)
       
   154     echo "$progname: enabling shell trace mode"
       
   155     set -x
       
   156     ;;
       
   157 
       
   158   --dry-run | -n)
       
   159     run=:
       
   160     ;;
       
   161 
       
   162   --features)
       
   163     echo "host: $host"
       
   164     if test "$build_libtool_libs" = yes; then
       
   165       echo "enable shared libraries"
       
   166     else
       
   167       echo "disable shared libraries"
       
   168     fi
       
   169     if test "$build_old_libs" = yes; then
       
   170       echo "enable static libraries"
       
   171     else
       
   172       echo "disable static libraries"
       
   173     fi
       
   174     exit 0
       
   175     ;;
       
   176 
       
   177   --finish) mode="finish" ;;
       
   178 
       
   179   --mode) prevopt="--mode" prev=mode ;;
       
   180   --mode=*) mode="$optarg" ;;
       
   181 
       
   182   --quiet | --silent)
       
   183     show=:
       
   184     ;;
       
   185 
       
   186   -dlopen)
       
   187     prevopt="-dlopen"
       
   188     prev=execute_dlfiles
       
   189     ;;
       
   190 
       
   191   -*)
       
   192     $echo "$modename: unrecognized option \`$arg'" 1>&2
       
   193     $echo "$help" 1>&2
       
   194     exit 1
       
   195     ;;
       
   196 
       
   197   *)
       
   198     nonopt="$arg"
       
   199     break
       
   200     ;;
       
   201   esac
       
   202 done
       
   203 
       
   204 if test -n "$prevopt"; then
       
   205   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
       
   206   $echo "$help" 1>&2
       
   207   exit 1
       
   208 fi
       
   209 
       
   210 if test -z "$show_help"; then
       
   211 
       
   212   # Infer the operation mode.
       
   213   if test -z "$mode"; then
       
   214     case "$nonopt" in
       
   215     *cc | *++ | gcc* | *-gcc*)
       
   216       mode=link
       
   217       for arg
       
   218       do
       
   219 	case "$arg" in
       
   220 	-c)
       
   221 	   mode=compile
       
   222 	   break
       
   223 	   ;;
       
   224 	esac
       
   225       done
       
   226       ;;
       
   227     *db | *dbx | *strace | *truss)
       
   228       mode=execute
       
   229       ;;
       
   230     *install*|cp|mv)
       
   231       mode=install
       
   232       ;;
       
   233     *rm)
       
   234       mode=uninstall
       
   235       ;;
       
   236     *)
       
   237       # If we have no mode, but dlfiles were specified, then do execute mode.
       
   238       test -n "$execute_dlfiles" && mode=execute
       
   239 
       
   240       # Just use the default operation mode.
       
   241       if test -z "$mode"; then
       
   242 	if test -n "$nonopt"; then
       
   243 	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
       
   244 	else
       
   245 	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
       
   246 	fi
       
   247       fi
       
   248       ;;
       
   249     esac
       
   250   fi
       
   251 
       
   252   # Only execute mode is allowed to have -dlopen flags.
       
   253   if test -n "$execute_dlfiles" && test "$mode" != execute; then
       
   254     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
       
   255     $echo "$help" 1>&2
       
   256     exit 1
       
   257   fi
       
   258 
       
   259   # Change the help message to a mode-specific one.
       
   260   generic_help="$help"
       
   261   help="Try \`$modename --help --mode=$mode' for more information."
       
   262 
       
   263   # These modes are in order of execution frequency so that they run quickly.
       
   264   case "$mode" in
       
   265   # libtool compile mode
       
   266   compile)
       
   267     modename="$modename: compile"
       
   268     # Get the compilation command and the source file.
       
   269     base_compile=
       
   270     lastarg=
       
   271     srcfile="$nonopt"
       
   272     suppress_output=
       
   273 
       
   274     user_target=no
       
   275     for arg
       
   276     do
       
   277       # Accept any command-line options.
       
   278       case "$arg" in
       
   279       -o)
       
   280 	if test "$user_target" != "no"; then
       
   281 	  $echo "$modename: you cannot specify \`-o' more than once" 1>&2
       
   282 	  exit 1
       
   283 	fi
       
   284 	user_target=next
       
   285 	;;
       
   286 
       
   287       -static)
       
   288 	build_old_libs=yes
       
   289 	continue
       
   290 	;;
       
   291       esac
       
   292 
       
   293       case "$user_target" in
       
   294       next)
       
   295 	# The next one is the -o target name
       
   296 	user_target=yes
       
   297 	continue
       
   298 	;;
       
   299       yes)
       
   300 	# We got the output file
       
   301 	user_target=set
       
   302 	libobj="$arg"
       
   303 	continue
       
   304 	;;
       
   305       esac
       
   306 
       
   307       # Accept the current argument as the source file.
       
   308       lastarg="$srcfile"
       
   309       srcfile="$arg"
       
   310 
       
   311       # Aesthetically quote the previous argument.
       
   312 
       
   313       # Backslashify any backslashes, double quotes, and dollar signs.
       
   314       # These are the only characters that are still specially
       
   315       # interpreted inside of double-quoted scrings.
       
   316       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
       
   317 
       
   318       # Double-quote args containing other shell metacharacters.
       
   319       # Many Bourne shells cannot handle close brackets correctly in scan
       
   320       # sets, so we specify it separately.
       
   321       case "$lastarg" in
       
   322       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
   323 	lastarg="\"$lastarg\""
       
   324 	;;
       
   325       esac
       
   326 
       
   327       # Add the previous argument to base_compile.
       
   328       if test -z "$base_compile"; then
       
   329 	base_compile="$lastarg"
       
   330       else
       
   331 	base_compile="$base_compile $lastarg"
       
   332       fi
       
   333     done
       
   334 
       
   335     case "$user_target" in
       
   336     set)
       
   337       ;;
       
   338     no)
       
   339       # Get the name of the library object.
       
   340       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
       
   341       ;;
       
   342     *)
       
   343       $echo "$modename: you must specify a target with \`-o'" 1>&2
       
   344       exit 1
       
   345       ;;
       
   346     esac
       
   347 
       
   348     # Recognize several different file suffixes.
       
   349     # If the user specifies -o file.o, it is replaced with file.lo
       
   350     xform='[cCFSfmso]'
       
   351     case "$libobj" in
       
   352     *.ada) xform=ada ;;
       
   353     *.adb) xform=adb ;;
       
   354     *.ads) xform=ads ;;
       
   355     *.asm) xform=asm ;;
       
   356     *.c++) xform=c++ ;;
       
   357     *.cc) xform=cc ;;
       
   358     *.cpp) xform=cpp ;;
       
   359     *.cxx) xform=cxx ;;
       
   360     *.f90) xform=f90 ;;
       
   361     *.for) xform=for ;;
       
   362     esac
       
   363 
       
   364     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
       
   365 
       
   366     case "$libobj" in
       
   367     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
       
   368     *)
       
   369       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
       
   370       exit 1
       
   371       ;;
       
   372     esac
       
   373 
       
   374     if test -z "$base_compile"; then
       
   375       $echo "$modename: you must specify a compilation command" 1>&2
       
   376       $echo "$help" 1>&2
       
   377       exit 1
       
   378     fi
       
   379 
       
   380     # Delete any leftover library objects.
       
   381     if test "$build_old_libs" = yes; then
       
   382       removelist="$obj $libobj"
       
   383     else
       
   384       removelist="$libobj"
       
   385     fi
       
   386 
       
   387     $run $rm $removelist
       
   388     trap "$run $rm $removelist; exit 1" 1 2 15
       
   389 
       
   390     # Calculate the filename of the output object if compiler does
       
   391     # not support -o with -c
       
   392     if test "$compiler_c_o" = no; then
       
   393       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
       
   394       lockfile="$output_obj.lock"
       
   395       removelist="$removelist $output_obj $lockfile"
       
   396       trap "$run $rm $removelist; exit 1" 1 2 15
       
   397     else
       
   398       need_locks=no
       
   399       lockfile=
       
   400     fi
       
   401 
       
   402     # Lock this critical section if it is needed
       
   403     # We use this script file to make the link, it avoids creating a new file
       
   404     if test "$need_locks" = yes; then
       
   405       until ln "$0" "$lockfile" 2>/dev/null; do
       
   406 	$show "Waiting for $lockfile to be removed"
       
   407 	sleep 2
       
   408       done
       
   409     elif test "$need_locks" = warn; then
       
   410       if test -f "$lockfile"; then
       
   411 	echo "\
       
   412 *** ERROR, $lockfile exists and contains:
       
   413 `cat $lockfile 2>/dev/null`
       
   414 
       
   415 This indicates that another process is trying to use the same
       
   416 temporary object file, and libtool could not work around it because
       
   417 your compiler does not support \`-c' and \`-o' together.  If you
       
   418 repeat this compilation, it may succeed, by chance, but you had better
       
   419 avoid parallel builds (make -j) in this platform, or get a better
       
   420 compiler."
       
   421 
       
   422 	$run $rm $removelist
       
   423 	exit 1
       
   424       fi
       
   425       echo $srcfile > "$lockfile"
       
   426     fi
       
   427 
       
   428     if test -n "$fix_srcfile_path"; then
       
   429       eval srcfile=\"$fix_srcfile_path\"
       
   430     fi
       
   431 
       
   432     # Only build a PIC object if we are building libtool libraries.
       
   433     if test "$build_libtool_libs" = yes; then
       
   434       # Without this assignment, base_compile gets emptied.
       
   435       fbsd_hideous_sh_bug=$base_compile
       
   436 
       
   437       if test "$pic_mode" != no; then
       
   438 	# All platforms use -DPIC, to notify preprocessed assembler code.
       
   439 	command="$base_compile $pic_flag -DPIC $srcfile"
       
   440       else
       
   441 	# Don't build PIC code
       
   442 	command="$base_compile $srcfile"
       
   443       fi
       
   444       if test "$build_old_libs" = yes; then
       
   445 	lo_libobj="$libobj"
       
   446 	dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
       
   447 	if test "X$dir" = "X$libobj"; then
       
   448 	  dir="$objdir"
       
   449 	else
       
   450 	  dir="$dir/$objdir"
       
   451 	fi
       
   452 	libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
       
   453 
       
   454 	if test -d "$dir"; then
       
   455 	  $show "$rm $libobj"
       
   456 	  $run $rm $libobj
       
   457 	else
       
   458 	  $show "$mkdir $dir"
       
   459 	  $run $mkdir $dir
       
   460 	  status=$?
       
   461 	  if test $status -ne 0 && test ! -d $dir; then
       
   462 	    exit $status
       
   463 	  fi
       
   464 	fi
       
   465       fi
       
   466       if test "$compiler_o_lo" = yes; then
       
   467 	output_obj="$libobj"
       
   468 	command="$command -o $output_obj"
       
   469       elif test "$compiler_c_o" = yes; then
       
   470 	output_obj="$obj"
       
   471 	command="$command -o $output_obj"
       
   472       fi
       
   473 
       
   474       $run $rm "$output_obj"
       
   475       $show "$command"
       
   476       if $run eval "$command"; then :
       
   477       else
       
   478 	test -n "$output_obj" && $run $rm $removelist
       
   479 	exit 1
       
   480       fi
       
   481 
       
   482       if test "$need_locks" = warn &&
       
   483 	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
       
   484 	echo "\
       
   485 *** ERROR, $lockfile contains:
       
   486 `cat $lockfile 2>/dev/null`
       
   487 
       
   488 but it should contain:
       
   489 $srcfile
       
   490 
       
   491 This indicates that another process is trying to use the same
       
   492 temporary object file, and libtool could not work around it because
       
   493 your compiler does not support \`-c' and \`-o' together.  If you
       
   494 repeat this compilation, it may succeed, by chance, but you had better
       
   495 avoid parallel builds (make -j) in this platform, or get a better
       
   496 compiler."
       
   497 
       
   498 	$run $rm $removelist
       
   499 	exit 1
       
   500       fi
       
   501 
       
   502       # Just move the object if needed, then go on to compile the next one
       
   503       if test x"$output_obj" != x"$libobj"; then
       
   504 	$show "$mv $output_obj $libobj"
       
   505 	if $run $mv $output_obj $libobj; then :
       
   506 	else
       
   507 	  error=$?
       
   508 	  $run $rm $removelist
       
   509 	  exit $error
       
   510 	fi
       
   511       fi
       
   512 
       
   513       # If we have no pic_flag, then copy the object into place and finish.
       
   514       if (test -z "$pic_flag" || test "$pic_mode" != default) &&
       
   515 	 test "$build_old_libs" = yes; then
       
   516 	# Rename the .lo from within objdir to obj
       
   517 	if test -f $obj; then
       
   518 	  $show $rm $obj
       
   519 	  $run $rm $obj
       
   520 	fi
       
   521 
       
   522 	$show "$mv $libobj $obj"
       
   523 	if $run $mv $libobj $obj; then :
       
   524 	else
       
   525 	  error=$?
       
   526 	  $run $rm $removelist
       
   527 	  exit $error
       
   528 	fi
       
   529 
       
   530 	xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
       
   531 	if test "X$xdir" = "X$obj"; then
       
   532 	  xdir="."
       
   533 	else
       
   534 	  xdir="$xdir"
       
   535 	fi
       
   536 	baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
       
   537 	libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
       
   538 	# Now arrange that obj and lo_libobj become the same file
       
   539 	$show "(cd $xdir && $LN_S $baseobj $libobj)"
       
   540 	if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
       
   541 	  exit 0
       
   542 	else
       
   543 	  error=$?
       
   544 	  $run $rm $removelist
       
   545 	  exit $error
       
   546 	fi
       
   547       fi
       
   548 
       
   549       # Allow error messages only from the first compilation.
       
   550       suppress_output=' >/dev/null 2>&1'
       
   551     fi
       
   552 
       
   553     # Only build a position-dependent object if we build old libraries.
       
   554     if test "$build_old_libs" = yes; then
       
   555       if test "$pic_mode" != yes; then
       
   556 	# Don't build PIC code
       
   557 	command="$base_compile $srcfile"
       
   558       else
       
   559 	# All platforms use -DPIC, to notify preprocessed assembler code.
       
   560 	command="$base_compile $pic_flag -DPIC $srcfile"
       
   561       fi
       
   562       if test "$compiler_c_o" = yes; then
       
   563 	command="$command -o $obj"
       
   564 	output_obj="$obj"
       
   565       fi
       
   566 
       
   567       # Suppress compiler output if we already did a PIC compilation.
       
   568       command="$command$suppress_output"
       
   569       $run $rm "$output_obj"
       
   570       $show "$command"
       
   571       if $run eval "$command"; then :
       
   572       else
       
   573 	$run $rm $removelist
       
   574 	exit 1
       
   575       fi
       
   576 
       
   577       if test "$need_locks" = warn &&
       
   578 	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
       
   579 	echo "\
       
   580 *** ERROR, $lockfile contains:
       
   581 `cat $lockfile 2>/dev/null`
       
   582 
       
   583 but it should contain:
       
   584 $srcfile
       
   585 
       
   586 This indicates that another process is trying to use the same
       
   587 temporary object file, and libtool could not work around it because
       
   588 your compiler does not support \`-c' and \`-o' together.  If you
       
   589 repeat this compilation, it may succeed, by chance, but you had better
       
   590 avoid parallel builds (make -j) in this platform, or get a better
       
   591 compiler."
       
   592 
       
   593 	$run $rm $removelist
       
   594 	exit 1
       
   595       fi
       
   596 
       
   597       # Just move the object if needed
       
   598       if test x"$output_obj" != x"$obj"; then
       
   599 	$show "$mv $output_obj $obj"
       
   600 	if $run $mv $output_obj $obj; then :
       
   601 	else
       
   602 	  error=$?
       
   603 	  $run $rm $removelist
       
   604 	  exit $error
       
   605 	fi
       
   606       fi
       
   607 
       
   608       # Create an invalid libtool object if no PIC, so that we do not
       
   609       # accidentally link it into a program.
       
   610       if test "$build_libtool_libs" != yes; then
       
   611 	$show "echo timestamp > $libobj"
       
   612 	$run eval "echo timestamp > \$libobj" || exit $?
       
   613       else
       
   614 	# Move the .lo from within objdir
       
   615 	$show "$mv $libobj $lo_libobj"
       
   616 	if $run $mv $libobj $lo_libobj; then :
       
   617 	else
       
   618 	  error=$?
       
   619 	  $run $rm $removelist
       
   620 	  exit $error
       
   621 	fi
       
   622       fi
       
   623     fi
       
   624 
       
   625     # Unlock the critical section if it was locked
       
   626     if test "$need_locks" != no; then
       
   627       $rm "$lockfile"
       
   628     fi
       
   629 
       
   630     exit 0
       
   631     ;;
       
   632 
       
   633   # libtool link mode
       
   634   link | relink)
       
   635     modename="$modename: link"
       
   636     relink=no
       
   637     test "$mode" = "relink" && relink=yes
       
   638     case "$host" in
       
   639     *-*-cygwin* | *-*-mingw* | *-*-os2*)
       
   640       # It is impossible to link a dll without this setting, and
       
   641       # we shouldn't force the makefile maintainer to figure out
       
   642       # which system we are compiling for in order to pass an extra
       
   643       # flag for every libtool invokation.
       
   644       # allow_undefined=no
       
   645 
       
   646       # FIXME: Unfortunately, there are problems with the above when trying
       
   647       # to make a dll which has undefined symbols, in which case not
       
   648       # even a static library is built.  For now, we need to specify
       
   649       # -no-undefined on the libtool link line when we can be certain
       
   650       # that all symbols are satisfied, otherwise we get a static library.
       
   651       allow_undefined=yes
       
   652       ;;
       
   653     *)
       
   654       allow_undefined=yes
       
   655       ;;
       
   656     esac
       
   657     libtool_args="$nonopt"
       
   658     compile_command="$nonopt"
       
   659     finalize_command="$nonopt"
       
   660 
       
   661     compile_rpath=
       
   662     finalize_rpath=
       
   663     compile_shlibpath=
       
   664     finalize_shlibpath=
       
   665     convenience=
       
   666     old_convenience=
       
   667     deplibs=
       
   668     old_deplibs=
       
   669     compiler_flags=
       
   670     linker_flags=
       
   671     dllsearchpath=
       
   672     lib_search_path=`pwd`
       
   673 
       
   674     avoid_version=no
       
   675     dlfiles=
       
   676     dlprefiles=
       
   677     dlself=no
       
   678     export_dynamic=no
       
   679     export_symbols=
       
   680     export_symbols_regex=
       
   681     generated=
       
   682     libobjs=
       
   683     ltlibs=
       
   684     module=no
       
   685     objs=
       
   686     prefer_static_libs=no
       
   687     preload=no
       
   688     prev=
       
   689     prevarg=
       
   690     release=
       
   691     rpath=
       
   692     xrpath=
       
   693     perm_rpath=
       
   694     temp_rpath=
       
   695     thread_safe=no
       
   696     vinfo=
       
   697 
       
   698     # We need to know -static, to get the right output filenames.
       
   699     for arg
       
   700     do
       
   701       case "$arg" in
       
   702       -all-static | -static)
       
   703 	if test "X$arg" = "X-all-static"; then
       
   704 	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
       
   705 	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
       
   706 	  fi
       
   707 	  if test -n "$link_static_flag"; then
       
   708 	    dlopen_self=$dlopen_self_static
       
   709 	  fi
       
   710 	else
       
   711 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
       
   712 	    dlopen_self=$dlopen_self_static
       
   713 	  fi
       
   714 	fi
       
   715 	build_libtool_libs=no
       
   716 	build_old_libs=yes
       
   717 	prefer_static_libs=yes
       
   718 	break
       
   719 	;;
       
   720       esac
       
   721     done
       
   722 
       
   723     # See if our shared archives depend on static archives.
       
   724     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
       
   725 
       
   726     # Go through the arguments, transforming them on the way.
       
   727     while test $# -gt 0; do
       
   728       arg="$1"
       
   729       shift
       
   730       libtool_args="$libtool_args $arg"
       
   731 
       
   732       # If the previous option needs an argument, assign it.
       
   733       if test -n "$prev"; then
       
   734 	case "$prev" in
       
   735 	output)
       
   736 	  compile_command="$compile_command @OUTPUT@"
       
   737 	  finalize_command="$finalize_command @OUTPUT@"
       
   738 	  ;;
       
   739 	esac
       
   740 
       
   741 	case "$prev" in
       
   742 	dlfiles|dlprefiles)
       
   743 	  if test "$preload" = no; then
       
   744 	    # Add the symbol object into the linking commands.
       
   745 	    compile_command="$compile_command @SYMFILE@"
       
   746 	    finalize_command="$finalize_command @SYMFILE@"
       
   747 	    preload=yes
       
   748 	  fi
       
   749 	  case "$arg" in
       
   750 	  *.la | *.lo) ;;  # We handle these cases below.
       
   751 	  force)
       
   752 	    if test "$dlself" = no; then
       
   753 	      dlself=needless
       
   754 	      export_dynamic=yes
       
   755 	    fi
       
   756 	    prev=
       
   757 	    continue
       
   758 	    ;;
       
   759 	  self)
       
   760 	    if test "$prev" = dlprefiles; then
       
   761 	      dlself=yes
       
   762 	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
       
   763 	      dlself=yes
       
   764 	    else
       
   765 	      dlself=needless
       
   766 	      export_dynamic=yes
       
   767 	    fi
       
   768 	    prev=
       
   769 	    continue
       
   770 	    ;;
       
   771 	  *)
       
   772 	    if test "$prev" = dlfiles; then
       
   773 	      dlfiles="$dlfiles $arg"
       
   774 	    else
       
   775 	      dlprefiles="$dlprefiles $arg"
       
   776 	    fi
       
   777 	    prev=
       
   778 	    ;;
       
   779 	  esac
       
   780 	  ;;
       
   781 	expsyms)
       
   782 	  export_symbols="$arg"
       
   783 	  if test ! -f "$arg"; then
       
   784 	    $echo "$modename: symbol file \`$arg' does not exist"
       
   785 	    exit 1
       
   786 	  fi
       
   787 	  prev=
       
   788 	  continue
       
   789 	  ;;
       
   790 	expsyms_regex)
       
   791 	  export_symbols_regex="$arg"
       
   792 	  prev=
       
   793 	  continue
       
   794 	  ;;
       
   795 	release)
       
   796 	  release="-$arg"
       
   797 	  prev=
       
   798 	  continue
       
   799 	  ;;
       
   800 	rpath | xrpath)
       
   801 	  # We need an absolute path.
       
   802 	  case "$arg" in
       
   803 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
       
   804 	  *)
       
   805 	    $echo "$modename: only absolute run-paths are allowed" 1>&2
       
   806 	    exit 1
       
   807 	    ;;
       
   808 	  esac
       
   809 	  if test "$prev" = rpath; then
       
   810 	    case "$rpath " in
       
   811 	    *" $arg "*) ;;
       
   812 	    *) rpath="$rpath $arg" ;;
       
   813 	    esac
       
   814 	  else
       
   815 	    case "$xrpath " in
       
   816 	    *" $arg "*) ;;
       
   817 	    *) xrpath="$xrpath $arg" ;;
       
   818 	    esac
       
   819 	  fi
       
   820 	  prev=
       
   821 	  continue
       
   822 	  ;;
       
   823 	xcompiler)
       
   824 	  arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
   825 	  case "$arg" in
       
   826 	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
   827 	    arg="\"$arg\""
       
   828 	    ;;
       
   829 	  esac
       
   830 	  compiler_flags="$compiler_flags $arg"
       
   831 	  prev=
       
   832 	  continue
       
   833 	  ;;
       
   834 	xlinker)
       
   835 	  arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
   836 	  case "$arg" in
       
   837 	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
   838 	    arg="\"$arg\""
       
   839 	    ;;
       
   840 	  esac
       
   841 	  linker_flags="$linker_flags $arg"
       
   842 	  compiler_flags="$compiler_flags $wl$arg"
       
   843 	  prev=
       
   844 	  continue
       
   845 	  ;;
       
   846 	*)
       
   847 	  eval "$prev=\"\$arg\""
       
   848 	  prev=
       
   849 	  continue
       
   850 	  ;;
       
   851 	esac
       
   852       fi
       
   853 
       
   854       prevarg="$arg"
       
   855 
       
   856       case "$arg" in
       
   857       -all-static)
       
   858 	if test -n "$link_static_flag"; then
       
   859 	  compile_command="$compile_command $link_static_flag"
       
   860 	  finalize_command="$finalize_command $link_static_flag"
       
   861 	fi
       
   862 	continue
       
   863 	;;
       
   864 
       
   865       -allow-undefined)
       
   866 	# FIXME: remove this flag sometime in the future.
       
   867 	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
       
   868 	continue
       
   869 	;;
       
   870 
       
   871       -avoid-version)
       
   872 	avoid_version=yes
       
   873 	continue
       
   874 	;;
       
   875 
       
   876       -dlopen)
       
   877 	prev=dlfiles
       
   878 	continue
       
   879 	;;
       
   880 
       
   881       -dlpreopen)
       
   882 	prev=dlprefiles
       
   883 	continue
       
   884 	;;
       
   885 
       
   886       -export-dynamic)
       
   887 	export_dynamic=yes
       
   888 	continue
       
   889 	;;
       
   890 
       
   891       -export-symbols | -export-symbols-regex)
       
   892 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
       
   893 	  $echo "$modename: not more than one -exported-symbols argument allowed"
       
   894 	  exit 1
       
   895 	fi
       
   896 	if test "X$arg" = "X-export-symbols"; then
       
   897 	  prev=expsyms
       
   898 	else
       
   899 	  prev=expsyms_regex
       
   900 	fi
       
   901 	continue
       
   902 	;;
       
   903 
       
   904       -L*)
       
   905 	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
       
   906 	# We need an absolute path.
       
   907 	case "$dir" in
       
   908 	[\\/]* | [A-Za-z]:[\\/]*) ;;
       
   909 	*)
       
   910 	  absdir=`cd "$dir" && pwd`
       
   911 	  if test -z "$absdir"; then
       
   912 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
       
   913 	    exit 1
       
   914 	  fi
       
   915 	  dir="$absdir"
       
   916 	  ;;
       
   917 	esac
       
   918 	case "$deplibs " in
       
   919 	*" -L$dir "*) ;;
       
   920 	*)
       
   921 	  deplibs="$deplibs -L$dir"
       
   922 	  lib_search_path="$lib_search_path $dir"
       
   923 	  ;;
       
   924 	esac
       
   925 	case "$host" in
       
   926 	*-*-cygwin* | *-*-mingw* | *-*-os2*)
       
   927 	  case ":$dllsearchpath:" in
       
   928 	  *":$dir:"*) ;;
       
   929 	  *) dllsearchpath="$dllsearchpath:$dir";;
       
   930 	  esac
       
   931 	  ;;
       
   932 	esac
       
   933 	continue
       
   934 	;;
       
   935 
       
   936       -l*)
       
   937 	if test "$arg" = "-lc"; then
       
   938 	  case "$host" in
       
   939 	  *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
       
   940 	    # These systems don't actually have c library (as such)
       
   941 	    continue
       
   942 	    ;;
       
   943 	  esac
       
   944 	elif test "$arg" = "-lm"; then
       
   945 	  case "$host" in
       
   946 	  *-*-cygwin* | *-*-beos*)
       
   947 	    # These systems don't actually have math library (as such)
       
   948 	    continue
       
   949 	    ;;
       
   950 	  esac
       
   951 	fi
       
   952 	deplibs="$deplibs $arg"
       
   953 	continue
       
   954 	;;
       
   955 
       
   956       -module)
       
   957 	module=yes
       
   958 	continue
       
   959 	;;
       
   960 
       
   961       -no-fast-install)
       
   962 	fast_install=no
       
   963 	continue
       
   964 	;;
       
   965 
       
   966       -no-undefined)
       
   967 	allow_undefined=no
       
   968 	continue
       
   969 	;;
       
   970 
       
   971       -o) prev=output ;;
       
   972 
       
   973       -release)
       
   974 	prev=release
       
   975 	continue
       
   976 	;;
       
   977 
       
   978       -rpath)
       
   979 	prev=rpath
       
   980 	continue
       
   981 	;;
       
   982 
       
   983       -R)
       
   984 	prev=xrpath
       
   985 	continue
       
   986 	;;
       
   987 
       
   988       -R*)
       
   989 	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
       
   990 	# We need an absolute path.
       
   991 	case "$dir" in
       
   992 	[\\/]* | [A-Za-z]:[\\/]*) ;;
       
   993 	*)
       
   994 	  $echo "$modename: only absolute run-paths are allowed" 1>&2
       
   995 	  exit 1
       
   996 	  ;;
       
   997 	esac
       
   998 	case "$xrpath " in
       
   999 	*" $dir "*) ;;
       
  1000 	*) xrpath="$xrpath $dir" ;;
       
  1001 	esac
       
  1002 	continue
       
  1003 	;;
       
  1004 
       
  1005       -static)
       
  1006 	# If we have no pic_flag, then this is the same as -all-static.
       
  1007 	if test -z "$pic_flag" && test -n "$link_static_flag"; then
       
  1008 	  compile_command="$compile_command $link_static_flag"
       
  1009 	  finalize_command="$finalize_command $link_static_flag"
       
  1010 	fi
       
  1011 	continue
       
  1012 	;;
       
  1013 
       
  1014       -thread-safe)
       
  1015 	thread_safe=yes
       
  1016 	continue
       
  1017 	;;
       
  1018 
       
  1019       -version-info)
       
  1020 	prev=vinfo
       
  1021 	continue
       
  1022 	;;
       
  1023 	
       
  1024       -Wc,*)
       
  1025 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  1026 	case "$arg" in
       
  1027 	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  1028 	  arg="\"$arg\""
       
  1029 	  ;;
       
  1030 	esac
       
  1031 	flag=`$echo "X$arg" | $Xsed -e 's/^-Wc,//'`
       
  1032 	compiler_flags="$compiler_flags $flag"
       
  1033 	;;
       
  1034 
       
  1035       -Wl,*)
       
  1036 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  1037 	case "$arg" in
       
  1038 	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  1039 	  arg="\"$arg\""
       
  1040 	  ;;
       
  1041 	esac
       
  1042 	flag=`$echo "X$arg" | $Xsed -e 's/^-Wl,//'`
       
  1043 	linker_flags="$linker_flags $flag"
       
  1044 	compiler_flags="$compiler_flags $wl$flag"
       
  1045 	;;
       
  1046 
       
  1047       -Xcompiler)
       
  1048 	prev=xcompiler
       
  1049 	continue
       
  1050 	;;
       
  1051 
       
  1052       -Xlinker)
       
  1053 	prev=xlinker
       
  1054 	continue
       
  1055 	;;
       
  1056 
       
  1057       # Some other compiler flag.
       
  1058       -* | +*)
       
  1059 	# Unknown arguments in both finalize_command and compile_command need
       
  1060 	# to be aesthetically quoted because they are evaled later.
       
  1061 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  1062 	case "$arg" in
       
  1063 	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  1064 	  arg="\"$arg\""
       
  1065 	  ;;
       
  1066 	esac
       
  1067 	;;
       
  1068 
       
  1069       *.o | *.obj)
       
  1070 	# A standard object.
       
  1071 	objs="$objs $arg"
       
  1072 	;;
       
  1073 
       
  1074       *.lo)
       
  1075 	# A library object.
       
  1076 	if test "$prev" = dlfiles; then
       
  1077 	  dlfiles="$dlfiles $arg"
       
  1078 	  if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
       
  1079 	    prev=
       
  1080 	    continue
       
  1081 	  else
       
  1082 	    # If libtool objects are unsupported, then we need to preload.
       
  1083 	    prev=dlprefiles
       
  1084 	  fi
       
  1085 	fi
       
  1086 
       
  1087 	if test "$prev" = dlprefiles; then
       
  1088 	  # Preload the old-style object.
       
  1089 	  dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
       
  1090 	  prev=
       
  1091 	fi
       
  1092 	libobjs="$libobjs $arg"
       
  1093 	;;
       
  1094 
       
  1095       *.a | *.lib)
       
  1096 	# An archive.
       
  1097 	deplibs="$deplibs $arg"
       
  1098 	old_deplibs="$old_deplibs $arg"
       
  1099 	continue
       
  1100 	;;
       
  1101 
       
  1102       *.la)
       
  1103 	# A libtool-controlled library.
       
  1104 
       
  1105 	dlname=
       
  1106 	libdir=
       
  1107 	library_names=
       
  1108 	old_library=
       
  1109 
       
  1110 	# Check to see that this really is a libtool archive.
       
  1111 	if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  1112 	else
       
  1113 	  $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
       
  1114 	  exit 1
       
  1115 	fi
       
  1116 
       
  1117 	# If the library was installed with an old release of libtool,
       
  1118 	# it will not redefine variable installed.
       
  1119 	installed=yes
       
  1120 
       
  1121 	# Read the .la file
       
  1122 	# If there is no directory component, then add one.
       
  1123 	case "$arg" in
       
  1124 	*/* | *\\*) . $arg ;;
       
  1125 	*) . ./$arg ;;
       
  1126 	esac
       
  1127 
       
  1128 	# Get the name of the library we link against.
       
  1129 	linklib=
       
  1130 	for l in $old_library $library_names; do
       
  1131 	  linklib="$l"
       
  1132 	done
       
  1133 
       
  1134 	if test -z "$linklib"; then
       
  1135 	  $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
       
  1136 	  exit 1
       
  1137 	fi
       
  1138 
       
  1139 	if test "X$installed" = Xyes; then
       
  1140 	  dir="$libdir"
       
  1141 	else
       
  1142 	  dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
       
  1143 	  if test "X$dir" = "X$arg"; then
       
  1144 	    dir="$objdir"
       
  1145 	  else
       
  1146 	    dir="$dir/$objdir"
       
  1147 	  fi
       
  1148 	fi
       
  1149 
       
  1150 	# This library was specified with -dlopen.
       
  1151 	if test "$prev" = dlfiles; then
       
  1152 	  dlfiles="$dlfiles $arg"
       
  1153 	  if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
       
  1154 	    # If there is no dlname, no dlopen support or we're linking statically,
       
  1155 	    # we need to preload.
       
  1156 	    prev=dlprefiles
       
  1157 	  else
       
  1158 	    # We should not create a dependency on this library
       
  1159 	    prev=
       
  1160 	    continue
       
  1161 	  fi
       
  1162 	fi
       
  1163 
       
  1164 	# The library was specified with -dlpreopen.
       
  1165 	if test "$prev" = dlprefiles; then
       
  1166 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
       
  1167 	  # are required to link).
       
  1168 	  if test -n "$old_library"; then
       
  1169 	    dlprefiles="$dlprefiles $dir/$old_library"
       
  1170 	  else
       
  1171 	    dlprefiles="$dlprefiles $dir/$linklib"
       
  1172 	  fi
       
  1173 	  prev=
       
  1174 	fi
       
  1175 
       
  1176 	deplibs="$deplibs $arg"
       
  1177 	continue
       
  1178 	;;
       
  1179 
       
  1180       # Some other compiler argument.
       
  1181       *)
       
  1182 	# Unknown arguments in both finalize_command and compile_command need
       
  1183 	# to be aesthetically quoted because they are evaled later.
       
  1184 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  1185 	case "$arg" in
       
  1186 	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  1187 	  arg="\"$arg\""
       
  1188 	  ;;
       
  1189 	esac
       
  1190 	;;
       
  1191       esac
       
  1192 
       
  1193       # Now actually substitute the argument into the commands.
       
  1194       if test -n "$arg"; then
       
  1195 	compile_command="$compile_command $arg"
       
  1196 	finalize_command="$finalize_command $arg"
       
  1197       fi
       
  1198     done
       
  1199 
       
  1200     if test -n "$prev"; then
       
  1201       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
       
  1202       $echo "$help" 1>&2
       
  1203       exit 1
       
  1204     fi
       
  1205 
       
  1206     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       
  1207       eval arg=\"$export_dynamic_flag_spec\"
       
  1208       compile_command="$compile_command $arg"
       
  1209       finalize_command="$finalize_command $arg"
       
  1210     fi
       
  1211 
       
  1212     oldlibs=
       
  1213     # calculate the name of the file, without its directory
       
  1214     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
       
  1215     libobjs_save="$libobjs"
       
  1216 
       
  1217     if test -n "$shlibpath_var"; then
       
  1218       # get the directories listed in $shlibpath_var
       
  1219       eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
       
  1220     else
       
  1221       shlib_search_path=
       
  1222     fi
       
  1223     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
       
  1224     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
       
  1225     lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
       
  1226 
       
  1227     case "$output" in
       
  1228     "")
       
  1229       $echo "$modename: you must specify an output file" 1>&2
       
  1230       $echo "$help" 1>&2
       
  1231       exit 1
       
  1232       ;;
       
  1233     *.a | *.lib)
       
  1234       linkmode=oldlib ;;
       
  1235     *.lo | *.o | *.obj)
       
  1236       linkmode=obj ;;
       
  1237     *.la)
       
  1238       linkmode=lib ;;
       
  1239     *) # Anything else should be a program.
       
  1240       linkmode=prog ;;
       
  1241     esac
       
  1242     
       
  1243     if test $linkmode = lib || test $linkmode = prog; then
       
  1244       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
       
  1245       if test "X$output_objdir" = "X$output"; then
       
  1246 	output_objdir="$objdir"
       
  1247       else
       
  1248 	output_objdir="$output_objdir/$objdir"
       
  1249       fi
       
  1250 
       
  1251       # Create the object directory.
       
  1252       if test ! -d $output_objdir; then
       
  1253 	$show "$mkdir $output_objdir"
       
  1254 	$run $mkdir $output_objdir
       
  1255 	status=$?
       
  1256 	if test $status -ne 0 && test ! -d $output_objdir; then
       
  1257 	  exit $status
       
  1258 	fi
       
  1259       fi
       
  1260     else 
       
  1261       # Find libtool convenience libraries
       
  1262       for deplib in $deplibs; do
       
  1263 	case "$deplib" in
       
  1264 	-l* | -L*)
       
  1265 	  $echo "$modename: warning: \`-l' and \`-L' are ignored for archives/objects" 1>&2
       
  1266 	  continue
       
  1267 	  ;;
       
  1268 	esac
       
  1269 	if test -f "$deplib"; then :
       
  1270 	else
       
  1271 	  $echo "$modename: cannot find the library \`$deplib'" 1>&2
       
  1272 	  exit 1
       
  1273 	fi
       
  1274 	libdir=
       
  1275 	old_library=
       
  1276 
       
  1277 	# Check to see that this really is a libtool archive.
       
  1278 	if (sed -e '2q' $deplib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  1279 	else
       
  1280 	  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
       
  1281 	  exit 1
       
  1282 	fi
       
  1283 
       
  1284 	ladir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
       
  1285 	test "X$ladir" = "X$deplib" && ladir="."
       
  1286 
       
  1287 	# Read the .la file
       
  1288 	case "$deplib" in
       
  1289 	*/* | *\\*) . $deplib ;;
       
  1290 	*) . ./$deplib ;;
       
  1291 	esac
       
  1292 
       
  1293 	if test -z "$old_library"; then
       
  1294 	  $echo "$modename: cannot find name of link library for \`$deplib'" 1>&2
       
  1295 	  exit 1
       
  1296 	fi
       
  1297 
       
  1298 	if test -n "$libdir"; then
       
  1299 	  $echo "$modename: \`$deplib' is not a convenience library" 1>&2
       
  1300 	  exit 1
       
  1301 	fi
       
  1302 	
       
  1303 	# It is a libtool convenience library, so add in its objects.
       
  1304 	convenience="$convenience $ladir/$objdir/$old_library"
       
  1305 	old_convenience="$old_convenience $ladir/$objdir/$old_library"
       
  1306       done
       
  1307     fi
       
  1308 
       
  1309     case $linkmode in
       
  1310     oldlib)
       
  1311       if test -n "$deplibs"; then
       
  1312 	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
       
  1313       fi
       
  1314 
       
  1315       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
       
  1316 	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
       
  1317       fi
       
  1318 
       
  1319       if test -n "$rpath"; then
       
  1320 	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
       
  1321       fi
       
  1322 
       
  1323       if test -n "$xrpath"; then
       
  1324 	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
       
  1325       fi
       
  1326 
       
  1327       if test -n "$vinfo"; then
       
  1328 	$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
       
  1329       fi
       
  1330 
       
  1331       if test -n "$release"; then
       
  1332 	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
       
  1333       fi
       
  1334 
       
  1335       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
       
  1336 	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
       
  1337       fi
       
  1338 
       
  1339       # Now set the variables for building old libraries.
       
  1340       build_libtool_libs=no
       
  1341       oldlibs="$output"
       
  1342       objs="$objs$old_deplibs"
       
  1343       ;;
       
  1344 
       
  1345     lib)
       
  1346       # Make sure we only generate libraries of the form `libNAME.la'.
       
  1347       case "$outputname" in
       
  1348       lib*)
       
  1349 	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
       
  1350 	eval libname=\"$libname_spec\"
       
  1351 	;;
       
  1352       *)
       
  1353 	if test "$module" = no; then
       
  1354 	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
       
  1355 	  $echo "$help" 1>&2
       
  1356 	  exit 1
       
  1357 	fi
       
  1358 	if test "$need_lib_prefix" != no; then
       
  1359 	  # Add the "lib" prefix for modules if required
       
  1360 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
       
  1361 	  eval libname=\"$libname_spec\"
       
  1362 	else
       
  1363 	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
       
  1364 	fi
       
  1365 	;;
       
  1366       esac
       
  1367 
       
  1368       if test -n "$objs$old_deplibs"; then
       
  1369 	$echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
       
  1370 	exit 1
       
  1371       fi
       
  1372 
       
  1373       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
       
  1374 	$echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
       
  1375       fi
       
  1376 
       
  1377       set dummy $rpath
       
  1378       if test $# -gt 2; then
       
  1379 	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
       
  1380       fi
       
  1381       install_libdir="$2"
       
  1382 
       
  1383       oldlibs=
       
  1384       if test -z "$rpath"; then
       
  1385 	if test "$build_libtool_libs" = yes; then
       
  1386 	  # Building a libtool convenience library.
       
  1387 	  libext=al
       
  1388 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
       
  1389 	  build_libtool_libs=convenience
       
  1390 	  build_old_libs=yes
       
  1391 	fi
       
  1392 
       
  1393 	if test -n "$vinfo"; then
       
  1394 	  $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
       
  1395 	fi
       
  1396 
       
  1397 	if test -n "$release"; then
       
  1398 	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
       
  1399 	fi
       
  1400       else
       
  1401 
       
  1402 	# Parse the version information argument.
       
  1403 	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=':'
       
  1404 	set dummy $vinfo 0 0 0
       
  1405 	IFS="$save_ifs"
       
  1406 
       
  1407 	if test -n "$8"; then
       
  1408 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
       
  1409 	  $echo "$help" 1>&2
       
  1410 	  exit 1
       
  1411 	fi
       
  1412 
       
  1413 	current="$2"
       
  1414 	revision="$3"
       
  1415 	age="$4"
       
  1416 
       
  1417 	# Check that each of the things are valid numbers.
       
  1418 	case "$current" in
       
  1419 	0 | [1-9] | [1-9][0-9]*) ;;
       
  1420 	*)
       
  1421 	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
       
  1422 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
       
  1423 	  exit 1
       
  1424 	  ;;
       
  1425 	esac
       
  1426 
       
  1427 	case "$revision" in
       
  1428 	0 | [1-9] | [1-9][0-9]*) ;;
       
  1429 	*)
       
  1430 	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
       
  1431 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
       
  1432 	  exit 1
       
  1433 	  ;;
       
  1434 	esac
       
  1435 
       
  1436 	case "$age" in
       
  1437 	0 | [1-9] | [1-9][0-9]*) ;;
       
  1438 	*)
       
  1439 	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
       
  1440 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
       
  1441 	  exit 1
       
  1442 	  ;;
       
  1443 	esac
       
  1444 
       
  1445 	if test $age -gt $current; then
       
  1446 	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
       
  1447 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
       
  1448 	  exit 1
       
  1449 	fi
       
  1450 
       
  1451 	# Calculate the version variables.
       
  1452 	major=
       
  1453 	versuffix=
       
  1454 	verstring=
       
  1455 	case "$version_type" in
       
  1456 	none) ;;
       
  1457 
       
  1458 	irix)
       
  1459 	  major=`expr $current - $age + 1`
       
  1460 	  versuffix="$major.$revision"
       
  1461 	  verstring="sgi$major.$revision"
       
  1462 
       
  1463 	  # Add in all the interfaces that we are compatible with.
       
  1464 	  loop=$revision
       
  1465 	  while test $loop != 0; do
       
  1466 	    iface=`expr $revision - $loop`
       
  1467 	    loop=`expr $loop - 1`
       
  1468 	    verstring="sgi$major.$iface:$verstring"
       
  1469 	  done
       
  1470 	  ;;
       
  1471 
       
  1472 	linux)
       
  1473 	  major=.`expr $current - $age`
       
  1474 	  versuffix="$major.$age.$revision"
       
  1475 	  ;;
       
  1476 
       
  1477 	osf)
       
  1478 	  major=`expr $current - $age`
       
  1479 	  versuffix=".$current.$age.$revision"
       
  1480 	  verstring="$current.$age.$revision"
       
  1481 
       
  1482 	  # Add in all the interfaces that we are compatible with.
       
  1483 	  loop=$age
       
  1484 	  while test $loop != 0; do
       
  1485 	    iface=`expr $current - $loop`
       
  1486 	    loop=`expr $loop - 1`
       
  1487 	    verstring="$verstring:${iface}.0"
       
  1488 	  done
       
  1489 
       
  1490 	  # Make executables depend on our current version.
       
  1491 	  verstring="$verstring:${current}.0"
       
  1492 	  ;;
       
  1493 
       
  1494 	sunos)
       
  1495 	  major=".$current"
       
  1496 	  versuffix=".$current.$revision"
       
  1497 	  ;;
       
  1498 
       
  1499 	freebsd-aout)
       
  1500 	  major=".$current"
       
  1501 	  versuffix=".$current.$revision";
       
  1502 	  ;;
       
  1503 
       
  1504 	freebsd-elf)
       
  1505 	  major=".$current"
       
  1506 	  versuffix=".$current";
       
  1507 	  ;;
       
  1508 
       
  1509 	windows)
       
  1510 	  # Like Linux, but with '-' rather than '.', since we only
       
  1511 	  # want one extension on Windows 95.
       
  1512 	  major=`expr $current - $age`
       
  1513 	  versuffix="-$major-$age-$revision"
       
  1514 	  ;;
       
  1515 
       
  1516 	*)
       
  1517 	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
       
  1518 	  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
       
  1519 	  exit 1
       
  1520 	  ;;
       
  1521 	esac
       
  1522 
       
  1523 	# Clear the version info if we defaulted, and they specified a release.
       
  1524 	if test -z "$vinfo" && test -n "$release"; then
       
  1525 	  major=
       
  1526 	  verstring="0.0"
       
  1527 	  if test "$need_version" = no; then
       
  1528 	    versuffix=
       
  1529 	  else
       
  1530 	    versuffix=".0.0"
       
  1531 	  fi
       
  1532 	fi
       
  1533 
       
  1534 	# Remove version info from name if versioning should be avoided
       
  1535 	if test "$avoid_version" = yes && test "$need_version" = no; then
       
  1536 	  major=
       
  1537 	  versuffix=
       
  1538 	  verstring=""
       
  1539 	fi
       
  1540 	
       
  1541 	# Check to see if the archive will have undefined symbols.
       
  1542 	if test "$allow_undefined" = yes; then
       
  1543 	  if test "$allow_undefined_flag" = unsupported; then
       
  1544 	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
       
  1545 	    build_libtool_libs=no
       
  1546 	    build_old_libs=yes
       
  1547 	  fi
       
  1548 	else
       
  1549 	  # Don't allow undefined symbols.
       
  1550 	  allow_undefined_flag="$no_undefined_flag"
       
  1551 	fi
       
  1552       fi
       
  1553 
       
  1554       if test "$relink" = no; then
       
  1555 	# Remove our outputs.
       
  1556 	$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
       
  1557 	$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
       
  1558       fi
       
  1559 
       
  1560       # Now set the variables for building old libraries.
       
  1561       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
       
  1562 	oldlibs="$oldlibs $output_objdir/$libname.$libext"
       
  1563 
       
  1564 	# Transform .lo files to .o files.
       
  1565 	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
       
  1566       fi
       
  1567 
       
  1568       # Save some variables
       
  1569       name_save=$name
       
  1570       libname_save=$libname
       
  1571 	
       
  1572       # Find libtool libraries and add their dependencies and directories
       
  1573       save_deplibs="$deplibs"
       
  1574       deplibs=            # libraries to link (used in archive_cmds)
       
  1575       newdependency_libs= # all dependency libraries
       
  1576       uninst_path=        # paths that contain uninstalled libtool libraries
       
  1577       new_lib_search_path=
       
  1578       for deplib in $save_deplibs; do
       
  1579 	lib=
       
  1580 	case "$deplib" in
       
  1581 	-L*)
       
  1582 	  case "$deplibs " in
       
  1583 	  *" $deplib "*) ;;
       
  1584 	  *)
       
  1585 	    deplibs="$deplibs $deplib"
       
  1586 	    newdependency_libs="$newdependency_libs $deplib"
       
  1587 	    new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
       
  1588 	    ;;
       
  1589 	  esac
       
  1590 	  continue
       
  1591 	  ;;
       
  1592 	-l*)
       
  1593 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
       
  1594 	  found=no
       
  1595 	  for searchdir in $lib_search_path; do
       
  1596 	    # Search the libtool library
       
  1597 	    lib="$searchdir/lib${name}.la"
       
  1598 	    if test -f "$lib"; then
       
  1599 	      found=yes
       
  1600 	      break
       
  1601 	    fi
       
  1602 	  done
       
  1603 	  if test "$found" != yes; then
       
  1604 	    deplibs="$deplibs $deplib"
       
  1605 	    newdependency_libs="$newdependency_libs $deplib"
       
  1606 	    continue
       
  1607 	  fi
       
  1608 	  ;;
       
  1609 	*)
       
  1610 	  lib="$deplib"
       
  1611 	  if test -f "$lib"; then :
       
  1612 	  else
       
  1613 	    $echo "$modename: cannot find the library \`$lib'" 1>&2
       
  1614 	    exit 1
       
  1615 	  fi
       
  1616 	  ;;
       
  1617 	esac
       
  1618 	libdir=
       
  1619 	library_names=
       
  1620 	old_library=
       
  1621 
       
  1622 	# Check to see that this really is a libtool archive.
       
  1623 	if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  1624 	else
       
  1625 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
       
  1626 	  exit 1
       
  1627 	fi
       
  1628 
       
  1629 	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
       
  1630 	test "X$ladir" = "X$lib" && ladir="."
       
  1631 	# We need an absolute path.
       
  1632 	case "$ladir" in
       
  1633 	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
       
  1634 	*)
       
  1635 	  abs_ladir=`cd "$ladir" && pwd`
       
  1636 	  if test -z "$abs_ladir"; then
       
  1637 	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
       
  1638 	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
       
  1639 	    abs_ladir="$ladir"
       
  1640 	  fi
       
  1641 	  ;;
       
  1642 	esac
       
  1643 	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
       
  1644 
       
  1645 	# If the library was installed with an old release of libtool,
       
  1646 	# it will not redefine variable installed.
       
  1647 	installed=yes
       
  1648 
       
  1649 	# Read the .la file
       
  1650 	case "$lib" in
       
  1651 	*/* | *\\*) . $lib ;;
       
  1652 	*) . ./$lib ;;
       
  1653 	esac
       
  1654 
       
  1655 	# Get the name of the library we link against.
       
  1656 	linklib=
       
  1657 	for l in $old_library $library_names; do
       
  1658 	  linklib="$l"
       
  1659 	done
       
  1660 
       
  1661 	if test -z "$linklib"; then
       
  1662 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
       
  1663 	  exit 1
       
  1664 	fi
       
  1665 
       
  1666 	if test -z "$libdir"; then
       
  1667 	  # It is a libtool convenience library, so add in its objects.
       
  1668 	  convenience="$convenience $ladir/$objdir/$old_library"
       
  1669 	  old_convenience="$old_convenience $ladir/$objdir/$old_library"
       
  1670 	  deplibs="$deplibs $ladir/$objdir/$old_library"
       
  1671 	  newdependency_libs="$newdependency_libs $dependency_libs"
       
  1672 	  continue
       
  1673 	fi
       
  1674 
       
  1675 	# Find the relevant object directory and library name.
       
  1676 	if test "X$installed" = Xyes; then
       
  1677 	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
       
  1678 	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
       
  1679 	    dir="$ladir"
       
  1680 	    absdir="$abs_ladir"
       
  1681 	    libdir="$abs_ladir"
       
  1682 	  else
       
  1683 	    dir="$libdir"
       
  1684 	    absdir="$libdir"
       
  1685 	  fi
       
  1686 	else
       
  1687 	  dir="$ladir/$objdir"
       
  1688 	  absdir="$abs_ladir/$objdir"
       
  1689 	  # Remove this search path later
       
  1690 	  uninst_path="$uninst_path $abs_ladir"
       
  1691 	fi
       
  1692 	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
       
  1693 	link_static=no # Whether this library is linked statically
       
  1694 
       
  1695 	if test -n "$library_names" &&
       
  1696 	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
       
  1697 	  # This is a shared library
       
  1698 	  if test "$hardcode_into_libs" = yes; then
       
  1699 	    # Hardcode the library path.
       
  1700 	    # Skip directories that are in the system default run-time
       
  1701 	    # search path.
       
  1702 	    case " $sys_lib_dlsearch_path " in
       
  1703 	    *" $absdir "*) ;;
       
  1704 	    *)
       
  1705 	      case "$compile_rpath " in
       
  1706 	      *" $absdir "*) ;;
       
  1707 	      *) compile_rpath="$compile_rpath $absdir" 
       
  1708 	      esac
       
  1709 	      ;;
       
  1710 	    esac
       
  1711 	    case " $sys_lib_dlsearch_path " in
       
  1712 	    *" $libdir "*) ;;
       
  1713 	    *)
       
  1714 	      case "$finalize_rpath " in
       
  1715 	      *" $libdir "*) ;;
       
  1716 	      *) finalize_rpath="$finalize_rpath $libdir"
       
  1717 	      esac
       
  1718 	      ;;
       
  1719 	    esac
       
  1720 	  fi
       
  1721 	    
       
  1722 	  if test -n "$old_archive_from_expsyms_cmds"; then
       
  1723 	    # figure out the soname
       
  1724 	    set dummy $library_names
       
  1725 	    realname="$2"
       
  1726 	    shift; shift
       
  1727 	    libname=`eval \\$echo \"$libname_spec\"`
       
  1728 	    if test -n "$soname_spec"; then
       
  1729 	      eval soname=\"$soname_spec\"
       
  1730 	    else
       
  1731 	      soname="$realname"
       
  1732 	    fi
       
  1733 
       
  1734 	    # Make a new name for the extract_expsyms_cmds to use
       
  1735 	    newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
       
  1736 	  
       
  1737 	    # If the library has no export list, then create one now
       
  1738 	    if test -f "$output_objdir/$soname-def"; then :
       
  1739 	    else
       
  1740 	      $show "extracting exported symbol list from \`$soname'"
       
  1741 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  1742 	      eval cmds=\"$extract_expsyms_cmds\"
       
  1743 	      for cmd in $cmds; do
       
  1744 		IFS="$save_ifs"
       
  1745 		$show "$cmd"
       
  1746 		$run eval "$cmd" || exit $?
       
  1747 	      done
       
  1748 	      IFS="$save_ifs"
       
  1749 	    fi
       
  1750  
       
  1751 	    # Create $newlib
       
  1752 	    if test -f "$output_objdir/$newlib"; then :; else
       
  1753 	      $show "generating import library for \`$soname'"
       
  1754 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  1755 	      eval cmds=\"$old_archive_from_expsyms_cmds\"
       
  1756 	      for cmd in $cmds; do
       
  1757 		IFS="$save_ifs"
       
  1758 		$show "$cmd"
       
  1759 		$run eval "$cmd" || exit $?
       
  1760 	      done
       
  1761 	      IFS="$save_ifs"
       
  1762 	    fi
       
  1763 	    # make sure the library variables are pointing to the new library
       
  1764 	    dir=$output_objdir
       
  1765 	    linklib=$newlib
       
  1766 	  fi
       
  1767 
       
  1768 	  add_dir=
       
  1769 	  add_shlibpath=
       
  1770 	  add_name=no
       
  1771 	  if test "$relink" = no; then
       
  1772 	    lib_linked=yes
       
  1773 	    case "$hardcode_action" in
       
  1774 	    immediate | unsupported)
       
  1775 	      if test "$hardcode_direct" = no; then
       
  1776 		deplibs="$deplibs $dir/$linklib"
       
  1777 	      elif test "$hardcode_minus_L" = no; then
       
  1778 		case "$host" in
       
  1779 		*-*-sunos*) add_shlibpath="$dir" ;;
       
  1780 		esac
       
  1781 		add_dir="-L$dir"
       
  1782 		add_name=yes
       
  1783 	      elif test "$hardcode_shlibpath_var" = no; then
       
  1784 		add_shlibpath="$dir"
       
  1785 		add_name=yes
       
  1786 	      else
       
  1787 		lib_linked=no
       
  1788 	      fi
       
  1789 	      ;;
       
  1790 	    relink)
       
  1791 	      if test "$hardcode_direct" = yes; then
       
  1792 		deplibs="$deplibs $dir/$linklib"
       
  1793 	      elif test "$hardcode_minus_L" = yes; then
       
  1794 		add_dir="-L$dir"
       
  1795 		add_name=yes
       
  1796 	      elif test "$hardcode_shlibpath_var" = yes; then
       
  1797 		add_shlibpath="$dir"
       
  1798 		add_name=yes
       
  1799 	      else
       
  1800 		lib_linked=no
       
  1801 	      fi
       
  1802 	      ;;
       
  1803 	    *) lib_linked=no ;;
       
  1804 	    esac
       
  1805 
       
  1806 	    if test "$lib_linked" != yes; then
       
  1807 	      $echo "$modename: configuration error: unsupported hardcode properties"
       
  1808 	      exit 1
       
  1809 	    fi
       
  1810 	    if test -n "$add_shlibpath"; then
       
  1811 	      case ":$compile_shlibpath:" in
       
  1812 	      *":$add_shlibpath:"*) ;;
       
  1813 	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
       
  1814 	      esac
       
  1815 	    fi
       
  1816 	  else
       
  1817 	    # Install command for both is simple: just hardcode it.
       
  1818 	    if test "$hardcode_direct" = yes; then
       
  1819 	      deplibs="$deplibs $libdir/$linklib"
       
  1820 	    elif test "$hardcode_minus_L" = yes; then
       
  1821 	      add_dir="-L$libdir"
       
  1822 	      add_name=yes
       
  1823 	    elif test "$hardcode_shlibpath_var" = yes; then
       
  1824 	      add_name=yes
       
  1825 	    else
       
  1826 	      # We cannot seem to hardcode it, guess we'll fake it.
       
  1827 	      add_dir="-L$libdir"
       
  1828 	      add_name=yes
       
  1829 	    fi
       
  1830 	  fi
       
  1831 	  if test "$hardcode_direct" != yes && \
       
  1832 	     test "$hardcode_minus_L" != yes && \
       
  1833 	     test "$hardcode_shlibpath_var" = yes; then
       
  1834 	      case ":$finalize_shlibpath:" in
       
  1835 	      *":$libdir:"*) ;;
       
  1836 	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
       
  1837 	      esac
       
  1838 	  fi
       
  1839 	  if test -n "$add_dir"; then
       
  1840 	    case "$deplibs " in
       
  1841 	    *" $add_dir "*) ;;
       
  1842 	    *) deplibs="$deplibs $add_dir" ;;
       
  1843 	    esac
       
  1844 	  fi
       
  1845 	  test "$add_name" = yes && deplibs="$deplibs -l$name"
       
  1846 	elif test "$build_libtool_libs" = yes; then
       
  1847 	  # Not a shared library
       
  1848 	  if test "$deplibs_check_method" != pass_all; then
       
  1849 	    # We're trying link a shared library against a static one
       
  1850 	    # but the system doesn't support it.
       
  1851 	    # Just print a warning and add the library to dependency_libs so
       
  1852 	    # that the program can be linked against the static library.
       
  1853 	    echo
       
  1854 	    echo "*** Warning: This library needs some functionality provided by $libname."
       
  1855 	    echo "*** I have the capability to make that library automatically link in when"
       
  1856 	    echo "*** you link to this library.  But I can only do this if you have a"
       
  1857 	    echo "*** shared version of the library, which you do not appear to have."
       
  1858 	  else
       
  1859 	    convenience="$convenience $dir/$old_library"
       
  1860 	    old_convenience="$old_convenience $dir/$old_library"
       
  1861 	    deplibs="$deplibs $dir/$old_library"
       
  1862 	    link_static=yes
       
  1863 	  fi
       
  1864 	fi
       
  1865 
       
  1866 	if test -n "$dependency_libs"; then
       
  1867 	  # Extract -R from dependency_libs
       
  1868 	  temp_deplibs=
       
  1869 	  for libdir in $dependency_libs; do
       
  1870 	    case "$libdir" in
       
  1871 	    -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
       
  1872 		 case " $xrpath " in
       
  1873 		 *" $temp_xrpath "*) ;;
       
  1874 		 *) xrpath="$xrpath $temp_xrpath";;
       
  1875 		 esac;;
       
  1876 	    *) temp_deplibs="$temp_deplibs $libdir";;
       
  1877 	    esac
       
  1878 	  done
       
  1879 	  dependency_libs="$temp_deplibs"
       
  1880 	fi
       
  1881 
       
  1882 	new_lib_search_path="$new_lib_search_path $absdir"
       
  1883 	# Link against this library
       
  1884 	test "$link_static" = no && newdependency_libs="$newdependency_libs $abs_ladir/$laname"
       
  1885 	# ... and its dependency_libs
       
  1886 	newdependency_libs="$newdependency_libs $dependency_libs"
       
  1887 
       
  1888 	if test $link_all_deplibs != no; then
       
  1889 	  # Add the search paths of all dependency libraries
       
  1890 	  for deplib in $dependency_libs; do
       
  1891 	    case "$deplib" in
       
  1892 	    -L*) path="$deplib" ;;
       
  1893 	    *.la) 
       
  1894 	      if grep "^installed=no" $deplib > /dev/null; then
       
  1895 		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
       
  1896 		test "X$dir" = "X$deplib" && dir="."
       
  1897 		# We need an absolute path.
       
  1898 		case "$dir" in
       
  1899 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
       
  1900 		*)
       
  1901 		  absdir=`cd "$dir" && pwd`
       
  1902 		  if test -z "$absdir"; then
       
  1903 		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
       
  1904 		    absdir="$dir"
       
  1905 		  fi
       
  1906 		  ;;
       
  1907 		esac
       
  1908 		path="-L$absdir/$objdir"
       
  1909 	      else
       
  1910 		eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
       
  1911 		if test -z "$libdir"; then
       
  1912 		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
       
  1913 		  exit 1
       
  1914 		fi
       
  1915 		path="-L$libdir"
       
  1916 	      fi
       
  1917 	      ;;
       
  1918 	    *)
       
  1919 	      continue
       
  1920 	      ;;
       
  1921 	    esac
       
  1922 	    case "$deplibs " in
       
  1923 	    *" $path "*) ;;
       
  1924 	    *) deplibs="$path $deplibs" ;;
       
  1925 	    esac
       
  1926 	  done
       
  1927 	fi
       
  1928       done
       
  1929 
       
  1930       # Make sure lib_search_path contains only unique directories.
       
  1931       lib_search_path=
       
  1932       for dir in $new_lib_search_path; do
       
  1933 	case "$lib_search_path " in
       
  1934 	*" $dir "*) ;;
       
  1935 	*) lib_search_path="$lib_search_path $dir" ;;
       
  1936 	esac
       
  1937       done
       
  1938       lib_search_path="$lib_search_path $sys_lib_search_path"
       
  1939       
       
  1940       # Make sure newdependency_libs contains only unique libraries and directories.
       
  1941       dependency_libs=
       
  1942       for deplib in $newdependency_libs; do
       
  1943 	case "$dependency_libs " in
       
  1944 	*" $deplib "*) ;;
       
  1945 	*) dependency_libs="$dependency_libs $deplib" ;;
       
  1946 	esac
       
  1947       done
       
  1948       
       
  1949       # Eliminate all temporary directories.
       
  1950       for path in $uninst_path; do
       
  1951 	lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
       
  1952 	deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
       
  1953 	dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
       
  1954       done
       
  1955       
       
  1956       if test -n "$xrpath"; then
       
  1957 	# If the user specified any rpath flags, then add them.
       
  1958 	temp_xrpath=
       
  1959 	for libdir in $xrpath; do
       
  1960 	  temp_xrpath="$temp_xrpath -R$libdir"
       
  1961 	  case "$compile_rpath " in
       
  1962 	  *" $libdir "*) ;;
       
  1963 	  *) compile_rpath="$compile_rpath $libdir" ;;
       
  1964 	  esac
       
  1965 	  case "$finalize_rpath " in
       
  1966 	  *" $libdir "*) ;;
       
  1967 	  *) finalize_rpath="$finalize_rpath $libdir" ;;
       
  1968 	  esac
       
  1969 	done
       
  1970 	dependency_libs="$temp_xrpath $dependency_libs"
       
  1971       fi
       
  1972 
       
  1973       # Restore the variables
       
  1974       libname=$libname_save
       
  1975       name=$name_save
       
  1976 
       
  1977       if test "$build_libtool_libs" = yes; then
       
  1978 	if test -n "$rpath"; then
       
  1979 	  case "$host" in
       
  1980 	  *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
       
  1981 	    # these systems don't actually have a c library (as such)!
       
  1982 	    ;;
       
  1983 	  *)
       
  1984 	    # Add libc to deplibs on all other systems.
       
  1985 	    deplibs="$deplibs -lc"
       
  1986 	    ;;
       
  1987 	  esac
       
  1988 	fi
       
  1989 
       
  1990 	# Transform deplibs into only deplibs that can be linked in shared.
       
  1991 	name_save=$name
       
  1992 	libname_save=$libname
       
  1993 	release_save=$release
       
  1994 	versuffix_save=$versuffix
       
  1995 	major_save=$major
       
  1996 	# I'm not sure if I'm treating the release correctly.  I think
       
  1997 	# release should show up in the -l (ie -lgmp5) so we don't want to
       
  1998 	# add it in twice.  Is that correct?
       
  1999 	release=""
       
  2000 	versuffix=""
       
  2001 	major=""
       
  2002 	newdeplibs=
       
  2003 	droppeddeps=no
       
  2004 	case "$deplibs_check_method" in
       
  2005 	pass_all)
       
  2006 	  # Don't check for shared/static.  Everything works.
       
  2007 	  # This might be a little naive.  We might want to check
       
  2008 	  # whether the library exists or not.  But this is on
       
  2009 	  # osf3 & osf4 and I'm not really sure... Just
       
  2010 	  # implementing what was already the behaviour.
       
  2011 	  newdeplibs=$deplibs
       
  2012 	  ;;
       
  2013 	test_compile)
       
  2014 	  # This code stresses the "libraries are programs" paradigm to its
       
  2015 	  # limits. Maybe even breaks it.  We compile a program, linking it
       
  2016 	  # against the deplibs as a proxy for the library.  Then we can check
       
  2017 	  # whether they linked in statically or dynamically with ldd.
       
  2018 	  $rm conftest.c
       
  2019 	  cat > conftest.c <<EOF
       
  2020 	  int main() { return 0; }
       
  2021 EOF
       
  2022 	  $rm conftest
       
  2023 	  $CC -o conftest conftest.c $deplibs
       
  2024 	  if test $? -eq 0 ; then
       
  2025 	    ldd_output=`ldd conftest`
       
  2026 	    for i in $deplibs; do
       
  2027 	      name="`expr $i : '-l\(.*\)'`"
       
  2028 	      # If $name is empty we are operating on a -L argument.
       
  2029 	      if test "$name" != "" ; then
       
  2030 		libname=`eval \\$echo \"$libname_spec\"`
       
  2031 		deplib_matches=`eval \\$echo \"$library_names_spec\"`
       
  2032 		set dummy $deplib_matches
       
  2033 		deplib_match=$2
       
  2034 		if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
       
  2035 		  newdeplibs="$newdeplibs $i"
       
  2036 		else
       
  2037 		  droppeddeps=yes
       
  2038 		  echo
       
  2039 		  echo "*** Warning: This library needs some functionality provided by $i."
       
  2040 		  echo "*** I have the capability to make that library automatically link in when"
       
  2041 		  echo "*** you link to this library.  But I can only do this if you have a"
       
  2042 		  echo "*** shared version of the library, which you do not appear to have."
       
  2043 		fi
       
  2044 	      else
       
  2045 		newdeplibs="$newdeplibs $i"
       
  2046 	      fi
       
  2047 	    done
       
  2048 	  else
       
  2049 	    # Error occured in the first compile.  Let's try to salvage the situation:
       
  2050 	    # Compile a seperate program for each library.
       
  2051 	    for i in $deplibs; do
       
  2052 	      name="`expr $i : '-l\(.*\)'`"
       
  2053 	     # If $name is empty we are operating on a -L argument.
       
  2054 	      if test "$name" != "" ; then
       
  2055 		$rm conftest
       
  2056 		$CC -o conftest conftest.c $i
       
  2057 		# Did it work?
       
  2058 		if test $? -eq 0 ; then
       
  2059 		  ldd_output=`ldd conftest`
       
  2060 		  libname=`eval \\$echo \"$libname_spec\"`
       
  2061 		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
       
  2062 		  set dummy $deplib_matches
       
  2063 		  deplib_match=$2
       
  2064 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
       
  2065 		    newdeplibs="$newdeplibs $i"
       
  2066 		  else
       
  2067 		    droppeddeps=yes
       
  2068 		    echo
       
  2069 		    echo "*** Warning: This library needs some functionality provided by $i."
       
  2070 		    echo "*** I have the capability to make that library automatically link in when"
       
  2071 		    echo "*** you link to this library.  But I can only do this if you have a"
       
  2072 		    echo "*** shared version of the library, which you do not appear to have."
       
  2073 		  fi
       
  2074 		else
       
  2075 		  droppeddeps=yes
       
  2076 		  echo
       
  2077 		  echo "*** Warning!  Library $i is needed by this library but I was not able to"
       
  2078 		  echo "***  make it link in!  You will probably need to install it or some"
       
  2079 		  echo "*** library that it depends on before this library will be fully"
       
  2080 		  echo "*** functional.  Installing it before continuing would be even better."
       
  2081 		fi
       
  2082 	      else
       
  2083 		newdeplibs="$newdeplibs $i"
       
  2084 	      fi
       
  2085 	    done
       
  2086 	  fi
       
  2087 	  ;;
       
  2088 	file_magic*)
       
  2089 	  set dummy $deplibs_check_method
       
  2090 	  file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
       
  2091 	  for a_deplib in $deplibs; do
       
  2092 	    name="`expr $a_deplib : '-l\(.*\)'`"
       
  2093 	    # If $name is empty we are operating on a -L argument.
       
  2094 	    if test "$name" != "" ; then
       
  2095 	      libname=`eval \\$echo \"$libname_spec\"`
       
  2096 	      for i in $lib_search_path; do
       
  2097 		    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
       
  2098 		    for potent_lib in $potential_libs; do
       
  2099 		      # Follow soft links.
       
  2100 		      if ls -lLd "$potent_lib" 2>/dev/null \
       
  2101 			 | grep " -> " >/dev/null; then
       
  2102 			continue 
       
  2103 		      fi
       
  2104 		      # The statement above tries to avoid entering an
       
  2105 		      # endless loop below, in case of cyclic links.
       
  2106 		      # We might still enter an endless loop, since a link
       
  2107 		      # loop can be closed while we follow links,
       
  2108 		      # but so what?
       
  2109 		      potlib="$potent_lib"
       
  2110 		      while test -h "$potlib" 2>/dev/null; do
       
  2111 			potliblink=`ls -ld $potlib | sed 's/.* -> //'`
       
  2112 			case "$potliblink" in
       
  2113 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
       
  2114 			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
       
  2115 			esac
       
  2116 		      done
       
  2117 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
       
  2118 			 | sed 10q \
       
  2119 			 | egrep "$file_magic_regex" > /dev/null; then
       
  2120 			newdeplibs="$newdeplibs $a_deplib"
       
  2121 			a_deplib=""
       
  2122 			break 2
       
  2123 		      fi
       
  2124 		    done
       
  2125 	      done
       
  2126 	      if test -n "$a_deplib" ; then
       
  2127 		droppeddeps=yes
       
  2128 		echo
       
  2129 		echo "*** Warning: This library needs some functionality provided by $a_deplib."
       
  2130 		echo "*** I have the capability to make that library automatically link in when"
       
  2131 		echo "*** you link to this library.  But I can only do this if you have a"
       
  2132 		echo "*** shared version of the library, which you do not appear to have."
       
  2133 	      fi
       
  2134 	    else
       
  2135 	      # Add a -L argument.
       
  2136 	      newdeplibs="$newdeplibs $a_deplib"
       
  2137 	    fi
       
  2138 	  done # Gone through all deplibs.
       
  2139 	  ;;
       
  2140 	none | unknown | *)
       
  2141 	  newdeplibs=""
       
  2142 	  if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
       
  2143 	       -e 's/ -[LR][^ ]*//g' -e 's/[ 	]//g' |
       
  2144 	     grep . >/dev/null; then
       
  2145 	    echo
       
  2146 	    if test "X$deplibs_check_method" = "Xnone"; then
       
  2147 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
       
  2148 	    else
       
  2149 	      echo "*** Warning: inter-library dependencies are not known to be supported."
       
  2150 	    fi
       
  2151 	    echo "*** All declared inter-library dependencies are being dropped."
       
  2152 	    droppeddeps=yes
       
  2153 	  fi
       
  2154 	  ;;
       
  2155 	esac
       
  2156 	versuffix=$versuffix_save
       
  2157 	major=$major_save
       
  2158 	release=$release_save
       
  2159 	libname=$libname_save
       
  2160 	name=$name_save
       
  2161 
       
  2162 	if test "$droppeddeps" = yes; then
       
  2163 	  if test "$module" = yes; then
       
  2164 	    echo
       
  2165 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
       
  2166 	    echo "*** dependencies of module $libname.  Therefore, libtool will create"
       
  2167 	    echo "*** a static module, that should work as long as the dlopening"
       
  2168 	    echo "*** application is linked with the -dlopen flag."
       
  2169 	    if test -z "$global_symbol_pipe"; then
       
  2170 	      echo
       
  2171 	      echo "*** However, this would only work if libtool was able to extract symbol"
       
  2172 	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
       
  2173 	      echo "*** not find such a program.  So, this module is probably useless."
       
  2174 	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
       
  2175 	    fi
       
  2176 	    if test "$build_old_libs" = no; then
       
  2177 	      oldlibs="$output_objdir/$libname.$libext"
       
  2178 	      build_libtool_libs=module
       
  2179 	      build_old_libs=yes
       
  2180 	    else
       
  2181 	      build_libtool_libs=no
       
  2182 	    fi
       
  2183 	  else
       
  2184 	    echo "*** The inter-library dependencies that have been dropped here will be"
       
  2185 	    echo "*** automatically added whenever a program is linked with this library"
       
  2186 	    echo "*** or is declared to -dlopen it."
       
  2187 	  fi
       
  2188 	fi
       
  2189 	# Done checking deplibs!
       
  2190 	deplibs=$newdeplibs
       
  2191       fi
       
  2192 
       
  2193       # All the library-specific variables (install_libdir is set above).
       
  2194       library_names=
       
  2195       old_library=
       
  2196       dlname=
       
  2197       
       
  2198       # Test again, we may have decided not to build it any more
       
  2199       if test "$build_libtool_libs" = yes; then
       
  2200 	if test "$hardcode_into_libs" = yes; then
       
  2201 	  # Hardcode the library paths
       
  2202 	  hardcode_libdirs=
       
  2203 	  dep_rpath=
       
  2204 	  rpath="$finalize_rpath"
       
  2205 	  test "$relink" = no && rpath="$compile_rpath$rpath"
       
  2206 	  for libdir in $rpath; do
       
  2207 	    if test -n "$hardcode_libdir_flag_spec"; then
       
  2208 	      if test -n "$hardcode_libdir_separator"; then
       
  2209 		if test -z "$hardcode_libdirs"; then
       
  2210 		  hardcode_libdirs="$libdir"
       
  2211 		else
       
  2212 		  # Just accumulate the unique libdirs.
       
  2213 		  case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
       
  2214 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
       
  2215 		    ;;
       
  2216 		  *)
       
  2217 		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
       
  2218 		    ;;
       
  2219 		  esac
       
  2220 		fi
       
  2221 	      else
       
  2222 		eval flag=\"$hardcode_libdir_flag_spec\"
       
  2223 		dep_rpath="$dep_rpath $flag"
       
  2224 	      fi
       
  2225 	    elif test -n "$runpath_var"; then
       
  2226 	      case "$perm_rpath " in
       
  2227 	      *" $libdir "*) ;;
       
  2228 	      *) perm_rpath="$perm_rpath $libdir" ;;
       
  2229 	      esac
       
  2230 	    fi
       
  2231 	  done
       
  2232 	  # Substitute the hardcoded libdirs into the rpath.
       
  2233 	  if test -n "$hardcode_libdir_separator" &&
       
  2234 	     test -n "$hardcode_libdirs"; then
       
  2235 	    libdir="$hardcode_libdirs"
       
  2236 	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
       
  2237 	  fi
       
  2238 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
       
  2239 	    # We should set the runpath_var.
       
  2240 	    rpath=
       
  2241 	    for dir in $perm_rpath; do
       
  2242 	      rpath="$rpath$dir:"
       
  2243 	    done
       
  2244 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
       
  2245 	  fi
       
  2246 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
       
  2247 	fi
       
  2248 
       
  2249 	shlibpath="$finalize_shlibpath"	
       
  2250 	test "$relink" = no && shlibpath="$compile_shlibpath$shlibpath"	
       
  2251 	if test -n "$shlibpath"; then
       
  2252 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
       
  2253 	fi
       
  2254   
       
  2255 	# Get the real and link names of the library.
       
  2256 	eval library_names=\"$library_names_spec\"
       
  2257 	set dummy $library_names
       
  2258 	realname="$2"
       
  2259 	shift; shift
       
  2260 
       
  2261 	if test -n "$soname_spec"; then
       
  2262 	  eval soname=\"$soname_spec\"
       
  2263 	else
       
  2264 	  soname="$realname"
       
  2265 	fi
       
  2266 
       
  2267 	lib="$output_objdir/$realname"
       
  2268 	for link
       
  2269 	do
       
  2270 	  linknames="$linknames $link"
       
  2271 	done
       
  2272 
       
  2273 	# Ensure that we have .o objects for linkers which dislike .lo
       
  2274 	# (e.g. aix) incase we are running --disable-static
       
  2275 	for obj in $libobjs; do
       
  2276 	  xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
       
  2277 	  if test "X$xdir" = "X$obj"; then
       
  2278 	    xdir="."
       
  2279 	  else
       
  2280 	    xdir="$xdir"
       
  2281 	  fi
       
  2282 	  baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
       
  2283 	  oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
       
  2284 	  if test ! -f $xdir/$oldobj; then
       
  2285 	    $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
       
  2286 	    $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
       
  2287 	  fi
       
  2288 	done
       
  2289 
       
  2290 	# Use standard objects if they are pic
       
  2291 	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       
  2292 
       
  2293 	# Prepare the list of exported symbols
       
  2294 	if test -z "$export_symbols"; then
       
  2295 	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
       
  2296 	    $show "generating symbol list for \`$libname.la'"
       
  2297 	    export_symbols="$output_objdir/$libname.exp"
       
  2298 	    $run $rm $export_symbols
       
  2299 	    eval cmds=\"$export_symbols_cmds\"
       
  2300 	    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2301 	    for cmd in $cmds; do
       
  2302 	      IFS="$save_ifs"
       
  2303 	      $show "$cmd"
       
  2304 	      $run eval "$cmd" || exit $?
       
  2305 	    done
       
  2306 	    IFS="$save_ifs"
       
  2307 	    if test -n "$export_symbols_regex"; then
       
  2308 	      $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
       
  2309 	      $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
       
  2310 	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
       
  2311 	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
       
  2312 	    fi
       
  2313 	  fi
       
  2314 	fi
       
  2315 
       
  2316 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
       
  2317 	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
       
  2318 	fi
       
  2319 
       
  2320 	if test -n "$convenience"; then
       
  2321 	  if test -n "$whole_archive_flag_spec"; then
       
  2322 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
       
  2323 	  else
       
  2324 	    gentop="$output_objdir/${outputname}x"
       
  2325 	    $show "${rm}r $gentop"
       
  2326 	    $run ${rm}r "$gentop"
       
  2327 	    $show "mkdir $gentop"
       
  2328 	    $run mkdir "$gentop"
       
  2329 	    status=$?
       
  2330 	    if test $status -ne 0 && test ! -d "$gentop"; then
       
  2331 	      exit $status
       
  2332 	    fi
       
  2333 	    generated="$generated $gentop"
       
  2334 
       
  2335 	    for xlib in $convenience; do
       
  2336 	      # Extract the objects.
       
  2337 	      case "$xlib" in
       
  2338 	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
       
  2339 	      *) xabs=`pwd`"/$xlib" ;;
       
  2340 	      esac
       
  2341 	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  2342 	      xdir="$gentop/$xlib"
       
  2343 
       
  2344 	      $show "${rm}r $xdir"
       
  2345 	      $run ${rm}r "$xdir"
       
  2346 	      $show "mkdir $xdir"
       
  2347 	      $run mkdir "$xdir"
       
  2348 	      status=$?
       
  2349 	      if test $status -ne 0 && test ! -d "$xdir"; then
       
  2350 		exit $status
       
  2351 	      fi
       
  2352 	      $show "(cd $xdir && $AR x $xabs)"
       
  2353 	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  2354 
       
  2355 	      libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
       
  2356 	    done
       
  2357 	  fi
       
  2358 	fi
       
  2359 
       
  2360 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
       
  2361 	  eval flag=\"$thread_safe_flag_spec\"
       
  2362 	  linker_flags="$linker_flags $flag"
       
  2363 	fi
       
  2364 
       
  2365 	# Make a backup of the uninstalled library when relinking
       
  2366 	if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then
       
  2367 	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
       
  2368 	fi
       
  2369 
       
  2370 	# Do each of the archive commands.
       
  2371 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
       
  2372 	  eval cmds=\"$archive_expsym_cmds\"
       
  2373 	else
       
  2374 	  eval cmds=\"$archive_cmds\"
       
  2375 	fi
       
  2376 	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2377 	for cmd in $cmds; do
       
  2378 	  IFS="$save_ifs"
       
  2379 	  $show "$cmd"
       
  2380 	  $run eval "$cmd" || exit $?
       
  2381 	done
       
  2382 	IFS="$save_ifs"
       
  2383 
       
  2384 	# Restore the uninstalled library and exit
       
  2385 	if test "$relink" = yes && test "$hardcode_into_libs" = yes; then
       
  2386 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
       
  2387 	  exit 0
       
  2388 	fi
       
  2389 
       
  2390 	# Create links to the real library.
       
  2391 	for linkname in $linknames; do
       
  2392 	  if test "$realname" != "$linkname"; then
       
  2393 	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
       
  2394 	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
       
  2395 	  fi
       
  2396 	done
       
  2397 
       
  2398 	# If -module or -export-dynamic was specified, set the dlname.
       
  2399 	if test "$module" = yes || test "$export_dynamic" = yes; then
       
  2400 	  # On all known operating systems, these are identical.
       
  2401 	  dlname="$soname"
       
  2402 	fi
       
  2403       fi
       
  2404       ;;
       
  2405 
       
  2406     obj)
       
  2407       if test -n "$deplibs"; then
       
  2408 	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
       
  2409       fi
       
  2410 
       
  2411       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
       
  2412 	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
       
  2413       fi
       
  2414 
       
  2415       if test -n "$rpath"; then
       
  2416 	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
       
  2417       fi
       
  2418 
       
  2419       if test -n "$xrpath"; then
       
  2420 	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
       
  2421       fi
       
  2422 
       
  2423       if test -n "$vinfo"; then
       
  2424 	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
       
  2425       fi
       
  2426 
       
  2427       if test -n "$release"; then
       
  2428 	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
       
  2429       fi
       
  2430 
       
  2431       case "$output" in
       
  2432       *.lo)
       
  2433 	if test -n "$objs$old_deplibs"; then
       
  2434 	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
       
  2435 	  exit 1
       
  2436 	fi
       
  2437 	libobj="$output"
       
  2438 	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
       
  2439 	;;
       
  2440       *)
       
  2441 	libobj=
       
  2442 	obj="$output"
       
  2443 	;;
       
  2444       esac
       
  2445 
       
  2446       # Delete the old objects.
       
  2447       $run $rm $obj $libobj
       
  2448 
       
  2449       # Objects from convenience libraries.  This assumes
       
  2450       # single-version convenience libraries.  Whenever we create
       
  2451       # different ones for PIC/non-PIC, this we'll have to duplicate
       
  2452       # the extraction.
       
  2453       reload_conv_objs=
       
  2454       gentop=
       
  2455       # reload_cmds runs $LD directly, so let us get rid of
       
  2456       # -Wl from whole_archive_flag_spec
       
  2457       wl= 
       
  2458 
       
  2459       if test -n "$convenience"; then
       
  2460 	if test -n "$whole_archive_flag_spec"; then
       
  2461 	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
       
  2462 	else
       
  2463 	  gentop="$output_objdir/${obj}x"
       
  2464 	  $show "${rm}r $gentop"
       
  2465 	  $run ${rm}r "$gentop"
       
  2466 	  $show "mkdir $gentop"
       
  2467 	  $run mkdir "$gentop"
       
  2468 	  status=$?
       
  2469 	  if test $status -ne 0 && test ! -d "$gentop"; then
       
  2470 	    exit $status
       
  2471 	  fi
       
  2472 	  generated="$generated $gentop"
       
  2473 
       
  2474 	  for xlib in $convenience; do
       
  2475 	    # Extract the objects.
       
  2476 	    case "$xlib" in
       
  2477 	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
       
  2478 	    *) xabs=`pwd`"/$xlib" ;;
       
  2479 	    esac
       
  2480 	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  2481 	    xdir="$gentop/$xlib"
       
  2482 
       
  2483 	    $show "${rm}r $xdir"
       
  2484 	    $run ${rm}r "$xdir"
       
  2485 	    $show "mkdir $xdir"
       
  2486 	    $run mkdir "$xdir"
       
  2487 	    status=$?
       
  2488 	    if test $status -ne 0 && test ! -d "$xdir"; then
       
  2489 	      exit $status
       
  2490 	    fi
       
  2491 	    $show "(cd $xdir && $AR x $xabs)"
       
  2492 	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  2493 
       
  2494 	    reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
       
  2495 	  done
       
  2496 	fi
       
  2497       fi
       
  2498 
       
  2499       # Create the old-style object.
       
  2500       reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
       
  2501 
       
  2502       output="$obj"
       
  2503       eval cmds=\"$reload_cmds\"
       
  2504       IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2505       for cmd in $cmds; do
       
  2506 	IFS="$save_ifs"
       
  2507 	$show "$cmd"
       
  2508 	$run eval "$cmd" || exit $?
       
  2509       done
       
  2510       IFS="$save_ifs"
       
  2511 
       
  2512       # Exit if we aren't doing a library object file.
       
  2513       if test -z "$libobj"; then
       
  2514 	if test -n "$gentop"; then
       
  2515 	  $show "${rm}r $gentop"
       
  2516 	  $run ${rm}r $gentop
       
  2517 	fi
       
  2518 
       
  2519 	exit 0
       
  2520       fi
       
  2521 
       
  2522       if test "$build_libtool_libs" != yes; then
       
  2523 	if test -n "$gentop"; then
       
  2524 	  $show "${rm}r $gentop"
       
  2525 	  $run ${rm}r $gentop
       
  2526 	fi
       
  2527 
       
  2528 	# Create an invalid libtool object if no PIC, so that we don't
       
  2529 	# accidentally link it into a program.
       
  2530 	$show "echo timestamp > $libobj"
       
  2531 	$run eval "echo timestamp > $libobj" || exit $?
       
  2532 	exit 0
       
  2533       fi
       
  2534 
       
  2535       if test -n "$pic_flag" || test "$pic_mode" != default; then
       
  2536 	# Only do commands if we really have different PIC objects.
       
  2537 	reload_objs="$libobjs $reload_conv_objs"
       
  2538 	output="$libobj"
       
  2539 	eval cmds=\"$reload_cmds\"
       
  2540 	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2541 	for cmd in $cmds; do
       
  2542 	  IFS="$save_ifs"
       
  2543 	  $show "$cmd"
       
  2544 	  $run eval "$cmd" || exit $?
       
  2545 	done
       
  2546 	IFS="$save_ifs"
       
  2547       else
       
  2548 	# Just create a symlink.
       
  2549 	$show $rm $libobj
       
  2550 	$run $rm $libobj
       
  2551 	xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
       
  2552 	if test "X$xdir" = "X$libobj"; then
       
  2553 	  xdir="."
       
  2554 	else
       
  2555 	  xdir="$xdir"
       
  2556 	fi
       
  2557 	baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
       
  2558 	oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
       
  2559 	$show "(cd $xdir && $LN_S $oldobj $baseobj)"
       
  2560 	$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
       
  2561       fi
       
  2562 
       
  2563       if test -n "$gentop"; then
       
  2564 	$show "${rm}r $gentop"
       
  2565 	$run ${rm}r $gentop
       
  2566       fi
       
  2567 
       
  2568       exit 0
       
  2569       ;;
       
  2570 
       
  2571     prog)
       
  2572       if test -n "$vinfo"; then
       
  2573 	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
       
  2574       fi
       
  2575 
       
  2576       if test -n "$release"; then
       
  2577 	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
       
  2578       fi
       
  2579 
       
  2580       if test "$preload" = yes; then
       
  2581 	if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
       
  2582 	   test "$dlopen_self_static" = unknown; then
       
  2583 	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
       
  2584 	fi 
       
  2585       fi
       
  2586     
       
  2587       # Find libtool libraries and add their dependencies
       
  2588       save_deplibs="$deplibs"
       
  2589       deplibs=
       
  2590       newdependency_libs=
       
  2591       new_lib_search_path=
       
  2592       for deplib in $save_deplibs; do
       
  2593 	lib=
       
  2594 	case "$deplib" in
       
  2595 	*.a | *.lib)
       
  2596 	  deplibs="$deplibs $deplib"
       
  2597 	  continue
       
  2598 	  ;;
       
  2599 	-L*)
       
  2600 	  deplibs="$deplibs $deplib"
       
  2601 	  new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
       
  2602 	  continue
       
  2603 	  ;;
       
  2604 	-l*)
       
  2605 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
       
  2606 	  found=no
       
  2607 	  for searchdir in $lib_search_path; do
       
  2608 	    # Search the libtool library
       
  2609 	    lib="$searchdir/lib${name}.la"
       
  2610 	    if test -f "$lib"; then
       
  2611 	      found=yes
       
  2612 	      break
       
  2613 	    fi
       
  2614 	  done
       
  2615 	  if test "$found" != yes; then
       
  2616 	    deplibs="$deplibs $deplib"
       
  2617 	    continue
       
  2618 	  fi
       
  2619 	  ;;
       
  2620 	*)
       
  2621 	  lib="$deplib"
       
  2622 	  if test -f "$lib"; then :
       
  2623 	  else
       
  2624 	    $echo "$modename: cannot find the library \`$lib'" 1>&2
       
  2625 	    exit 1
       
  2626 	  fi
       
  2627 	  ;;
       
  2628 	esac
       
  2629 	libdir=
       
  2630 	library_names=
       
  2631 	old_library=
       
  2632 
       
  2633 	# Check to see that this really is a libtool archive.
       
  2634 	if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  2635 	else
       
  2636 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
       
  2637 	  exit 1
       
  2638 	fi
       
  2639 
       
  2640 	# If the library was installed with an old release of libtool,
       
  2641 	# it will not redefine variable installed.
       
  2642 	installed=yes
       
  2643 
       
  2644 	# Read the .la file
       
  2645 	case "$lib" in
       
  2646 	*/* | *\\*) . $lib ;;
       
  2647 	*) . ./$lib ;;
       
  2648 	esac
       
  2649 
       
  2650 	# Get the name of the library we link against.
       
  2651 	linklib=
       
  2652 	for l in $old_library $library_names; do
       
  2653 	  linklib="$l"
       
  2654 	done
       
  2655 
       
  2656 	if test -z "$linklib"; then
       
  2657 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
       
  2658 	  exit 1
       
  2659 	fi
       
  2660 
       
  2661 	new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`"
       
  2662 	deplibs="$deplibs $lib"
       
  2663 
       
  2664 	for deplib in $dependency_libs; do
       
  2665 	  case "$deplib" in
       
  2666 	  -L*)
       
  2667 	    new_lib_search_path="$new_lib_search_path `$echo "X$deplib" | $Xsed -e 's/^-L//'`"
       
  2668 	    ;;
       
  2669 	  esac
       
  2670 	  
       
  2671 	  if test "$link_all_deplibs" != no || \
       
  2672 	     test "$fast_install" != no || \
       
  2673 	     test "$build_libtool_libs" = no || \
       
  2674 	     test -z "$library_names"; then
       
  2675 	    # Need to link against all dependency_libs
       
  2676 	    deplibs="$deplibs $deplib"
       
  2677 	  else
       
  2678 	    # Need to hardcode shared library paths
       
  2679 	    # or/and link against static libraries
       
  2680 	    newdependency_libs="$newdependency_libs $deplib"
       
  2681 	  fi
       
  2682 	done
       
  2683       done
       
  2684       
       
  2685       # Eliminate all dependency_libs that are already contained in deplibs
       
  2686       dependency_libs=
       
  2687       for deplib in $newdependency_libs; do
       
  2688 	case "$deplibs " in
       
  2689 	*" $deplib "*) ;;
       
  2690 	*) dependency_libs="$dependency_libs $deplib" ;;
       
  2691 	esac
       
  2692       done
       
  2693 
       
  2694       # Make sure lib_search_path contains only unique directories.
       
  2695       lib_search_path=
       
  2696       for dir in $new_lib_search_path; do
       
  2697 	case "$lib_search_path " in
       
  2698 	*" $dir "*) ;;
       
  2699 	*) lib_search_path="$lib_search_path $dir" ;;
       
  2700 	esac
       
  2701       done
       
  2702       lib_search_path="$lib_search_path $sys_lib_search_path"
       
  2703       
       
  2704       # Find libtool libraries and add their directories
       
  2705       alldeplibs=no
       
  2706       link_against_libtool_libs=
       
  2707       
       
  2708       for deplib in $deplibs @DEPLIBS@ $dependency_libs; do
       
  2709 	lib=
       
  2710 	case "$deplib" in
       
  2711 	-L* | *.a | *.lib)
       
  2712 	  compile_command="$compile_command $deplib"
       
  2713 	  finalize_command="$finalize_command $deplib"
       
  2714 	  continue
       
  2715 	  ;;
       
  2716 	-R*)
       
  2717 	  dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
       
  2718 	  # Make sure the xrpath contains only unique directories.
       
  2719 	  case "$xrpath " in
       
  2720 	  *" $dir "*) ;;
       
  2721 	  *) xrpath="$xrpath $dir" ;;
       
  2722 	  esac
       
  2723 	  continue
       
  2724 	  ;;
       
  2725 	@DEPLIBS@)
       
  2726 	  alldeplibs=yes
       
  2727 	  continue
       
  2728 	  ;;
       
  2729 	-l*)
       
  2730 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
       
  2731 	  found=no
       
  2732 	  for searchdir in $lib_search_path; do
       
  2733 	    # Search the libtool library
       
  2734 	    lib="$searchdir/lib${name}.la"
       
  2735 	    if test -f "$lib"; then
       
  2736 	      found=yes
       
  2737 	      break
       
  2738 	    fi
       
  2739 	  done
       
  2740 	  if test "$found" != yes; then
       
  2741 	    compile_command="$compile_command $deplib"
       
  2742 	    finalize_command="$finalize_command $deplib"
       
  2743 	    continue
       
  2744 	  fi
       
  2745 	  ;;
       
  2746 	*)
       
  2747 	  lib="$deplib"
       
  2748 	  if test -f "$lib"; then :
       
  2749 	  else
       
  2750 	    $echo "$modename: cannot find the library \`$lib'" 1>&2
       
  2751 	    exit 1
       
  2752 	  fi
       
  2753 	  ;;
       
  2754 	esac
       
  2755 	libdir=
       
  2756 	library_names=
       
  2757 	old_library=
       
  2758 
       
  2759 	# Check to see that this really is a libtool archive.
       
  2760 	if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  2761 	else
       
  2762 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
       
  2763 	  exit 1
       
  2764 	fi
       
  2765 
       
  2766 	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
       
  2767 	test "X$ladir" = "X$lib" && ladir="."
       
  2768 	# We need an absolute path.
       
  2769 	case "$ladir" in
       
  2770 	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
       
  2771 	*)
       
  2772 	  abs_ladir=`cd "$ladir" && pwd`
       
  2773 	  if test -z "$abs_ladir"; then
       
  2774 	    $echo "$modename: warning: cannot determine absolute directory name of \`$abs_ladir'" 1>&2
       
  2775 	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
       
  2776 	    abs_ladir="$ladir"
       
  2777 	  fi
       
  2778 	  ;;
       
  2779 	esac
       
  2780 	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
       
  2781 
       
  2782 	# If the library was installed with an old release of libtool,
       
  2783 	# it will not redefine variable installed.
       
  2784 	installed=yes
       
  2785 
       
  2786 	# Read the .la file
       
  2787 	case "$lib" in
       
  2788 	*/* | *\\*) . $lib ;;
       
  2789 	*) . ./$lib ;;
       
  2790 	esac
       
  2791 
       
  2792 	# Get the name of the library we link against.
       
  2793 	linklib=
       
  2794 	for l in $old_library $library_names; do
       
  2795 	  linklib="$l"
       
  2796 	done
       
  2797 
       
  2798 	if test -z "$linklib"; then
       
  2799 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
       
  2800 	  exit 1
       
  2801 	fi
       
  2802 
       
  2803 	# Find the relevant object directory and library name.
       
  2804 	if test "X$installed" = Xyes; then
       
  2805 	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
       
  2806 	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
       
  2807 	    dir="$ladir"
       
  2808 	    absdir="$abs_ladir"
       
  2809 	    libdir="$abs_ladir"
       
  2810 	  else
       
  2811 	    dir="$libdir"
       
  2812 	    absdir="$libdir"
       
  2813 	  fi
       
  2814 	else
       
  2815 	  dir="$ladir/$objdir"
       
  2816 	  absdir="$abs_ladir/$objdir"
       
  2817 	fi
       
  2818 	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
       
  2819 
       
  2820 	hardcode=yes
       
  2821 	test "$hardcode_into_libs" = yes && test "$alldeplibs" = yes && hardcode=no
       
  2822 	if test "$hardcode" = yes && test -n "$library_names" &&
       
  2823 	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
       
  2824 	  # We need to hardcode the library path
       
  2825 	  if test -n "$shlibpath_var"; then
       
  2826 	    # Make sure the rpath contains only unique directories.
       
  2827 	    case "$temp_rpath " in
       
  2828 	    *" $dir "*) ;;
       
  2829 	    *" $absdir "*) ;;
       
  2830 	    *) temp_rpath="$temp_rpath $dir" ;;
       
  2831 	    esac
       
  2832 	  fi
       
  2833 
       
  2834 	  # Hardcode the library path.
       
  2835 	  # Skip directories that are in the system default run-time
       
  2836 	  # search path.
       
  2837 	  case " $sys_lib_dlsearch_path " in
       
  2838 	  *" $absdir "*) ;;
       
  2839 	  *)
       
  2840 	    case "$compile_rpath " in
       
  2841 	    *" $absdir "*) ;;
       
  2842 	    *) compile_rpath="$compile_rpath $absdir" 
       
  2843 	    esac
       
  2844 	    ;;
       
  2845 	  esac
       
  2846 
       
  2847 	  case " $sys_lib_dlsearch_path " in
       
  2848 	  *" $libdir "*) ;;
       
  2849 	  *)
       
  2850 	    case "$finalize_rpath " in
       
  2851 	    *" $libdir "*) ;;
       
  2852 	    *) finalize_rpath="$finalize_rpath $libdir"
       
  2853 	    esac
       
  2854 	    ;;
       
  2855 	  esac
       
  2856 	fi
       
  2857 
       
  2858 	if test "$alldeplibs" = yes &&
       
  2859 	   { test "$deplibs_check_method" = pass_all ||
       
  2860 	     { test "$build_libtool_libs" = yes &&
       
  2861 	       test -n "$library_names"; }; }; then
       
  2862 	  # Do we only need to link against static libraries?
       
  2863 	  continue
       
  2864 	fi
       
  2865 	
       
  2866 	if test -z "$libdir"; then
       
  2867 	  # It is a libtool convenience library, so add in its objects.
       
  2868 	  convenience="$convenience $dir/$old_library"
       
  2869 	  old_convenience="$old_convenience $dir/$old_library"
       
  2870 	  compile_command="$compile_command $dir/$old_library"
       
  2871 	  finalize_command="$finalize_command $dir/$old_library"
       
  2872 	  continue
       
  2873 	fi
       
  2874 
       
  2875 	if test -n "$library_names" &&
       
  2876 	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
       
  2877 	  link_against_libtool_libs="$link_against_libtool_libs $lib"
       
  2878 
       
  2879 	  if test -n "$old_archive_from_expsyms_cmds"; then
       
  2880 	    # figure out the soname
       
  2881 	    set dummy $library_names
       
  2882 	    realname="$2"
       
  2883 	    shift; shift
       
  2884 	    libname=`eval \\$echo \"$libname_spec\"`
       
  2885 	    if test -n "$soname_spec"; then
       
  2886 	      eval soname=\"$soname_spec\"
       
  2887 	    else
       
  2888 	      soname="$realname"
       
  2889 	    fi
       
  2890 
       
  2891 	    # Make a new name for the extract_expsyms_cmds to use
       
  2892 	    newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
       
  2893 	  
       
  2894 	    # If the library has no export list, then create one now
       
  2895 	    if test -f "$output_objdir/$soname-def"; then :
       
  2896 	    else
       
  2897 	      $show "extracting exported symbol list from \`$soname'"
       
  2898 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2899 	      eval cmds=\"$extract_expsyms_cmds\"
       
  2900 	      for cmd in $cmds; do
       
  2901 		IFS="$save_ifs"
       
  2902 		$show "$cmd"
       
  2903 		$run eval "$cmd" || exit $?
       
  2904 	      done
       
  2905 	      IFS="$save_ifs"
       
  2906 	    fi
       
  2907  
       
  2908 	    # Create $newlib
       
  2909 	    if test -f "$output_objdir/$newlib"; then :; else
       
  2910 	      $show "generating import library for \`$soname'"
       
  2911 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  2912 	      eval cmds=\"$old_archive_from_expsyms_cmds\"
       
  2913 	      for cmd in $cmds; do
       
  2914 		IFS="$save_ifs"
       
  2915 		$show "$cmd"
       
  2916 		$run eval "$cmd" || exit $?
       
  2917 	      done
       
  2918 	      IFS="$save_ifs"
       
  2919 	    fi
       
  2920 	    # make sure the library variables are pointing to the new library
       
  2921 	    dir=$output_objdir
       
  2922 	    linklib=$newlib
       
  2923 	  fi
       
  2924 
       
  2925 	  lib_linked=yes
       
  2926 	  add_dir=
       
  2927 	  add_shlibpath=
       
  2928 	  add_name=no
       
  2929 	  case "$hardcode_action" in
       
  2930 	  immediate | unsupported)
       
  2931 	    if test "$hardcode_direct" = no; then
       
  2932 	      compile_command="$compile_command $dir/$linklib"
       
  2933 	    elif test "$hardcode_minus_L" = no; then
       
  2934 	      case "$host" in
       
  2935 	      *-*-sunos*) add_shlibpath="$dir" ;;
       
  2936 	      esac
       
  2937 	      add_dir="-L$dir"
       
  2938 	      add_name=yes
       
  2939 	    elif test "$hardcode_shlibpath_var" = no; then
       
  2940 	      add_shlibpath="$dir"
       
  2941 	      add_name=yes
       
  2942 	    else
       
  2943 	      lib_linked=no
       
  2944 	    fi
       
  2945 	    ;;
       
  2946 
       
  2947 	  relink)
       
  2948 	    if test "$hardcode_direct" = yes; then
       
  2949 	      compile_command="$compile_command $absdir/$linklib"
       
  2950 	    elif test "$hardcode_minus_L" = yes; then
       
  2951 	      add_dir="-L$absdir"
       
  2952 	      add_name=yes
       
  2953 	    elif test "$hardcode_shlibpath_var" = yes; then
       
  2954 	      add_shlibpath="$absdir"
       
  2955 	      add_name=yes
       
  2956 	    else
       
  2957 	      lib_linked=no
       
  2958 	    fi
       
  2959 	    ;;
       
  2960 
       
  2961 	  *) lib_linked=no ;;
       
  2962 	  esac
       
  2963 
       
  2964 	  if test "$lib_linked" != yes; then
       
  2965 	    $echo "$modename: configuration error: unsupported hardcode properties"
       
  2966 	    exit 1
       
  2967 	  fi
       
  2968 	  if test -n "$add_dir"; then
       
  2969 	    case "$compile_command " in
       
  2970 	    *" $add_dir "*) ;;
       
  2971 	    *) compile_command="$compile_command $add_dir" ;;
       
  2972 	    esac
       
  2973 	  fi
       
  2974 	  if test -n "$add_shlibpath"; then
       
  2975 	    case ":$compile_shlibpath:" in
       
  2976 	    *":$add_shlibpath:"*) ;;
       
  2977 	    *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
       
  2978 	    esac
       
  2979 	  fi
       
  2980 	  test "$add_name" = yes && compile_command="$compile_command -l$name"
       
  2981 
       
  2982 	  add_dir=
       
  2983 	  add_name=no
       
  2984 	  # Finalize command for both is simple: just hardcode it.
       
  2985 	  if test "$hardcode_direct" = yes; then
       
  2986 	    finalize_command="$finalize_command $libdir/$linklib"
       
  2987 	  elif test "$hardcode_minus_L" = yes; then
       
  2988 	    add_dir="-L$libdir"
       
  2989 	    add_name=yes
       
  2990 	  elif test "$hardcode_shlibpath_var" = yes; then
       
  2991 	    case ":$finalize_shlibpath:" in
       
  2992 	    *":$libdir:"*) ;;
       
  2993 	    *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
       
  2994 	    esac
       
  2995 	    add_name=yes
       
  2996 	  else
       
  2997 	    # We cannot seem to hardcode it, guess we'll fake it.
       
  2998 	    add_dir="-L$libdir"
       
  2999 	    add_name=yes
       
  3000 	  fi
       
  3001 	  if test -n "$add_dir"; then
       
  3002 	    case "$finalize_command " in
       
  3003 	    *" $add_dir "*) ;;
       
  3004 	    *) finalize_command="$finalize_command $add_dir" ;;
       
  3005 	    esac
       
  3006 	  fi
       
  3007 	  test "$add_name" = yes && finalize_command="$finalize_command -l$name"
       
  3008 	else
       
  3009 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
       
  3010 	  # is not unsupported.  This is valid on all known static and
       
  3011 	  # shared platforms.
       
  3012 	  if test "$hardcode_direct" != unsupported; then
       
  3013 	    test -n "$old_library" && linklib="$old_library"
       
  3014 	    compile_command="$compile_command $dir/$linklib"
       
  3015 	    finalize_command="$finalize_command $dir/$linklib"
       
  3016 	  else
       
  3017 	    case "$compile_command " in
       
  3018 	    *" -L$dir "*) ;;
       
  3019 	    *) compile_command="$compile_command -L$dir";;
       
  3020 	    esac
       
  3021 	    compile_command="$compile_command -l$name"
       
  3022 	    case "$finalize_command " in
       
  3023 	    *" -L$dir "*) ;;
       
  3024 	    *) finalize_command="$finalize_command -L$dir";;
       
  3025 	    esac
       
  3026 	    finalize_command="$finalize_command -l$name"
       
  3027 	  fi
       
  3028 	fi
       
  3029       done
       
  3030       
       
  3031       if test -n "$rpath$xrpath"; then
       
  3032 	# If the user specified any rpath flags, then add them.
       
  3033 	for libdir in $rpath $xrpath; do
       
  3034 	  # This is the magic to use -rpath.
       
  3035 	  case "$compile_rpath " in
       
  3036 	  *" $libdir "*) ;;
       
  3037 	  *) compile_rpath="$compile_rpath $libdir" ;;
       
  3038 	  esac
       
  3039 	  case "$finalize_rpath " in
       
  3040 	  *" $libdir "*) ;;
       
  3041 	  *) finalize_rpath="$finalize_rpath $libdir" ;;
       
  3042 	  esac
       
  3043 	done
       
  3044       fi
       
  3045 
       
  3046       # Now hardcode the library paths
       
  3047       rpath=
       
  3048       hardcode_libdirs=
       
  3049       for libdir in $compile_rpath $finalize_rpath; do
       
  3050 	if test -n "$hardcode_libdir_flag_spec"; then
       
  3051 	  if test -n "$hardcode_libdir_separator"; then
       
  3052 	    if test -z "$hardcode_libdirs"; then
       
  3053 	      hardcode_libdirs="$libdir"
       
  3054 	    else
       
  3055 	      # Just accumulate the unique libdirs.
       
  3056 	      case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
       
  3057 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
       
  3058 		;;
       
  3059 	      *)
       
  3060 		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
       
  3061 		;;
       
  3062 	      esac
       
  3063 	    fi
       
  3064 	  else
       
  3065 	    eval flag=\"$hardcode_libdir_flag_spec\"
       
  3066 	    rpath="$rpath $flag"
       
  3067 	  fi
       
  3068 	elif test -n "$runpath_var"; then
       
  3069 	  case "$perm_rpath " in
       
  3070 	  *" $libdir "*) ;;
       
  3071 	  *) perm_rpath="$perm_rpath $libdir" ;;
       
  3072 	  esac
       
  3073 	fi
       
  3074 	case "$host" in
       
  3075 	*-*-cygwin* | *-*-mingw* | *-*-os2*)
       
  3076 	  case ":$dllsearchpath:" in
       
  3077 	  *":$libdir:"*) ;;
       
  3078 	  *) dllsearchpath="$dllsearchpath:$libdir";;
       
  3079 	  esac
       
  3080 	  ;;
       
  3081 	esac
       
  3082       done
       
  3083       # Substitute the hardcoded libdirs into the rpath.
       
  3084       if test -n "$hardcode_libdir_separator" &&
       
  3085 	 test -n "$hardcode_libdirs"; then
       
  3086 	libdir="$hardcode_libdirs"
       
  3087 	eval rpath=\" $hardcode_libdir_flag_spec\"
       
  3088       fi
       
  3089       compile_rpath="$rpath"
       
  3090 
       
  3091       rpath=
       
  3092       hardcode_libdirs=
       
  3093       for libdir in $finalize_rpath; do
       
  3094 	if test -n "$hardcode_libdir_flag_spec"; then
       
  3095 	  if test -n "$hardcode_libdir_separator"; then
       
  3096 	    if test -z "$hardcode_libdirs"; then
       
  3097 	      hardcode_libdirs="$libdir"
       
  3098 	    else
       
  3099 	      # Just accumulate the unique libdirs.
       
  3100 	      case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
       
  3101 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
       
  3102 		;;
       
  3103 	      *)
       
  3104 		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
       
  3105 		;;
       
  3106 	      esac
       
  3107 	    fi
       
  3108 	  else
       
  3109 	    eval flag=\"$hardcode_libdir_flag_spec\"
       
  3110 	    rpath="$rpath $flag"
       
  3111 	  fi
       
  3112 	elif test -n "$runpath_var"; then
       
  3113 	  case "$finalize_perm_rpath " in
       
  3114 	  *" $libdir "*) ;;
       
  3115 	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
       
  3116 	  esac
       
  3117 	fi
       
  3118       done
       
  3119       # Substitute the hardcoded libdirs into the rpath.
       
  3120       if test -n "$hardcode_libdir_separator" &&
       
  3121 	 test -n "$hardcode_libdirs"; then
       
  3122 	libdir="$hardcode_libdirs"
       
  3123 	eval rpath=\" $hardcode_libdir_flag_spec\"
       
  3124       fi
       
  3125       finalize_rpath="$rpath"
       
  3126 
       
  3127       if test -n "$libobjs" && test "$build_old_libs" = yes; then
       
  3128 	# Transform all the library objects into standard objects.
       
  3129 	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       
  3130 	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       
  3131       fi
       
  3132 
       
  3133       dlsyms=
       
  3134       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
       
  3135 	if test -n "$NM" && test -n "$global_symbol_pipe"; then
       
  3136 	  dlsyms="${outputname}S.c"
       
  3137 	else
       
  3138 	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
       
  3139 	fi
       
  3140       fi
       
  3141 
       
  3142       if test -n "$dlsyms"; then
       
  3143 	case "$dlsyms" in
       
  3144 	"") ;;
       
  3145 	*.c)
       
  3146 	  # Discover the nlist of each of the dlfiles.
       
  3147 	  nlist="$output_objdir/${outputname}.nm"
       
  3148 
       
  3149 	  $show "$rm $nlist ${nlist}S ${nlist}T"
       
  3150 	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
       
  3151 
       
  3152 	  # Parse the name list into a source file.
       
  3153 	  $show "creating $output_objdir/$dlsyms"
       
  3154 
       
  3155 	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
       
  3156 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
       
  3157 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
       
  3158 
       
  3159 #ifdef __cplusplus
       
  3160 extern \"C\" {
       
  3161 #endif
       
  3162 
       
  3163 /* Prevent the only kind of declaration conflicts we can make. */
       
  3164 #define lt_preloaded_symbols some_other_symbol
       
  3165 
       
  3166 /* External symbol declarations for the compiler. */\
       
  3167 "
       
  3168 
       
  3169 	  if test "$dlself" = yes; then
       
  3170 	    $show "generating symbol list for \`$output'"
       
  3171 
       
  3172 	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
       
  3173 
       
  3174 	    # Add our own program objects to the symbol list.
       
  3175 	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       
  3176 	    for arg in $progfiles; do
       
  3177 	      $show "extracting global C symbols from \`$arg'"
       
  3178 	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
       
  3179 	    done
       
  3180 
       
  3181 	    if test -n "$exclude_expsyms"; then
       
  3182 	      $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
       
  3183 	      $run eval '$mv "$nlist"T "$nlist"'
       
  3184 	    fi
       
  3185 	    
       
  3186 	    if test -n "$export_symbols_regex"; then
       
  3187 	      $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
       
  3188 	      $run eval '$mv "$nlist"T "$nlist"'
       
  3189 	    fi
       
  3190 
       
  3191 	    # Prepare the list of exported symbols
       
  3192 	    if test -z "$export_symbols"; then
       
  3193 	      export_symbols="$output_objdir/$output.exp"
       
  3194 	      $run $rm $export_symbols
       
  3195 	      $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
       
  3196 	    else
       
  3197 	      $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
       
  3198 	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
       
  3199 	      $run eval 'mv "$nlist"T "$nlist"'
       
  3200 	    fi
       
  3201 	  fi
       
  3202 
       
  3203 	  for arg in $dlprefiles; do
       
  3204 	    $show "extracting global C symbols from \`$arg'"
       
  3205 	    name=`echo "$arg" | sed -e 's%^.*/%%'`
       
  3206 	    $run eval 'echo ": $name " >> "$nlist"'
       
  3207 	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
       
  3208 	  done
       
  3209 
       
  3210 	  if test -z "$run"; then
       
  3211 	    # Make sure we have at least an empty file.
       
  3212 	    test -f "$nlist" || : > "$nlist"
       
  3213 
       
  3214 	    if test -n "$exclude_expsyms"; then
       
  3215 	      egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
       
  3216 	      $mv "$nlist"T "$nlist"
       
  3217 	    fi
       
  3218 
       
  3219 	    # Try sorting and uniquifying the output.
       
  3220 	    if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
       
  3221 	      :
       
  3222 	    else
       
  3223 	      grep -v "^: " < "$nlist" > "$nlist"S
       
  3224 	    fi
       
  3225 
       
  3226 	    if test -f "$nlist"S; then
       
  3227 	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
       
  3228 	    else
       
  3229 	      echo '/* NONE */' >> "$output_objdir/$dlsyms"
       
  3230 	    fi
       
  3231 
       
  3232 	    $echo >> "$output_objdir/$dlsyms" "\
       
  3233 
       
  3234 #undef lt_preloaded_symbols
       
  3235 
       
  3236 #if defined (__STDC__) && __STDC__
       
  3237 # define lt_ptr_t void *
       
  3238 #else
       
  3239 # define lt_ptr_t char *
       
  3240 # define const
       
  3241 #endif
       
  3242 
       
  3243 /* The mapping between symbol names and symbols. */
       
  3244 const struct {
       
  3245   const char *name;
       
  3246   lt_ptr_t address;
       
  3247 }
       
  3248 lt_preloaded_symbols[] =
       
  3249 {\
       
  3250 "
       
  3251 
       
  3252 	    sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
       
  3253 		-e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
       
  3254 		  < "$nlist" >> "$output_objdir/$dlsyms"
       
  3255 
       
  3256 	    $echo >> "$output_objdir/$dlsyms" "\
       
  3257   {0, (lt_ptr_t) 0}
       
  3258 };
       
  3259 
       
  3260 /* This works around a problem in FreeBSD linker */
       
  3261 #ifdef FREEBSD_WORKAROUND
       
  3262 static const void *lt_preloaded_setup() {
       
  3263   return lt_preloaded_symbols;
       
  3264 }
       
  3265 #endif
       
  3266 
       
  3267 #ifdef __cplusplus
       
  3268 }
       
  3269 #endif\
       
  3270 "
       
  3271 	  fi
       
  3272 
       
  3273 	  pic_flag_for_symtable=
       
  3274 	  case "$host" in
       
  3275 	  # compiling the symbol table file with pic_flag works around
       
  3276 	  # a FreeBSD bug that causes programs to crash when -lm is
       
  3277 	  # linked before any other PIC object.  But we must not use
       
  3278 	  # pic_flag when linking with -static.  The problem exists in
       
  3279 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
       
  3280 	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
       
  3281 	    case "$compile_command " in
       
  3282 	    *" -static "*) ;;
       
  3283 	    *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
       
  3284 	    esac;;
       
  3285 	  *-*-hpux*)
       
  3286 	    case "$compile_command " in
       
  3287 	    *" -static "*) ;;
       
  3288 	    *) pic_flag_for_symtable=" $pic_flag -DPIC";;
       
  3289 	    esac
       
  3290 	  esac
       
  3291 
       
  3292 	  # Now compile the dynamic symbol file.
       
  3293 	  $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
       
  3294 	  $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
       
  3295 
       
  3296 	  # Clean up the generated files.
       
  3297 	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
       
  3298 	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
       
  3299 
       
  3300 	  # Transform the symbol file into the correct name.
       
  3301 	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
       
  3302 	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
       
  3303 	  ;;
       
  3304 	*)
       
  3305 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
       
  3306 	  exit 1
       
  3307 	  ;;
       
  3308 	esac
       
  3309       else
       
  3310 	# We keep going just in case the user didn't refer to
       
  3311 	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
       
  3312 	# really was required.
       
  3313 
       
  3314 	# Nullify the symbol file.
       
  3315 	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
       
  3316 	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
       
  3317       fi
       
  3318 
       
  3319       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
       
  3320 	# Replace the output file specification.
       
  3321 	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
       
  3322 	link_command="$compile_command$compile_rpath"
       
  3323 
       
  3324 	# We have no uninstalled library dependencies, so finalize right now.
       
  3325 	$show "$link_command"
       
  3326 	$run eval "$link_command"
       
  3327 	status=$?
       
  3328 	
       
  3329 	# Delete the generated files.
       
  3330 	if test -n "$dlsyms"; then
       
  3331 	  $show "$rm $output_objdir/${outputname}S.${objext}"
       
  3332 	  $run $rm "$output_objdir/${outputname}S.${objext}"
       
  3333 	fi
       
  3334 
       
  3335 	exit $status
       
  3336       fi
       
  3337 
       
  3338       if test -n "$shlibpath_var"; then
       
  3339 	# We should set the shlibpath_var
       
  3340 	rpath=
       
  3341 	for dir in $temp_rpath; do
       
  3342 	  case "$dir" in
       
  3343 	  [\\/]* | [A-Za-z]:[\\/]*)
       
  3344 	    # Absolute path.
       
  3345 	    rpath="$rpath$dir:"
       
  3346 	    ;;
       
  3347 	  *)
       
  3348 	    # Relative path: add a thisdir entry.
       
  3349 	    rpath="$rpath\$thisdir/$dir:"
       
  3350 	    ;;
       
  3351 	  esac
       
  3352 	done
       
  3353 	temp_rpath="$rpath"
       
  3354       fi
       
  3355 
       
  3356       if test -n "$compile_shlibpath$finalize_shlibpath"; then
       
  3357 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
       
  3358       fi
       
  3359       if test -n "$finalize_shlibpath"; then
       
  3360 	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
       
  3361       fi
       
  3362 
       
  3363       compile_var=
       
  3364       finalize_var=
       
  3365       if test -n "$runpath_var"; then
       
  3366 	if test -n "$perm_rpath"; then
       
  3367 	  # We should set the runpath_var.
       
  3368 	  rpath=
       
  3369 	  for dir in $perm_rpath; do
       
  3370 	    rpath="$rpath$dir:"
       
  3371 	  done
       
  3372 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
       
  3373 	fi
       
  3374 	if test -n "$finalize_perm_rpath"; then
       
  3375 	  # We should set the runpath_var.
       
  3376 	  rpath=
       
  3377 	  for dir in $finalize_perm_rpath; do
       
  3378 	    rpath="$rpath$dir:"
       
  3379 	  done
       
  3380 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
       
  3381 	fi
       
  3382       fi
       
  3383 
       
  3384       if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then
       
  3385 	# Fast installation is not supported
       
  3386 	link_command="$compile_var$compile_command$compile_rpath"
       
  3387 	relink_command="$finalize_var$finalize_command$finalize_rpath"
       
  3388 	
       
  3389 	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
       
  3390 	$echo "$modename: \`$output' will be relinked during installation" 1>&2
       
  3391       else
       
  3392 	if test "$fast_install" != no; then
       
  3393 	  link_command="$finalize_var$compile_command$finalize_rpath"
       
  3394 	  if test "$fast_install" = yes; then
       
  3395 	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
       
  3396 	  else
       
  3397 	    # fast_install is set to needless
       
  3398 	    relink_command=
       
  3399 	  fi
       
  3400 	else
       
  3401 	  link_command="$compile_var$compile_command$compile_rpath"
       
  3402 	  relink_command="$finalize_var$finalize_command$finalize_rpath"
       
  3403 	fi
       
  3404       fi
       
  3405 
       
  3406       # Replace the output file specification.
       
  3407       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
       
  3408       
       
  3409       # Delete the old output files.
       
  3410       $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
       
  3411 
       
  3412       $show "$link_command"
       
  3413       $run eval "$link_command" || exit $?
       
  3414 
       
  3415       # Now create the wrapper script.
       
  3416       $show "creating $output"
       
  3417 
       
  3418       # Quote the relink command for shipping.
       
  3419       if test -n "$relink_command"; then
       
  3420 	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       
  3421       fi
       
  3422 
       
  3423       # Quote $echo for shipping.
       
  3424       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
       
  3425 	case "$0" in
       
  3426 	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
       
  3427 	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
       
  3428 	esac
       
  3429 	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
       
  3430       else
       
  3431 	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
       
  3432       fi
       
  3433 
       
  3434       # Only actually do things if our run command is non-null.
       
  3435       if test -z "$run"; then
       
  3436 	# win32 will think the script is a binary if it has
       
  3437 	# a .exe suffix, so we strip it off here.
       
  3438 	case $output in
       
  3439 	  *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
       
  3440 	esac
       
  3441 	$rm $output
       
  3442 	trap "$rm $output; exit 1" 1 2 15
       
  3443 
       
  3444 	$echo > $output "\
       
  3445 #! $SHELL
       
  3446 
       
  3447 # $output - temporary wrapper script for $objdir/$outputname
       
  3448 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
       
  3449 #
       
  3450 # The $output program cannot be directly executed until all the libtool
       
  3451 # libraries that it depends on are installed.
       
  3452 #
       
  3453 # This wrapper script should never be moved out of the build directory.
       
  3454 # If it is, it will not operate correctly.
       
  3455 
       
  3456 # Sed substitution that helps us do robust quoting.  It backslashifies
       
  3457 # metacharacters that are still active within double-quoted strings.
       
  3458 Xsed='sed -e 1s/^X//'
       
  3459 sed_quote_subst='$sed_quote_subst'
       
  3460 
       
  3461 # The HP-UX ksh and POSIX shell print the target directory to stdout
       
  3462 # if CDPATH is set.
       
  3463 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
       
  3464 
       
  3465 relink_command=\"$relink_command\"
       
  3466 
       
  3467 # This environment variable determines our operation mode.
       
  3468 if test \"\$libtool_install_magic\" = \"$magic\"; then
       
  3469   # install mode needs the following variable:
       
  3470   link_against_libtool_libs='$link_against_libtool_libs'
       
  3471 else
       
  3472   # When we are sourced in execute mode, \$file and \$echo are already set.
       
  3473   if test \"\$libtool_execute_magic\" != \"$magic\"; then
       
  3474     echo=\"$qecho\"
       
  3475     file=\"\$0\"
       
  3476     # Make sure echo works.
       
  3477     if test \"X\$1\" = X--no-reexec; then
       
  3478       # Discard the --no-reexec flag, and continue.
       
  3479       shift
       
  3480     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
       
  3481       # Yippee, \$echo works!
       
  3482       :
       
  3483     else
       
  3484       # Restart under the correct shell, and then maybe \$echo will work.
       
  3485       exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
       
  3486     fi
       
  3487   fi\
       
  3488 "
       
  3489 	$echo >> $output "\
       
  3490 
       
  3491   # Find the directory that this script lives in.
       
  3492   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
       
  3493   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
       
  3494 
       
  3495   # Follow symbolic links until we get to the real thisdir.
       
  3496   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
       
  3497   while test -n \"\$file\"; do
       
  3498     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
       
  3499 
       
  3500     # If there was a directory component, then change thisdir.
       
  3501     if test \"x\$destdir\" != \"x\$file\"; then
       
  3502       case \"\$destdir\" in
       
  3503       [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
       
  3504       *) thisdir=\"\$thisdir/\$destdir\" ;;
       
  3505       esac
       
  3506     fi
       
  3507 
       
  3508     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
       
  3509     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
       
  3510   done
       
  3511 
       
  3512   # Try to get the absolute directory name.
       
  3513   absdir=\`cd \"\$thisdir\" && pwd\`
       
  3514   test -n \"\$absdir\" && thisdir=\"\$absdir\"
       
  3515 "
       
  3516 
       
  3517 	if test "$fast_install" = yes; then
       
  3518 	  echo >> $output "\
       
  3519   program=lt-'$outputname'
       
  3520   progdir=\"\$thisdir/$objdir\"
       
  3521   
       
  3522   if test ! -f \"\$progdir/\$program\" || \\
       
  3523      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
       
  3524        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
       
  3525 
       
  3526     file=\"\$\$-\$program\"
       
  3527 
       
  3528     if test ! -d \"\$progdir\"; then
       
  3529       $mkdir \"\$progdir\"
       
  3530     else
       
  3531       $rm \"\$progdir/\$file\"
       
  3532     fi"
       
  3533 
       
  3534 	  echo >> $output "\
       
  3535 
       
  3536     # relink executable if necessary
       
  3537     if test -n \"\$relink_command\"; then
       
  3538       if (cd \"\$thisdir\" && eval \$relink_command); then :
       
  3539       else
       
  3540 	$rm \"\$progdir/\$file\"
       
  3541 	exit 1
       
  3542       fi
       
  3543     fi
       
  3544 
       
  3545     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
       
  3546     { $rm \"\$progdir/\$program\";
       
  3547       $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
       
  3548     $rm \"\$progdir/\$file\"
       
  3549   fi"
       
  3550 	else
       
  3551 	  echo >> $output "\
       
  3552   program='$outputname$exeext'
       
  3553   progdir=\"\$thisdir/$objdir\"
       
  3554 "
       
  3555 	fi
       
  3556 
       
  3557 	echo >> $output "\
       
  3558 
       
  3559   if test -f \"\$progdir/\$program\"; then"
       
  3560 
       
  3561 	# Export our shlibpath_var if we have one.
       
  3562 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
       
  3563 	  $echo >> $output "\
       
  3564     # Add our own library path to $shlibpath_var
       
  3565     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
       
  3566 
       
  3567     # Some systems cannot cope with colon-terminated $shlibpath_var
       
  3568     # The second colon is a workaround for a bug in BeOS R4 sed
       
  3569     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
       
  3570 
       
  3571     export $shlibpath_var
       
  3572 "
       
  3573 	fi
       
  3574 
       
  3575 	# fixup the dll searchpath if we need to.
       
  3576 	if test -n "$dllsearchpath"; then
       
  3577 	  $echo >> $output "\
       
  3578     # Add the dll search path components to the executable PATH
       
  3579     PATH=$dllsearchpath:\$PATH
       
  3580 "
       
  3581 	fi
       
  3582 
       
  3583 	$echo >> $output "\
       
  3584     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       
  3585       # Run the actual program with our arguments.
       
  3586 "
       
  3587 	case $host in
       
  3588 	*-*-cygwin* | *-*-mingw | *-*-os2*)
       
  3589 	  # win32 systems need to use the prog path for dll
       
  3590 	  # lookup to work
       
  3591 	  $echo >> $output "\
       
  3592       exec \$progdir\\\\\$program \${1+\"\$@\"}
       
  3593 "
       
  3594 	  ;;
       
  3595 	*)
       
  3596 	  $echo >> $output "\
       
  3597       # Export the path to the program.
       
  3598       PATH=\"\$progdir:\$PATH\"
       
  3599       export PATH
       
  3600 
       
  3601       exec \$program \${1+\"\$@\"}
       
  3602 "
       
  3603 	  ;;
       
  3604 	esac
       
  3605 	$echo >> $output "\
       
  3606       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
       
  3607       exit 1
       
  3608     fi
       
  3609   else
       
  3610     # The program doesn't exist.
       
  3611     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
       
  3612     \$echo \"This script is just a wrapper for \$program.\" 1>&2
       
  3613     echo \"See the $PACKAGE documentation for more information.\" 1>&2
       
  3614     exit 1
       
  3615   fi
       
  3616 fi\
       
  3617 "
       
  3618 	chmod +x $output
       
  3619       fi
       
  3620       exit 0
       
  3621       ;;
       
  3622     esac
       
  3623 
       
  3624     # See if we need to build an old-fashioned archive.
       
  3625     for oldlib in $oldlibs; do
       
  3626 
       
  3627       if test "$build_libtool_libs" = convenience; then
       
  3628 	oldobjs="$libobjs_save"
       
  3629 	addlibs="$convenience"
       
  3630 	build_libtool_libs=no
       
  3631       else
       
  3632 	if test "$build_libtool_libs" = module; then
       
  3633 	  oldobjs="$libobjs_save"
       
  3634 	  build_libtool_libs=no
       
  3635 	else
       
  3636 	  oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
       
  3637 	fi
       
  3638 	addlibs="$old_convenience"
       
  3639       fi
       
  3640 
       
  3641       if test -n "$addlibs"; then
       
  3642 	gentop="$output_objdir/${outputname}x"
       
  3643 	$show "${rm}r $gentop"
       
  3644 	$run ${rm}r "$gentop"
       
  3645 	$show "mkdir $gentop"
       
  3646 	$run mkdir "$gentop"
       
  3647 	status=$?
       
  3648 	if test $status -ne 0 && test ! -d "$gentop"; then
       
  3649 	  exit $status
       
  3650 	fi
       
  3651 	generated="$generated $gentop"
       
  3652 	  
       
  3653 	# Add in members from convenience archives.
       
  3654 	for xlib in $addlibs; do
       
  3655 	  # Extract the objects.
       
  3656 	  case "$xlib" in
       
  3657 	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
       
  3658 	  *) xabs=`pwd`"/$xlib" ;;
       
  3659 	  esac
       
  3660 	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  3661 	  xdir="$gentop/$xlib"
       
  3662 
       
  3663 	  $show "${rm}r $xdir"
       
  3664 	  $run ${rm}r "$xdir"
       
  3665 	  $show "mkdir $xdir"
       
  3666 	  $run mkdir "$xdir"
       
  3667 	  status=$?
       
  3668 	  if test $status -ne 0 && test ! -d "$xdir"; then
       
  3669 	    exit $status
       
  3670 	  fi
       
  3671 	  $show "(cd $xdir && $AR x $xabs)"
       
  3672 	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  3673 
       
  3674 	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
       
  3675 	done
       
  3676       fi
       
  3677 
       
  3678       # Do each command in the archive commands.
       
  3679       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
       
  3680 	eval cmds=\"$old_archive_from_new_cmds\"
       
  3681       else
       
  3682 	# Ensure that we have .o objects in place in case we decided
       
  3683 	# not to build a shared library, and have fallen back to building
       
  3684 	# static libs even though --disable-static was passed!
       
  3685 	for oldobj in $oldobjs; do
       
  3686 	  if test ! -f $oldobj; then
       
  3687 	    xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
       
  3688 	    if test "X$xdir" = "X$oldobj"; then
       
  3689 	      xdir="."
       
  3690 	    else
       
  3691 	      xdir="$xdir"
       
  3692 	    fi
       
  3693 	    baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
       
  3694 	    obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
       
  3695 	    $show "(cd $xdir && ${LN_S} $obj $baseobj)"
       
  3696 	    $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
       
  3697 	  fi
       
  3698 	done
       
  3699 
       
  3700 	eval cmds=\"$old_archive_cmds\"
       
  3701       fi
       
  3702       IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  3703       for cmd in $cmds; do
       
  3704 	IFS="$save_ifs"
       
  3705 	$show "$cmd"
       
  3706 	$run eval "$cmd" || exit $?
       
  3707       done
       
  3708       IFS="$save_ifs"
       
  3709     done
       
  3710 
       
  3711     if test -n "$generated"; then
       
  3712       $show "${rm}r$generated"
       
  3713       $run ${rm}r$generated
       
  3714     fi
       
  3715 
       
  3716     # Now create the libtool archive.
       
  3717     case "$output" in
       
  3718     *.la)
       
  3719       old_library=
       
  3720       test "$build_old_libs" = yes && old_library="$libname.$libext"
       
  3721       $show "creating $output"
       
  3722 
       
  3723       # Quote the link command for shipping.
       
  3724       relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
       
  3725       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       
  3726       
       
  3727       # Only create the output if not a dry run.
       
  3728       if test -z "$run"; then
       
  3729 	for installed in no yes; do
       
  3730 	  if test "$installed" = yes; then
       
  3731 	    if test -z "$install_libdir"; then
       
  3732 	      break
       
  3733 	    fi
       
  3734 	    output="$output_objdir/$outputname"i
       
  3735 	    # Replace all uninstalled libtool libraries with the installed ones
       
  3736 	    newdependency_libs=
       
  3737 	    for deplib in $dependency_libs; do
       
  3738 	      case "$deplib" in
       
  3739 	      *.la) 
       
  3740 		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
       
  3741 		eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
       
  3742 		if test -z "$libdir"; then
       
  3743 		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
       
  3744 		  exit 1
       
  3745 		fi
       
  3746 		newdependency_libs="$newdependency_libs $libdir/$name"
       
  3747 		;;
       
  3748 	      *) newdependency_libs="$newdependency_libs $deplib" ;;
       
  3749 	      esac
       
  3750 	    done
       
  3751 	    dependency_libs="$newdependency_libs"
       
  3752 	  fi
       
  3753 	  $rm $output
       
  3754 	  $echo > $output "\
       
  3755 # $outputname - a libtool library file
       
  3756 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
       
  3757 #
       
  3758 # Please DO NOT delete this file!
       
  3759 # It is necessary for linking the library.
       
  3760 
       
  3761 # The name that we can dlopen(3).
       
  3762 dlname='$dlname'
       
  3763 
       
  3764 # Names of this library.
       
  3765 library_names='$library_names'
       
  3766 
       
  3767 # The name of the static archive.
       
  3768 old_library='$old_library'
       
  3769 
       
  3770 # Libraries that this one depends upon.
       
  3771 dependency_libs='$dependency_libs'
       
  3772 
       
  3773 # Version information for $libname.
       
  3774 current=$current
       
  3775 age=$age
       
  3776 revision=$revision
       
  3777 
       
  3778 # Is this an already installed library?
       
  3779 installed=$installed
       
  3780 
       
  3781 # Directory that this library needs to be installed in:
       
  3782 libdir='$install_libdir'"
       
  3783 	  if test "$installed" = no; then
       
  3784 	    $echo >> $output "\
       
  3785 relink_command=\"$relink_command\""
       
  3786 	  fi
       
  3787 	done
       
  3788       fi
       
  3789 
       
  3790       # Do a symbolic link so that the libtool archive can be found in
       
  3791       # LD_LIBRARY_PATH before the program is installed.
       
  3792       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
       
  3793       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
       
  3794       ;;
       
  3795     esac
       
  3796     exit 0
       
  3797     ;;
       
  3798 
       
  3799   # libtool install mode
       
  3800   install)
       
  3801     modename="$modename: install"
       
  3802 
       
  3803     # There may be an optional sh(1) argument at the beginning of
       
  3804     # install_prog (especially on Windows NT).
       
  3805     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
       
  3806       # Aesthetically quote it.
       
  3807       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       
  3808       case "$arg" in
       
  3809       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  3810 	arg="\"$arg\""
       
  3811 	;;
       
  3812       esac
       
  3813       install_prog="$arg "
       
  3814       arg="$1"
       
  3815       shift
       
  3816     else
       
  3817       install_prog=
       
  3818       arg="$nonopt"
       
  3819     fi
       
  3820 
       
  3821     # The real first argument should be the name of the installation program.
       
  3822     # Aesthetically quote it.
       
  3823     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  3824     case "$arg" in
       
  3825     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  3826       arg="\"$arg\""
       
  3827       ;;
       
  3828     esac
       
  3829     install_prog="$install_prog$arg"
       
  3830 
       
  3831     # We need to accept at least all the BSD install flags.
       
  3832     dest=
       
  3833     files=
       
  3834     opts=
       
  3835     prev=
       
  3836     install_type=
       
  3837     isdir=no
       
  3838     stripme=
       
  3839     for arg
       
  3840     do
       
  3841       if test -n "$dest"; then
       
  3842 	files="$files $dest"
       
  3843 	dest="$arg"
       
  3844 	continue
       
  3845       fi
       
  3846 
       
  3847       case "$arg" in
       
  3848       -d) isdir=yes ;;
       
  3849       -f) prev="-f" ;;
       
  3850       -g) prev="-g" ;;
       
  3851       -m) prev="-m" ;;
       
  3852       -o) prev="-o" ;;
       
  3853       -s)
       
  3854 	stripme=" -s"
       
  3855 	continue
       
  3856 	;;
       
  3857       -*) ;;
       
  3858 
       
  3859       *)
       
  3860 	# If the previous option needed an argument, then skip it.
       
  3861 	if test -n "$prev"; then
       
  3862 	  prev=
       
  3863 	else
       
  3864 	  dest="$arg"
       
  3865 	  continue
       
  3866 	fi
       
  3867 	;;
       
  3868       esac
       
  3869 
       
  3870       # Aesthetically quote the argument.
       
  3871       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       
  3872       case "$arg" in
       
  3873       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
       
  3874 	arg="\"$arg\""
       
  3875 	;;
       
  3876       esac
       
  3877       install_prog="$install_prog $arg"
       
  3878     done
       
  3879 
       
  3880     if test -z "$install_prog"; then
       
  3881       $echo "$modename: you must specify an install program" 1>&2
       
  3882       $echo "$help" 1>&2
       
  3883       exit 1
       
  3884     fi
       
  3885 
       
  3886     if test -n "$prev"; then
       
  3887       $echo "$modename: the \`$prev' option requires an argument" 1>&2
       
  3888       $echo "$help" 1>&2
       
  3889       exit 1
       
  3890     fi
       
  3891 
       
  3892     if test -z "$files"; then
       
  3893       if test -z "$dest"; then
       
  3894 	$echo "$modename: no file or destination specified" 1>&2
       
  3895       else
       
  3896 	$echo "$modename: you must specify a destination" 1>&2
       
  3897       fi
       
  3898       $echo "$help" 1>&2
       
  3899       exit 1
       
  3900     fi
       
  3901 
       
  3902     # Strip any trailing slash from the destination.
       
  3903     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
       
  3904 
       
  3905     # Check to see that the destination is a directory.
       
  3906     test -d "$dest" && isdir=yes
       
  3907     if test "$isdir" = yes; then
       
  3908       destdir="$dest"
       
  3909       destname=
       
  3910     else
       
  3911       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
       
  3912       test "X$destdir" = "X$dest" && destdir=.
       
  3913       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
       
  3914 
       
  3915       # Not a directory, so check to see that there is only one file specified.
       
  3916       set dummy $files
       
  3917       if test $# -gt 2; then
       
  3918 	$echo "$modename: \`$dest' is not a directory" 1>&2
       
  3919 	$echo "$help" 1>&2
       
  3920 	exit 1
       
  3921       fi
       
  3922     fi
       
  3923     case "$destdir" in
       
  3924     [\\/]* | [A-Za-z]:[\\/]*) ;;
       
  3925     *)
       
  3926       for file in $files; do
       
  3927 	case "$file" in
       
  3928 	*.lo) ;;
       
  3929 	*)
       
  3930 	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
       
  3931 	  $echo "$help" 1>&2
       
  3932 	  exit 1
       
  3933 	  ;;
       
  3934 	esac
       
  3935       done
       
  3936       ;;
       
  3937     esac
       
  3938 
       
  3939     # This variable tells wrapper scripts just to set variables rather
       
  3940     # than running their programs.
       
  3941     libtool_install_magic="$magic"
       
  3942 
       
  3943     staticlibs=
       
  3944     future_libdirs=
       
  3945     current_libdirs=
       
  3946     for file in $files; do
       
  3947 
       
  3948       # Do each installation.
       
  3949       case "$file" in
       
  3950       *.a | *.lib)
       
  3951 	# Do the static libraries later.
       
  3952 	staticlibs="$staticlibs $file"
       
  3953 	;;
       
  3954 
       
  3955       *.la)
       
  3956 	# Check to see that this really is a libtool archive.
       
  3957 	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
       
  3958 	else
       
  3959 	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
       
  3960 	  $echo "$help" 1>&2
       
  3961 	  exit 1
       
  3962 	fi
       
  3963 
       
  3964 	library_names=
       
  3965 	old_library=
       
  3966 	relink_command=
       
  3967 	# If there is no directory component, then add one.
       
  3968 	case "$file" in
       
  3969 	*/* | *\\*) . $file ;;
       
  3970 	*) . ./$file ;;
       
  3971 	esac
       
  3972 
       
  3973 	# Add the libdir to current_libdirs if it is the destination.
       
  3974 	if test "X$destdir" = "X$libdir"; then
       
  3975 	  case "$current_libdirs " in
       
  3976 	  *" $libdir "*) ;;
       
  3977 	  *) current_libdirs="$current_libdirs $libdir" ;;
       
  3978 	  esac
       
  3979 	else
       
  3980 	  # Note the libdir as a future libdir.
       
  3981 	  case "$future_libdirs " in
       
  3982 	  *" $libdir "*) ;;
       
  3983 	  *) future_libdirs="$future_libdirs $libdir" ;;
       
  3984 	  esac
       
  3985 	fi
       
  3986 
       
  3987 	dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
       
  3988 	test "X$dir" = "X$file/" && dir=
       
  3989 	dir="$dir$objdir"
       
  3990 
       
  3991 	if test "$hardcode_into_libs" = yes; then
       
  3992 	  if test -z "$relink_command"; then
       
  3993 	    $echo "$modename: invalid libtool pseudo library \`$file'" 1>&2
       
  3994 	    exit 1
       
  3995 	  fi
       
  3996 	  $echo "$modename: warning: relinking \`$file'" 1>&2
       
  3997 	  $show "$relink_command"
       
  3998 	  if $run eval "$relink_command"; then :
       
  3999 	  else
       
  4000 	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
       
  4001 	    continue
       
  4002 	  fi
       
  4003 	fi
       
  4004 	
       
  4005 	# See the names of the shared library.
       
  4006 	set dummy $library_names
       
  4007 	if test -n "$2"; then
       
  4008 	  realname="$2"
       
  4009 	  shift
       
  4010 	  shift
       
  4011 
       
  4012 	  srcname="$realname"
       
  4013 	  test "$hardcode_into_libs" = yes && srcname="$realname"T
       
  4014 
       
  4015 	  # Install the shared library and build the symlinks.
       
  4016 	  $show "$install_prog $dir/$srcname $destdir/$realname"
       
  4017 	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
       
  4018 	  if test -n "$stripme" && test -n "$striplib"; then
       
  4019 	    $show "$striplib $destdir/$realname"
       
  4020 	    $run eval "$striplib $destdir/$realname" || exit $?
       
  4021 	  fi
       
  4022 
       
  4023 	  if test $# -gt 0; then
       
  4024 	    # Delete the old symlinks, and create new ones.
       
  4025 	    for linkname
       
  4026 	    do
       
  4027 	      if test "$linkname" != "$realname"; then
       
  4028 		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
       
  4029 		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
       
  4030 	      fi
       
  4031 	    done
       
  4032 	  fi
       
  4033 
       
  4034 	  # Do each command in the postinstall commands.
       
  4035 	  lib="$destdir/$realname"
       
  4036 	  eval cmds=\"$postinstall_cmds\"
       
  4037 	  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
       
  4038 	  for cmd in $cmds; do
       
  4039 	    IFS="$save_ifs"
       
  4040 	    $show "$cmd"
       
  4041 	    $run eval "$cmd" || exit $?
       
  4042 	  done
       
  4043 	  IFS="$save_ifs"
       
  4044 	fi
       
  4045 
       
  4046 	# Install the pseudo-library for information purposes.
       
  4047 	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
       
  4048 	instname="$dir/$name"i
       
  4049 	$show "$install_prog $instname $destdir/$name"
       
  4050 	$run eval "$install_prog $instname $destdir/$name" || exit $?
       
  4051 
       
  4052 	# Maybe install the static library, too.
       
  4053 	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
       
  4054 	;;
       
  4055 
       
  4056       *.lo)
       
  4057 	# Install (i.e. copy) a libtool object.
       
  4058 
       
  4059 	# Figure out destination file name, if it wasn't already specified.
       
  4060 	if test -n "$destname"; then
       
  4061 	  destfile="$destdir/$destname"
       
  4062 	else
       
  4063 	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
       
  4064 	  destfile="$destdir/$destfile"
       
  4065 	fi
       
  4066 
       
  4067 	# Deduce the name of the destination old-style object file.
       
  4068 	case "$destfile" in
       
  4069 	*.lo)
       
  4070 	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
       
  4071 	  ;;
       
  4072 	*.o | *.obj)
       
  4073 	  staticdest="$destfile"
       
  4074 	  destfile=
       
  4075 	  ;;
       
  4076 	*)
       
  4077 	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
       
  4078 	  $echo "$help" 1>&2
       
  4079 	  exit 1
       
  4080 	  ;;
       
  4081 	esac
       
  4082 
       
  4083 	# Install the libtool object if requested.
       
  4084 	if test -n "$destfile"; then
       
  4085 	  $show "$install_prog $file $destfile"
       
  4086 	  $run eval "$install_prog $file $destfile" || exit $?
       
  4087 	fi
       
  4088 
       
  4089 	# Install the old object if enabled.
       
  4090 	if test "$build_old_libs" = yes; then
       
  4091 	  # Deduce the name of the old-style object file.
       
  4092 	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
       
  4093 
       
  4094 	  $show "$install_prog $staticobj $staticdest"
       
  4095 	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
       
  4096 	fi
       
  4097 	exit 0
       
  4098 	;;
       
  4099 
       
  4100       *)
       
  4101 	# Figure out destination file name, if it wasn't already specified.
       
  4102 	if test -n "$destname"; then
       
  4103 	  destfile="$destdir/$destname"
       
  4104 	else
       
  4105 	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
       
  4106 	  destfile="$destdir/$destfile"
       
  4107 	fi
       
  4108 
       
  4109 	# Do a test to see if this is really a libtool program.
       
  4110 	if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
       
  4111 	  link_against_libtool_libs=
       
  4112 	  relink_command=
       
  4113 
       
  4114 	  # If there is no directory component, then add one.
       
  4115 	  case "$file" in
       
  4116 	  */* | *\\*) . $file ;;
       
  4117 	  *) . ./$file ;;
       
  4118 	  esac
       
  4119 
       
  4120 	  # Check the variables that should have been set.
       
  4121 	  if test -z "$link_against_libtool_libs"; then
       
  4122 	    $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
       
  4123 	    exit 1
       
  4124 	  fi
       
  4125 
       
  4126 	  finalize=yes
       
  4127 	  for lib in $link_against_libtool_libs; do
       
  4128 	    # Check to see that each library is installed.
       
  4129 	    libdir=
       
  4130 	    if test -f "$lib"; then
       
  4131 	      # If there is no directory component, then add one.
       
  4132 	      case "$lib" in
       
  4133 	      */* | *\\*) . $lib ;;
       
  4134 	      *) . ./$lib ;;
       
  4135 	      esac
       
  4136 	    fi
       
  4137 	    libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
       
  4138 	    if test -n "$libdir" && test ! -f "$libfile"; then
       
  4139 	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
       
  4140 	      finalize=no
       
  4141 	    fi
       
  4142 	  done
       
  4143 
       
  4144 	  relink_command=
       
  4145 	  # If there is no directory component, then add one.
       
  4146 	  case "$file" in
       
  4147 	  */* | *\\*) . $file ;;
       
  4148 	  *) . ./$file ;;
       
  4149 	  esac
       
  4150 
       
  4151 	  outputname=
       
  4152 	  if test "$fast_install" = no && test -n "$relink_command"; then
       
  4153 	    if test "$finalize" = yes && test -z "$run"; then
       
  4154 	      tmpdir="/tmp"
       
  4155 	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
       
  4156 	      tmpdir="$tmpdir/libtool-$$"
       
  4157 	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
       
  4158 	      else
       
  4159 		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
       
  4160 		continue
       
  4161 	      fi
       
  4162 	      outputname="$tmpdir/$file"
       
  4163 	      # Replace the output file specification.
       
  4164 	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
       
  4165 
       
  4166 	      $show "$relink_command"
       
  4167 	      if $run eval "$relink_command"; then :
       
  4168 	      else
       
  4169 		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
       
  4170 		${rm}r "$tmpdir"