ltmain.sh
上传用户:qaz666999
上传日期:2022-08-06
资源大小:2570k
文件大小:238k
源码类别:

数学计算

开发平台:

Unix_Linux

  1.   esac
  2.   ;;
  3. expsyms)
  4.   export_symbols="$arg"
  5.   test -f "$arg" 
  6.     || func_fatal_error "symbol file `$arg' does not exist"
  7.   prev=
  8.   continue
  9.   ;;
  10. expsyms_regex)
  11.   export_symbols_regex="$arg"
  12.   prev=
  13.   continue
  14.   ;;
  15. framework)
  16.   case $host in
  17.     *-*-darwin*)
  18.       case "$deplibs " in
  19. *" $qarg.ltframework "*) ;;
  20. *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
  21.    ;;
  22.       esac
  23.       ;;
  24.   esac
  25.   prev=
  26.   continue
  27.   ;;
  28. inst_prefix)
  29.   inst_prefix_dir="$arg"
  30.   prev=
  31.   continue
  32.   ;;
  33. objectlist)
  34.   if test -f "$arg"; then
  35.     save_arg=$arg
  36.     moreargs=
  37.     for fil in `cat "$save_arg"`
  38.     do
  39. #       moreargs="$moreargs $fil"
  40.       arg=$fil
  41.       # A libtool-controlled object.
  42.       # Check to see that this really is a libtool object.
  43.       if func_lalib_unsafe_p "$arg"; then
  44. pic_object=
  45. non_pic_object=
  46. # Read the .lo file
  47. func_source "$arg"
  48. if test -z "$pic_object" ||
  49.    test -z "$non_pic_object" ||
  50.    test "$pic_object" = none &&
  51.    test "$non_pic_object" = none; then
  52.   func_fatal_error "cannot find name of object for `$arg'"
  53. fi
  54. # Extract subdirectory from the argument.
  55. func_dirname "$arg" "/" ""
  56. xdir="$func_dirname_result"
  57. if test "$pic_object" != none; then
  58.   # Prepend the subdirectory the object is found in.
  59.   pic_object="$xdir$pic_object"
  60.   if test "$prev" = dlfiles; then
  61.     if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  62.       dlfiles="$dlfiles $pic_object"
  63.       prev=
  64.       continue
  65.     else
  66.       # If libtool objects are unsupported, then we need to preload.
  67.       prev=dlprefiles
  68.     fi
  69.   fi
  70.   # CHECK ME:  I think I busted this.  -Ossama
  71.   if test "$prev" = dlprefiles; then
  72.     # Preload the old-style object.
  73.     dlprefiles="$dlprefiles $pic_object"
  74.     prev=
  75.   fi
  76.   # A PIC object.
  77.   func_append libobjs " $pic_object"
  78.   arg="$pic_object"
  79. fi
  80. # Non-PIC object.
  81. if test "$non_pic_object" != none; then
  82.   # Prepend the subdirectory the object is found in.
  83.   non_pic_object="$xdir$non_pic_object"
  84.   # A standard non-PIC object
  85.   func_append non_pic_objects " $non_pic_object"
  86.   if test -z "$pic_object" || test "$pic_object" = none ; then
  87.     arg="$non_pic_object"
  88.   fi
  89. else
  90.   # If the PIC object exists, use it instead.
  91.   # $xdir was prepended to $pic_object above.
  92.   non_pic_object="$pic_object"
  93.   func_append non_pic_objects " $non_pic_object"
  94. fi
  95.       else
  96. # Only an error if not doing a dry-run.
  97. if $opt_dry_run; then
  98.   # Extract subdirectory from the argument.
  99.   func_dirname "$arg" "/" ""
  100.   xdir="$func_dirname_result"
  101.   func_lo2o "$arg"
  102.   pic_object=$xdir$objdir/$func_lo2o_result
  103.   non_pic_object=$xdir$func_lo2o_result
  104.   func_append libobjs " $pic_object"
  105.   func_append non_pic_objects " $non_pic_object"
  106.         else
  107.   func_fatal_error "`$arg' is not a valid libtool object"
  108. fi
  109.       fi
  110.     done
  111.   else
  112.     func_fatal_error "link input file `$arg' does not exist"
  113.   fi
  114.   arg=$save_arg
  115.   prev=
  116.   continue
  117.   ;;
  118. precious_regex)
  119.   precious_files_regex="$arg"
  120.   prev=
  121.   continue
  122.   ;;
  123. release)
  124.   release="-$arg"
  125.   prev=
  126.   continue
  127.   ;;
  128. rpath | xrpath)
  129.   # We need an absolute path.
  130.   case $arg in
  131.   [\/]* | [A-Za-z]:[\/]*) ;;
  132.   *)
  133.     func_fatal_error "only absolute run-paths are allowed"
  134.     ;;
  135.   esac
  136.   if test "$prev" = rpath; then
  137.     case "$rpath " in
  138.     *" $arg "*) ;;
  139.     *) rpath="$rpath $arg" ;;
  140.     esac
  141.   else
  142.     case "$xrpath " in
  143.     *" $arg "*) ;;
  144.     *) xrpath="$xrpath $arg" ;;
  145.     esac
  146.   fi
  147.   prev=
  148.   continue
  149.   ;;
  150. shrext)
  151.   shrext_cmds="$arg"
  152.   prev=
  153.   continue
  154.   ;;
  155. weak)
  156.   weak_libs="$weak_libs $arg"
  157.   prev=
  158.   continue
  159.   ;;
  160. xcclinker)
  161.   linker_flags="$linker_flags $qarg"
  162.   compiler_flags="$compiler_flags $qarg"
  163.   prev=
  164.   func_append compile_command " $qarg"
  165.   func_append finalize_command " $qarg"
  166.   continue
  167.   ;;
  168. xcompiler)
  169.   compiler_flags="$compiler_flags $qarg"
  170.   prev=
  171.   func_append compile_command " $qarg"
  172.   func_append finalize_command " $qarg"
  173.   continue
  174.   ;;
  175. xlinker)
  176.   linker_flags="$linker_flags $qarg"
  177.   compiler_flags="$compiler_flags $wl$qarg"
  178.   prev=
  179.   func_append compile_command " $wl$qarg"
  180.   func_append finalize_command " $wl$qarg"
  181.   continue
  182.   ;;
  183. *)
  184.   eval "$prev="$arg""
  185.   prev=
  186.   continue
  187.   ;;
  188. esac
  189.       fi # test -n "$prev"
  190.       prevarg="$arg"
  191.       case $arg in
  192.       -all-static)
  193. if test -n "$link_static_flag"; then
  194.   # See comment for -static flag below, for more details.
  195.   func_append compile_command " $link_static_flag"
  196.   func_append finalize_command " $link_static_flag"
  197. fi
  198. continue
  199. ;;
  200.       -allow-undefined)
  201. # FIXME: remove this flag sometime in the future.
  202. func_fatal_error "`-allow-undefined' must not be used because it is the default"
  203. ;;
  204.       -avoid-version)
  205. avoid_version=yes
  206. continue
  207. ;;
  208.       -dlopen)
  209. prev=dlfiles
  210. continue
  211. ;;
  212.       -dlpreopen)
  213. prev=dlprefiles
  214. continue
  215. ;;
  216.       -export-dynamic)
  217. export_dynamic=yes
  218. continue
  219. ;;
  220.       -export-symbols | -export-symbols-regex)
  221. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  222.   func_fatal_error "more than one -exported-symbols argument is not allowed"
  223. fi
  224. if test "X$arg" = "X-export-symbols"; then
  225.   prev=expsyms
  226. else
  227.   prev=expsyms_regex
  228. fi
  229. continue
  230. ;;
  231.       -framework)
  232. prev=framework
  233. continue
  234. ;;
  235.       -inst-prefix-dir)
  236. prev=inst_prefix
  237. continue
  238. ;;
  239.       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  240.       # so, if we see these flags be careful not to treat them like -L
  241.       -L[A-Z][A-Z]*:*)
  242. case $with_gcc/$host in
  243. no/*-*-irix* | /*-*-irix*)
  244.   func_append compile_command " $arg"
  245.   func_append finalize_command " $arg"
  246.   ;;
  247. esac
  248. continue
  249. ;;
  250.       -L*)
  251. func_stripname '-L' '' "$arg"
  252. dir=$func_stripname_result
  253. if test -z "$dir"; then
  254.   if test "$#" -gt 0; then
  255.     func_fatal_error "require no space between `-L' and `$1'"
  256.   else
  257.     func_fatal_error "need path for `-L' option"
  258.   fi
  259. fi
  260. # We need an absolute path.
  261. case $dir in
  262. [\/]* | [A-Za-z]:[\/]*) ;;
  263. *)
  264.   absdir=`cd "$dir" && pwd`
  265.   test -z "$absdir" && 
  266.     func_fatal_error "cannot determine absolute directory name of `$dir'"
  267.   dir="$absdir"
  268.   ;;
  269. esac
  270. case "$deplibs " in
  271. *" -L$dir "*) ;;
  272. *)
  273.   deplibs="$deplibs -L$dir"
  274.   lib_search_path="$lib_search_path $dir"
  275.   ;;
  276. esac
  277. case $host in
  278. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  279.   testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  280.   case :$dllsearchpath: in
  281.   *":$dir:"*) ;;
  282.   ::) dllsearchpath=$dir;;
  283.   *) dllsearchpath="$dllsearchpath:$dir";;
  284.   esac
  285.   case :$dllsearchpath: in
  286.   *":$testbindir:"*) ;;
  287.   ::) dllsearchpath=$testbindir;;
  288.   *) dllsearchpath="$dllsearchpath:$testbindir";;
  289.   esac
  290.   ;;
  291. esac
  292. continue
  293. ;;
  294.       -l*)
  295. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  296.   case $host in
  297.   *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
  298.     # These systems don't actually have a C or math library (as such)
  299.     continue
  300.     ;;
  301.   *-*-os2*)
  302.     # These systems don't actually have a C library (as such)
  303.     test "X$arg" = "X-lc" && continue
  304.     ;;
  305.   *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  306.     # Do not include libc due to us having libc/libc_r.
  307.     test "X$arg" = "X-lc" && continue
  308.     ;;
  309.   *-*-rhapsody* | *-*-darwin1.[012])
  310.     # Rhapsody C and math libraries are in the System framework
  311.     deplibs="$deplibs System.ltframework"
  312.     continue
  313.     ;;
  314.   *-*-sco3.2v5* | *-*-sco5v6*)
  315.     # Causes problems with __ctype
  316.     test "X$arg" = "X-lc" && continue
  317.     ;;
  318.   *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  319.     # Compiler inserts libc in the correct place for threads to work
  320.     test "X$arg" = "X-lc" && continue
  321.     ;;
  322.   esac
  323. elif test "X$arg" = "X-lc_r"; then
  324.  case $host in
  325.  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  326.    # Do not include libc_r directly, use -pthread flag.
  327.    continue
  328.    ;;
  329.  esac
  330. fi
  331. deplibs="$deplibs $arg"
  332. continue
  333. ;;
  334.       -module)
  335. module=yes
  336. continue
  337. ;;
  338.       # Tru64 UNIX uses -model [arg] to determine the layout of C++
  339.       # classes, name mangling, and exception handling.
  340.       # Darwin uses the -arch flag to determine output architecture.
  341.       -model|-arch|-isysroot)
  342. compiler_flags="$compiler_flags $arg"
  343. func_append compile_command " $arg"
  344. func_append finalize_command " $arg"
  345. prev=xcompiler
  346. continue
  347. ;;
  348.       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  349. compiler_flags="$compiler_flags $arg"
  350. func_append compile_command " $arg"
  351. func_append finalize_command " $arg"
  352. case "$new_inherited_linker_flags " in
  353.     *" $arg "*) ;;
  354.     * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
  355. esac
  356. continue
  357. ;;
  358.       -multi_module)
  359. single_module="${wl}-multi_module"
  360. continue
  361. ;;
  362.       -no-fast-install)
  363. fast_install=no
  364. continue
  365. ;;
  366.       -no-install)
  367. case $host in
  368. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  369.   # The PATH hackery in wrapper scripts is required on Windows
  370.   # and Darwin in order for the loader to find any dlls it needs.
  371.   func_warning "`-no-install' is ignored for $host"
  372.   func_warning "assuming `-no-fast-install' instead"
  373.   fast_install=no
  374.   ;;
  375. *) no_install=yes ;;
  376. esac
  377. continue
  378. ;;
  379.       -no-undefined)
  380. allow_undefined=no
  381. continue
  382. ;;
  383.       -objectlist)
  384. prev=objectlist
  385. continue
  386. ;;
  387.       -o) prev=output ;;
  388.       -precious-files-regex)
  389. prev=precious_regex
  390. continue
  391. ;;
  392.       -release)
  393. prev=release
  394. continue
  395. ;;
  396.       -rpath)
  397. prev=rpath
  398. continue
  399. ;;
  400.       -R)
  401. prev=xrpath
  402. continue
  403. ;;
  404.       -R*)
  405. func_stripname '-R' '' "$arg"
  406. dir=$func_stripname_result
  407. # We need an absolute path.
  408. case $dir in
  409. [\/]* | [A-Za-z]:[\/]*) ;;
  410. *)
  411.   func_fatal_error "only absolute run-paths are allowed"
  412.   ;;
  413. esac
  414. case "$xrpath " in
  415. *" $dir "*) ;;
  416. *) xrpath="$xrpath $dir" ;;
  417. esac
  418. continue
  419. ;;
  420.       -shared)
  421. # The effects of -shared are defined in a previous loop.
  422. continue
  423. ;;
  424.       -shrext)
  425. prev=shrext
  426. continue
  427. ;;
  428.       -static | -static-libtool-libs)
  429. # The effects of -static are defined in a previous loop.
  430. # We used to do the same as -all-static on platforms that
  431. # didn't have a PIC flag, but the assumption that the effects
  432. # would be equivalent was wrong.  It would break on at least
  433. # Digital Unix and AIX.
  434. continue
  435. ;;
  436.       -thread-safe)
  437. thread_safe=yes
  438. continue
  439. ;;
  440.       -version-info)
  441. prev=vinfo
  442. continue
  443. ;;
  444.       -version-number)
  445. prev=vinfo
  446. vinfo_number=yes
  447. continue
  448. ;;
  449.       -weak)
  450.         prev=weak
  451. continue
  452. ;;
  453.       -Wc,*)
  454. func_stripname '-Wc,' '' "$arg"
  455. args=$func_stripname_result
  456. arg=
  457. save_ifs="$IFS"; IFS=','
  458. for flag in $args; do
  459.   IFS="$save_ifs"
  460.           func_quote_for_eval "$flag"
  461.   arg="$arg $wl$func_quote_for_eval_result"
  462.   compiler_flags="$compiler_flags $func_quote_for_eval_result"
  463. done
  464. IFS="$save_ifs"
  465. func_stripname ' ' '' "$arg"
  466. arg=$func_stripname_result
  467. ;;
  468.       -Wl,*)
  469. func_stripname '-Wl,' '' "$arg"
  470. args=$func_stripname_result
  471. arg=
  472. save_ifs="$IFS"; IFS=','
  473. for flag in $args; do
  474.   IFS="$save_ifs"
  475.           func_quote_for_eval "$flag"
  476.   arg="$arg $wl$func_quote_for_eval_result"
  477.   compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
  478.   linker_flags="$linker_flags $func_quote_for_eval_result"
  479. done
  480. IFS="$save_ifs"
  481. func_stripname ' ' '' "$arg"
  482. arg=$func_stripname_result
  483. ;;
  484.       -Xcompiler)
  485. prev=xcompiler
  486. continue
  487. ;;
  488.       -Xlinker)
  489. prev=xlinker
  490. continue
  491. ;;
  492.       -XCClinker)
  493. prev=xcclinker
  494. continue
  495. ;;
  496.       # -msg_* for osf cc
  497.       -msg_*)
  498. func_quote_for_eval "$arg"
  499. arg="$func_quote_for_eval_result"
  500. ;;
  501.       # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  502.       # -r[0-9][0-9]* specifies the processor on the SGI compiler
  503.       # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  504.       # +DA*, +DD* enable 64-bit mode on the HP compiler
  505.       # -q* pass through compiler args for the IBM compiler
  506.       # -m*, -t[45]*, -txscale* pass through architecture-specific
  507.       # compiler args for GCC
  508.       # -F/path gives path to uninstalled frameworks, gcc on darwin
  509.       # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  510.       # @file GCC response files
  511.       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| 
  512.       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  513.         func_quote_for_eval "$arg"
  514. arg="$func_quote_for_eval_result"
  515.         func_append compile_command " $arg"
  516.         func_append finalize_command " $arg"
  517.         compiler_flags="$compiler_flags $arg"
  518.         continue
  519.         ;;
  520.       # Some other compiler flag.
  521.       -* | +*)
  522.         func_quote_for_eval "$arg"
  523. arg="$func_quote_for_eval_result"
  524. ;;
  525.       *.$objext)
  526. # A standard object.
  527. objs="$objs $arg"
  528. ;;
  529.       *.lo)
  530. # A libtool-controlled object.
  531. # Check to see that this really is a libtool object.
  532. if func_lalib_unsafe_p "$arg"; then
  533.   pic_object=
  534.   non_pic_object=
  535.   # Read the .lo file
  536.   func_source "$arg"
  537.   if test -z "$pic_object" ||
  538.      test -z "$non_pic_object" ||
  539.      test "$pic_object" = none &&
  540.      test "$non_pic_object" = none; then
  541.     func_fatal_error "cannot find name of object for `$arg'"
  542.   fi
  543.   # Extract subdirectory from the argument.
  544.   func_dirname "$arg" "/" ""
  545.   xdir="$func_dirname_result"
  546.   if test "$pic_object" != none; then
  547.     # Prepend the subdirectory the object is found in.
  548.     pic_object="$xdir$pic_object"
  549.     if test "$prev" = dlfiles; then
  550.       if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  551. dlfiles="$dlfiles $pic_object"
  552. prev=
  553. continue
  554.       else
  555. # If libtool objects are unsupported, then we need to preload.
  556. prev=dlprefiles
  557.       fi
  558.     fi
  559.     # CHECK ME:  I think I busted this.  -Ossama
  560.     if test "$prev" = dlprefiles; then
  561.       # Preload the old-style object.
  562.       dlprefiles="$dlprefiles $pic_object"
  563.       prev=
  564.     fi
  565.     # A PIC object.
  566.     func_append libobjs " $pic_object"
  567.     arg="$pic_object"
  568.   fi
  569.   # Non-PIC object.
  570.   if test "$non_pic_object" != none; then
  571.     # Prepend the subdirectory the object is found in.
  572.     non_pic_object="$xdir$non_pic_object"
  573.     # A standard non-PIC object
  574.     func_append non_pic_objects " $non_pic_object"
  575.     if test -z "$pic_object" || test "$pic_object" = none ; then
  576.       arg="$non_pic_object"
  577.     fi
  578.   else
  579.     # If the PIC object exists, use it instead.
  580.     # $xdir was prepended to $pic_object above.
  581.     non_pic_object="$pic_object"
  582.     func_append non_pic_objects " $non_pic_object"
  583.   fi
  584. else
  585.   # Only an error if not doing a dry-run.
  586.   if $opt_dry_run; then
  587.     # Extract subdirectory from the argument.
  588.     func_dirname "$arg" "/" ""
  589.     xdir="$func_dirname_result"
  590.     func_lo2o "$arg"
  591.     pic_object=$xdir$objdir/$func_lo2o_result
  592.     non_pic_object=$xdir$func_lo2o_result
  593.     func_append libobjs " $pic_object"
  594.     func_append non_pic_objects " $non_pic_object"
  595.   else
  596.     func_fatal_error "`$arg' is not a valid libtool object"
  597.   fi
  598. fi
  599. ;;
  600.       *.$libext)
  601. # An archive.
  602. deplibs="$deplibs $arg"
  603. old_deplibs="$old_deplibs $arg"
  604. continue
  605. ;;
  606.       *.la)
  607. # A libtool-controlled library.
  608. if test "$prev" = dlfiles; then
  609.   # This library was specified with -dlopen.
  610.   dlfiles="$dlfiles $arg"
  611.   prev=
  612. elif test "$prev" = dlprefiles; then
  613.   # The library was specified with -dlpreopen.
  614.   dlprefiles="$dlprefiles $arg"
  615.   prev=
  616. else
  617.   deplibs="$deplibs $arg"
  618. fi
  619. continue
  620. ;;
  621.       # Some other compiler argument.
  622.       *)
  623. # Unknown arguments in both finalize_command and compile_command need
  624. # to be aesthetically quoted because they are evaled later.
  625. func_quote_for_eval "$arg"
  626. arg="$func_quote_for_eval_result"
  627. ;;
  628.       esac # arg
  629.       # Now actually substitute the argument into the commands.
  630.       if test -n "$arg"; then
  631. func_append compile_command " $arg"
  632. func_append finalize_command " $arg"
  633.       fi
  634.     done # argument parsing loop
  635.     test -n "$prev" && 
  636.       func_fatal_help "the `$prevarg' option requires an argument"
  637.     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  638.       eval arg="$export_dynamic_flag_spec"
  639.       func_append compile_command " $arg"
  640.       func_append finalize_command " $arg"
  641.     fi
  642.     oldlibs=
  643.     # calculate the name of the file, without its directory
  644.     func_basename "$output"
  645.     outputname="$func_basename_result"
  646.     libobjs_save="$libobjs"
  647.     if test -n "$shlibpath_var"; then
  648.       # get the directories listed in $shlibpath_var
  649.       eval shlib_search_path=`$ECHO "X${$shlibpath_var}" | $Xsed -e 's/:/ /g'`
  650.     else
  651.       shlib_search_path=
  652.     fi
  653.     eval sys_lib_search_path="$sys_lib_search_path_spec"
  654.     eval sys_lib_dlsearch_path="$sys_lib_dlsearch_path_spec"
  655.     func_dirname "$output" "/" ""
  656.     output_objdir="$func_dirname_result$objdir"
  657.     # Create the object directory.
  658.     func_mkdir_p "$output_objdir"
  659.     # Determine the type of output
  660.     case $output in
  661.     "")
  662.       func_fatal_help "you must specify an output file"
  663.       ;;
  664.     *.$libext) linkmode=oldlib ;;
  665.     *.lo | *.$objext) linkmode=obj ;;
  666.     *.la) linkmode=lib ;;
  667.     *) linkmode=prog ;; # Anything else should be a program.
  668.     esac
  669.     specialdeplibs=
  670.     libs=
  671.     # Find all interdependent deplibs by searching for libraries
  672.     # that are linked more than once (e.g. -la -lb -la)
  673.     for deplib in $deplibs; do
  674.       if $opt_duplicate_deps ; then
  675. case "$libs " in
  676. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  677. esac
  678.       fi
  679.       libs="$libs $deplib"
  680.     done
  681.     if test "$linkmode" = lib; then
  682.       libs="$predeps $libs $compiler_lib_search_path $postdeps"
  683.       # Compute libraries that are listed more than once in $predeps
  684.       # $postdeps and mark them as special (i.e., whose duplicates are
  685.       # not to be eliminated).
  686.       pre_post_deps=
  687.       if $opt_duplicate_compiler_generated_deps; then
  688. for pre_post_dep in $predeps $postdeps; do
  689.   case "$pre_post_deps " in
  690.   *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  691.   esac
  692.   pre_post_deps="$pre_post_deps $pre_post_dep"
  693. done
  694.       fi
  695.       pre_post_deps=
  696.     fi
  697.     deplibs=
  698.     newdependency_libs=
  699.     newlib_search_path=
  700.     need_relink=no # whether we're linking any uninstalled libtool libraries
  701.     notinst_deplibs= # not-installed libtool libraries
  702.     notinst_path= # paths that contain not-installed libtool libraries
  703.     case $linkmode in
  704.     lib)
  705. passes="conv dlpreopen link"
  706. for file in $dlfiles $dlprefiles; do
  707.   case $file in
  708.   *.la) ;;
  709.   *)
  710.     func_fatal_help "libraries can `-dlopen' only libtool libraries: $file"
  711.     ;;
  712.   esac
  713. done
  714. ;;
  715.     prog)
  716. compile_deplibs=
  717. finalize_deplibs=
  718. alldeplibs=no
  719. newdlfiles=
  720. newdlprefiles=
  721. passes="conv scan dlopen dlpreopen link"
  722. ;;
  723.     *)  passes="conv"
  724. ;;
  725.     esac
  726.     for pass in $passes; do
  727.       # The preopen pass in lib mode reverses $deplibs; put it back here
  728.       # so that -L comes before libs that need it for instance...
  729.       if test "$linkmode,$pass" = "lib,link"; then
  730. ## FIXME: Find the place where the list is rebuilt in the wrong
  731. ##        order, and fix it there properly
  732.         tmp_deplibs=
  733. for deplib in $deplibs; do
  734.   tmp_deplibs="$deplib $tmp_deplibs"
  735. done
  736. deplibs="$tmp_deplibs"
  737.       fi
  738.       if test "$linkmode,$pass" = "lib,link" ||
  739.  test "$linkmode,$pass" = "prog,scan"; then
  740. libs="$deplibs"
  741. deplibs=
  742.       fi
  743.       if test "$linkmode" = prog; then
  744. case $pass in
  745. dlopen) libs="$dlfiles" ;;
  746. dlpreopen) libs="$dlprefiles" ;;
  747. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  748. esac
  749.       fi
  750.       if test "$linkmode,$pass" = "lib,dlpreopen"; then
  751. # Collect and forward deplibs of preopened libtool libs
  752. for lib in $dlprefiles; do
  753.   # Ignore non-libtool-libs
  754.   dependency_libs=
  755.   case $lib in
  756.   *.la) func_source "$lib" ;;
  757.   esac
  758.   # Collect preopened libtool deplibs, except any this library
  759.   # has declared as weak libs
  760.   for deplib in $dependency_libs; do
  761.             deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
  762.     case " $weak_libs " in
  763.     *" $deplib_base "*) ;;
  764.     *) deplibs="$deplibs $deplib" ;;
  765.     esac
  766.   done
  767. done
  768. libs="$dlprefiles"
  769.       fi
  770.       if test "$pass" = dlopen; then
  771. # Collect dlpreopened libraries
  772. save_deplibs="$deplibs"
  773. deplibs=
  774.       fi
  775.       for deplib in $libs; do
  776. lib=
  777. found=no
  778. case $deplib in
  779. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  780.   if test "$linkmode,$pass" = "prog,link"; then
  781.     compile_deplibs="$deplib $compile_deplibs"
  782.     finalize_deplibs="$deplib $finalize_deplibs"
  783.   else
  784.     compiler_flags="$compiler_flags $deplib"
  785.     if test "$linkmode" = lib ; then
  786. case "$new_inherited_linker_flags " in
  787.     *" $deplib "*) ;;
  788.     * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  789. esac
  790.     fi
  791.   fi
  792.   continue
  793.   ;;
  794. -l*)
  795.   if test "$linkmode" != lib && test "$linkmode" != prog; then
  796.     func_warning "`-l' is ignored for archives/objects"
  797.     continue
  798.   fi
  799.   func_stripname '-l' '' "$deplib"
  800.   name=$func_stripname_result
  801.   if test "$linkmode" = lib; then
  802.     searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  803.   else
  804.     searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  805.   fi
  806.   for searchdir in $searchdirs; do
  807.     for search_ext in .la $std_shrext .so .a; do
  808.       # Search the libtool library
  809.       lib="$searchdir/lib${name}${search_ext}"
  810.       if test -f "$lib"; then
  811. if test "$search_ext" = ".la"; then
  812.   found=yes
  813. else
  814.   found=no
  815. fi
  816. break 2
  817.       fi
  818.     done
  819.   done
  820.   if test "$found" != yes; then
  821.     # deplib doesn't seem to be a libtool library
  822.     if test "$linkmode,$pass" = "prog,link"; then
  823.       compile_deplibs="$deplib $compile_deplibs"
  824.       finalize_deplibs="$deplib $finalize_deplibs"
  825.     else
  826.       deplibs="$deplib $deplibs"
  827.       test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  828.     fi
  829.     continue
  830.   else # deplib is a libtool library
  831.     # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  832.     # We need to do some special things here, and not later.
  833.     if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  834.       case " $predeps $postdeps " in
  835.       *" $deplib "*)
  836. if func_lalib_p "$lib"; then
  837.   library_names=
  838.   old_library=
  839.   func_source "$lib"
  840.   for l in $old_library $library_names; do
  841.     ll="$l"
  842.   done
  843.   if test "X$ll" = "X$old_library" ; then # only static version available
  844.     found=no
  845.     func_dirname "$lib" "" "."
  846.     ladir="$func_dirname_result"
  847.     lib=$ladir/$old_library
  848.     if test "$linkmode,$pass" = "prog,link"; then
  849.       compile_deplibs="$deplib $compile_deplibs"
  850.       finalize_deplibs="$deplib $finalize_deplibs"
  851.     else
  852.       deplibs="$deplib $deplibs"
  853.       test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  854.     fi
  855.     continue
  856.   fi
  857. fi
  858. ;;
  859.       *) ;;
  860.       esac
  861.     fi
  862.   fi
  863.   ;; # -l
  864. *.ltframework)
  865.   if test "$linkmode,$pass" = "prog,link"; then
  866.     compile_deplibs="$deplib $compile_deplibs"
  867.     finalize_deplibs="$deplib $finalize_deplibs"
  868.   else
  869.     deplibs="$deplib $deplibs"
  870.     if test "$linkmode" = lib ; then
  871. case "$new_inherited_linker_flags " in
  872.     *" $deplib "*) ;;
  873.     * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  874. esac
  875.     fi
  876.   fi
  877.   continue
  878.   ;;
  879. -L*)
  880.   case $linkmode in
  881.   lib)
  882.     deplibs="$deplib $deplibs"
  883.     test "$pass" = conv && continue
  884.     newdependency_libs="$deplib $newdependency_libs"
  885.     func_stripname '-L' '' "$deplib"
  886.     newlib_search_path="$newlib_search_path $func_stripname_result"
  887.     ;;
  888.   prog)
  889.     if test "$pass" = conv; then
  890.       deplibs="$deplib $deplibs"
  891.       continue
  892.     fi
  893.     if test "$pass" = scan; then
  894.       deplibs="$deplib $deplibs"
  895.     else
  896.       compile_deplibs="$deplib $compile_deplibs"
  897.       finalize_deplibs="$deplib $finalize_deplibs"
  898.     fi
  899.     func_stripname '-L' '' "$deplib"
  900.     newlib_search_path="$newlib_search_path $func_stripname_result"
  901.     ;;
  902.   *)
  903.     func_warning "`-L' is ignored for archives/objects"
  904.     ;;
  905.   esac # linkmode
  906.   continue
  907.   ;; # -L
  908. -R*)
  909.   if test "$pass" = link; then
  910.     func_stripname '-R' '' "$deplib"
  911.     dir=$func_stripname_result
  912.     # Make sure the xrpath contains only unique directories.
  913.     case "$xrpath " in
  914.     *" $dir "*) ;;
  915.     *) xrpath="$xrpath $dir" ;;
  916.     esac
  917.   fi
  918.   deplibs="$deplib $deplibs"
  919.   continue
  920.   ;;
  921. *.la) lib="$deplib" ;;
  922. *.$libext)
  923.   if test "$pass" = conv; then
  924.     deplibs="$deplib $deplibs"
  925.     continue
  926.   fi
  927.   case $linkmode in
  928.   lib)
  929.     # Linking convenience modules into shared libraries is allowed,
  930.     # but linking other static libraries is non-portable.
  931.     case " $dlpreconveniencelibs " in
  932.     *" $deplib "*) ;;
  933.     *)
  934.       valid_a_lib=no
  935.       case $deplibs_check_method in
  936. match_pattern*)
  937.   set dummy $deplibs_check_method; shift
  938.   match_pattern_regex=`expr "$deplibs_check_method" : "$1 (.*)"`
  939.   if eval "$ECHO "X$deplib"" 2>/dev/null | $Xsed -e 10q 
  940.     | $EGREP "$match_pattern_regex" > /dev/null; then
  941.     valid_a_lib=yes
  942.   fi
  943. ;;
  944. pass_all)
  945.   valid_a_lib=yes
  946. ;;
  947.       esac
  948.       if test "$valid_a_lib" != yes; then
  949. $ECHO
  950. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  951. $ECHO "*** I have the capability to make that library automatically link in when"
  952. $ECHO "*** you link to this library.  But I can only do this if you have a"
  953. $ECHO "*** shared version of the library, which you do not appear to have"
  954. $ECHO "*** because the file extensions .$libext of this argument makes me believe"
  955. $ECHO "*** that it is just a static archive that I should not use here."
  956.       else
  957. $ECHO
  958. $ECHO "*** Warning: Linking the shared library $output against the"
  959. $ECHO "*** static library $deplib is not portable!"
  960. deplibs="$deplib $deplibs"
  961.       fi
  962.       ;;
  963.     esac
  964.     continue
  965.     ;;
  966.   prog)
  967.     if test "$pass" != link; then
  968.       deplibs="$deplib $deplibs"
  969.     else
  970.       compile_deplibs="$deplib $compile_deplibs"
  971.       finalize_deplibs="$deplib $finalize_deplibs"
  972.     fi
  973.     continue
  974.     ;;
  975.   esac # linkmode
  976.   ;; # *.$libext
  977. *.lo | *.$objext)
  978.   if test "$pass" = conv; then
  979.     deplibs="$deplib $deplibs"
  980.   elif test "$linkmode" = prog; then
  981.     if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  982.       # If there is no dlopen support or we're linking statically,
  983.       # we need to preload.
  984.       newdlprefiles="$newdlprefiles $deplib"
  985.       compile_deplibs="$deplib $compile_deplibs"
  986.       finalize_deplibs="$deplib $finalize_deplibs"
  987.     else
  988.       newdlfiles="$newdlfiles $deplib"
  989.     fi
  990.   fi
  991.   continue
  992.   ;;
  993. %DEPLIBS%)
  994.   alldeplibs=yes
  995.   continue
  996.   ;;
  997. esac # case $deplib
  998. if test "$found" = yes || test -f "$lib"; then :
  999. else
  1000.   func_fatal_error "cannot find the library `$lib' or unhandled argument `$deplib'"
  1001. fi
  1002. # Check to see that this really is a libtool archive.
  1003. func_lalib_unsafe_p "$lib" 
  1004.   || func_fatal_error "`$lib' is not a valid libtool archive"
  1005. func_dirname "$lib" "" "."
  1006. ladir="$func_dirname_result"
  1007. dlname=
  1008. dlopen=
  1009. dlpreopen=
  1010. libdir=
  1011. library_names=
  1012. old_library=
  1013. inherited_linker_flags=
  1014. # If the library was installed with an old release of libtool,
  1015. # it will not redefine variables installed, or shouldnotlink
  1016. installed=yes
  1017. shouldnotlink=no
  1018. avoidtemprpath=
  1019. # Read the .la file
  1020. func_source "$lib"
  1021. # Convert "-framework foo" to "foo.ltframework"
  1022. if test -n "$inherited_linker_flags"; then
  1023.   tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework ([^ $]*)/1.ltframework/g'`
  1024.   for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  1025.     case " $new_inherited_linker_flags " in
  1026.       *" $tmp_inherited_linker_flag "*) ;;
  1027.       *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
  1028.     esac
  1029.   done
  1030. fi
  1031. dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  1032. if test "$linkmode,$pass" = "lib,link" ||
  1033.    test "$linkmode,$pass" = "prog,scan" ||
  1034.    { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  1035.   test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1036.   test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1037. fi
  1038. if test "$pass" = conv; then
  1039.   # Only check for convenience libraries
  1040.   deplibs="$lib $deplibs"
  1041.   if test -z "$libdir"; then
  1042.     if test -z "$old_library"; then
  1043.       func_fatal_error "cannot find name of link library for `$lib'"
  1044.     fi
  1045.     # It is a libtool convenience library, so add in its objects.
  1046.     convenience="$convenience $ladir/$objdir/$old_library"
  1047.     old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1048.   elif test "$linkmode" != prog && test "$linkmode" != lib; then
  1049.     func_fatal_error "`$lib' is not a convenience library"
  1050.   fi
  1051.   tmp_libs=
  1052.   for deplib in $dependency_libs; do
  1053.     deplibs="$deplib $deplibs"
  1054.     if $opt_duplicate_deps ; then
  1055.       case "$tmp_libs " in
  1056.       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1057.       esac
  1058.     fi
  1059.     tmp_libs="$tmp_libs $deplib"
  1060.   done
  1061.   continue
  1062. fi # $pass = conv
  1063. # Get the name of the library we link against.
  1064. linklib=
  1065. for l in $old_library $library_names; do
  1066.   linklib="$l"
  1067. done
  1068. if test -z "$linklib"; then
  1069.   func_fatal_error "cannot find name of link library for `$lib'"
  1070. fi
  1071. # This library was specified with -dlopen.
  1072. if test "$pass" = dlopen; then
  1073.   if test -z "$libdir"; then
  1074.     func_fatal_error "cannot -dlopen a convenience library: `$lib'"
  1075.   fi
  1076.   if test -z "$dlname" ||
  1077.      test "$dlopen_support" != yes ||
  1078.      test "$build_libtool_libs" = no; then
  1079.     # If there is no dlname, no dlopen support or we're linking
  1080.     # statically, we need to preload.  We also need to preload any
  1081.     # dependent libraries so libltdl's deplib preloader doesn't
  1082.     # bomb out in the load deplibs phase.
  1083.     dlprefiles="$dlprefiles $lib $dependency_libs"
  1084.   else
  1085.     newdlfiles="$newdlfiles $lib"
  1086.   fi
  1087.   continue
  1088. fi # $pass = dlopen
  1089. # We need an absolute path.
  1090. case $ladir in
  1091. [\/]* | [A-Za-z]:[\/]*) abs_ladir="$ladir" ;;
  1092. *)
  1093.   abs_ladir=`cd "$ladir" && pwd`
  1094.   if test -z "$abs_ladir"; then
  1095.     func_warning "cannot determine absolute directory name of `$ladir'"
  1096.     func_warning "passing it literally to the linker, although it might fail"
  1097.     abs_ladir="$ladir"
  1098.   fi
  1099.   ;;
  1100. esac
  1101. func_basename "$lib"
  1102. laname="$func_basename_result"
  1103. # Find the relevant object directory and library name.
  1104. if test "X$installed" = Xyes; then
  1105.   if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1106.     func_warning "library `$lib' was moved."
  1107.     dir="$ladir"
  1108.     absdir="$abs_ladir"
  1109.     libdir="$abs_ladir"
  1110.   else
  1111.     dir="$libdir"
  1112.     absdir="$libdir"
  1113.   fi
  1114.   test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  1115. else
  1116.   if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1117.     dir="$ladir"
  1118.     absdir="$abs_ladir"
  1119.     # Remove this search path later
  1120.     notinst_path="$notinst_path $abs_ladir"
  1121.   else
  1122.     dir="$ladir/$objdir"
  1123.     absdir="$abs_ladir/$objdir"
  1124.     # Remove this search path later
  1125.     notinst_path="$notinst_path $abs_ladir"
  1126.   fi
  1127. fi # $installed = yes
  1128. func_stripname 'lib' '.la' "$laname"
  1129. name=$func_stripname_result
  1130. # This library was specified with -dlpreopen.
  1131. if test "$pass" = dlpreopen; then
  1132.   if test -z "$libdir" && test "$linkmode" = prog; then
  1133.     func_fatal_error "only libraries may -dlpreopen a convenience library: `$lib'"
  1134.   fi
  1135.   # Prefer using a static library (so that no silly _DYNAMIC symbols
  1136.   # are required to link).
  1137.   if test -n "$old_library"; then
  1138.     newdlprefiles="$newdlprefiles $dir/$old_library"
  1139.     # Keep a list of preopened convenience libraries to check
  1140.     # that they are being used correctly in the link pass.
  1141.     test -z "$libdir" && 
  1142. dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
  1143.   # Otherwise, use the dlname, so that lt_dlopen finds it.
  1144.   elif test -n "$dlname"; then
  1145.     newdlprefiles="$newdlprefiles $dir/$dlname"
  1146.   else
  1147.     newdlprefiles="$newdlprefiles $dir/$linklib"
  1148.   fi
  1149. fi # $pass = dlpreopen
  1150. if test -z "$libdir"; then
  1151.   # Link the convenience library
  1152.   if test "$linkmode" = lib; then
  1153.     deplibs="$dir/$old_library $deplibs"
  1154.   elif test "$linkmode,$pass" = "prog,link"; then
  1155.     compile_deplibs="$dir/$old_library $compile_deplibs"
  1156.     finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1157.   else
  1158.     deplibs="$lib $deplibs" # used for prog,scan pass
  1159.   fi
  1160.   continue
  1161. fi
  1162. if test "$linkmode" = prog && test "$pass" != link; then
  1163.   newlib_search_path="$newlib_search_path $ladir"
  1164.   deplibs="$lib $deplibs"
  1165.   linkalldeplibs=no
  1166.   if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1167.      test "$build_libtool_libs" = no; then
  1168.     linkalldeplibs=yes
  1169.   fi
  1170.   tmp_libs=
  1171.   for deplib in $dependency_libs; do
  1172.     case $deplib in
  1173.     -L*) func_stripname '-L' '' "$deplib"
  1174.          newlib_search_path="$newlib_search_path $func_stripname_result"
  1175.  ;;
  1176.     esac
  1177.     # Need to link against all dependency_libs?
  1178.     if test "$linkalldeplibs" = yes; then
  1179.       deplibs="$deplib $deplibs"
  1180.     else
  1181.       # Need to hardcode shared library paths
  1182.       # or/and link against static libraries
  1183.       newdependency_libs="$deplib $newdependency_libs"
  1184.     fi
  1185.     if $opt_duplicate_deps ; then
  1186.       case "$tmp_libs " in
  1187.       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1188.       esac
  1189.     fi
  1190.     tmp_libs="$tmp_libs $deplib"
  1191.   done # for deplib
  1192.   continue
  1193. fi # $linkmode = prog...
  1194. if test "$linkmode,$pass" = "prog,link"; then
  1195.   if test -n "$library_names" &&
  1196.      { { test "$prefer_static_libs" = no ||
  1197.          test "$prefer_static_libs,$installed" = "built,yes"; } ||
  1198.        test -z "$old_library"; }; then
  1199.     # We need to hardcode the library path
  1200.     if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  1201.       # Make sure the rpath contains only unique directories.
  1202.       case "$temp_rpath:" in
  1203.       *"$absdir:"*) ;;
  1204.       *) temp_rpath="$temp_rpath$absdir:" ;;
  1205.       esac
  1206.     fi
  1207.     # Hardcode the library path.
  1208.     # Skip directories that are in the system default run-time
  1209.     # search path.
  1210.     case " $sys_lib_dlsearch_path " in
  1211.     *" $absdir "*) ;;
  1212.     *)
  1213.       case "$compile_rpath " in
  1214.       *" $absdir "*) ;;
  1215.       *) compile_rpath="$compile_rpath $absdir"
  1216.       esac
  1217.       ;;
  1218.     esac
  1219.     case " $sys_lib_dlsearch_path " in
  1220.     *" $libdir "*) ;;
  1221.     *)
  1222.       case "$finalize_rpath " in
  1223.       *" $libdir "*) ;;
  1224.       *) finalize_rpath="$finalize_rpath $libdir"
  1225.       esac
  1226.       ;;
  1227.     esac
  1228.   fi # $linkmode,$pass = prog,link...
  1229.   if test "$alldeplibs" = yes &&
  1230.      { test "$deplibs_check_method" = pass_all ||
  1231.        { test "$build_libtool_libs" = yes &&
  1232.  test -n "$library_names"; }; }; then
  1233.     # We only need to search for static libraries
  1234.     continue
  1235.   fi
  1236. fi
  1237. link_static=no # Whether the deplib will be linked statically
  1238. use_static_libs=$prefer_static_libs
  1239. if test "$use_static_libs" = built && test "$installed" = yes; then
  1240.   use_static_libs=no
  1241. fi
  1242. if test -n "$library_names" &&
  1243.    { test "$use_static_libs" = no || test -z "$old_library"; }; then
  1244.   case $host in
  1245.   *cygwin* | *mingw* | *cegcc*)
  1246.       # No point in relinking DLLs because paths are not encoded
  1247.       notinst_deplibs="$notinst_deplibs $lib"
  1248.       need_relink=no
  1249.     ;;
  1250.   *)
  1251.     if test "$installed" = no; then
  1252.       notinst_deplibs="$notinst_deplibs $lib"
  1253.       need_relink=yes
  1254.     fi
  1255.     ;;
  1256.   esac
  1257.   # This is a shared library
  1258.   # Warn about portability, can't link against -module's on some
  1259.   # systems (darwin).  Don't bleat about dlopened modules though!
  1260.   dlopenmodule=""
  1261.   for dlpremoduletest in $dlprefiles; do
  1262.     if test "X$dlpremoduletest" = "X$lib"; then
  1263.       dlopenmodule="$dlpremoduletest"
  1264.       break
  1265.     fi
  1266.   done
  1267.   if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  1268.     $ECHO
  1269.     if test "$linkmode" = prog; then
  1270.       $ECHO "*** Warning: Linking the executable $output against the loadable module"
  1271.     else
  1272.       $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  1273.     fi
  1274.     $ECHO "*** $linklib is not portable!"
  1275.   fi
  1276.   if test "$linkmode" = lib &&
  1277.      test "$hardcode_into_libs" = yes; then
  1278.     # Hardcode the library path.
  1279.     # Skip directories that are in the system default run-time
  1280.     # search path.
  1281.     case " $sys_lib_dlsearch_path " in
  1282.     *" $absdir "*) ;;
  1283.     *)
  1284.       case "$compile_rpath " in
  1285.       *" $absdir "*) ;;
  1286.       *) compile_rpath="$compile_rpath $absdir"
  1287.       esac
  1288.       ;;
  1289.     esac
  1290.     case " $sys_lib_dlsearch_path " in
  1291.     *" $libdir "*) ;;
  1292.     *)
  1293.       case "$finalize_rpath " in
  1294.       *" $libdir "*) ;;
  1295.       *) finalize_rpath="$finalize_rpath $libdir"
  1296.       esac
  1297.       ;;
  1298.     esac
  1299.   fi
  1300.   if test -n "$old_archive_from_expsyms_cmds"; then
  1301.     # figure out the soname
  1302.     set dummy $library_names
  1303.     shift
  1304.     realname="$1"
  1305.     shift
  1306.     libname=`eval "\$ECHO "$libname_spec""`
  1307.     # use dlname if we got it. it's perfectly good, no?
  1308.     if test -n "$dlname"; then
  1309.       soname="$dlname"
  1310.     elif test -n "$soname_spec"; then
  1311.       # bleh windows
  1312.       case $host in
  1313.       *cygwin* | mingw* | *cegcc*)
  1314.         func_arith $current - $age
  1315. major=$func_arith_result
  1316. versuffix="-$major"
  1317. ;;
  1318.       esac
  1319.       eval soname="$soname_spec"
  1320.     else
  1321.       soname="$realname"
  1322.     fi
  1323.     # Make a new name for the extract_expsyms_cmds to use
  1324.     soroot="$soname"
  1325.     func_basename "$soroot"
  1326.     soname="$func_basename_result"
  1327.     func_stripname 'lib' '.dll' "$soname"
  1328.     newlib=libimp-$func_stripname_result.a
  1329.     # If the library has no export list, then create one now
  1330.     if test -f "$output_objdir/$soname-def"; then :
  1331.     else
  1332.       func_verbose "extracting exported symbol list from `$soname'"
  1333.       func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  1334.     fi
  1335.     # Create $newlib
  1336.     if test -f "$output_objdir/$newlib"; then :; else
  1337.       func_verbose "generating import library for `$soname'"
  1338.       func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  1339.     fi
  1340.     # make sure the library variables are pointing to the new library
  1341.     dir=$output_objdir
  1342.     linklib=$newlib
  1343.   fi # test -n "$old_archive_from_expsyms_cmds"
  1344.   if test "$linkmode" = prog || test "$mode" != relink; then
  1345.     add_shlibpath=
  1346.     add_dir=
  1347.     add=
  1348.     lib_linked=yes
  1349.     case $hardcode_action in
  1350.     immediate | unsupported)
  1351.       if test "$hardcode_direct" = no; then
  1352. add="$dir/$linklib"
  1353. case $host in
  1354.   *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  1355.   *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  1356.   *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | 
  1357.     *-*-unixware7*) add_dir="-L$dir" ;;
  1358.   *-*-darwin* )
  1359.     # if the lib is a (non-dlopened) module then we can not
  1360.     # link against it, someone is ignoring the earlier warnings
  1361.     if /usr/bin/file -L $add 2> /dev/null |
  1362.  $GREP ": [^:]* bundle" >/dev/null ; then
  1363.       if test "X$dlopenmodule" != "X$lib"; then
  1364. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  1365. if test -z "$old_library" ; then
  1366.   $ECHO
  1367.   $ECHO "*** And there doesn't seem to be a static archive available"
  1368.   $ECHO "*** The link will probably fail, sorry"
  1369. else
  1370.   add="$dir/$old_library"
  1371. fi
  1372.       elif test -n "$old_library"; then
  1373. add="$dir/$old_library"
  1374.       fi
  1375.     fi
  1376. esac
  1377.       elif test "$hardcode_minus_L" = no; then
  1378. case $host in
  1379. *-*-sunos*) add_shlibpath="$dir" ;;
  1380. esac
  1381. add_dir="-L$dir"
  1382. add="-l$name"
  1383.       elif test "$hardcode_shlibpath_var" = no; then
  1384. add_shlibpath="$dir"
  1385. add="-l$name"
  1386.       else
  1387. lib_linked=no
  1388.       fi
  1389.       ;;
  1390.     relink)
  1391.       if test "$hardcode_direct" = yes &&
  1392.          test "$hardcode_direct_absolute" = no; then
  1393. add="$dir/$linklib"
  1394.       elif test "$hardcode_minus_L" = yes; then
  1395. add_dir="-L$dir"
  1396. # Try looking first in the location we're being installed to.
  1397. if test -n "$inst_prefix_dir"; then
  1398.   case $libdir in
  1399.     [\/]*)
  1400.       add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1401.       ;;
  1402.   esac
  1403. fi
  1404. add="-l$name"
  1405.       elif test "$hardcode_shlibpath_var" = yes; then
  1406. add_shlibpath="$dir"
  1407. add="-l$name"
  1408.       else
  1409. lib_linked=no
  1410.       fi
  1411.       ;;
  1412.     *) lib_linked=no ;;
  1413.     esac
  1414.     if test "$lib_linked" != yes; then
  1415.       func_fatal_configuration "unsupported hardcode properties"
  1416.     fi
  1417.     if test -n "$add_shlibpath"; then
  1418.       case :$compile_shlibpath: in
  1419.       *":$add_shlibpath:"*) ;;
  1420.       *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1421.       esac
  1422.     fi
  1423.     if test "$linkmode" = prog; then
  1424.       test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  1425.       test -n "$add" && compile_deplibs="$add $compile_deplibs"
  1426.     else
  1427.       test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1428.       test -n "$add" && deplibs="$add $deplibs"
  1429.       if test "$hardcode_direct" != yes &&
  1430.  test "$hardcode_minus_L" != yes &&
  1431.  test "$hardcode_shlibpath_var" = yes; then
  1432. case :$finalize_shlibpath: in
  1433. *":$libdir:"*) ;;
  1434. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1435. esac
  1436.       fi
  1437.     fi
  1438.   fi
  1439.   if test "$linkmode" = prog || test "$mode" = relink; then
  1440.     add_shlibpath=
  1441.     add_dir=
  1442.     add=
  1443.     # Finalize command for both is simple: just hardcode it.
  1444.     if test "$hardcode_direct" = yes &&
  1445.        test "$hardcode_direct_absolute" = no; then
  1446.       add="$libdir/$linklib"
  1447.     elif test "$hardcode_minus_L" = yes; then
  1448.       add_dir="-L$libdir"
  1449.       add="-l$name"
  1450.     elif test "$hardcode_shlibpath_var" = yes; then
  1451.       case :$finalize_shlibpath: in
  1452.       *":$libdir:"*) ;;
  1453.       *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1454.       esac
  1455.       add="-l$name"
  1456.     elif test "$hardcode_automatic" = yes; then
  1457.       if test -n "$inst_prefix_dir" &&
  1458.  test -f "$inst_prefix_dir$libdir/$linklib" ; then
  1459. add="$inst_prefix_dir$libdir/$linklib"
  1460.       else
  1461. add="$libdir/$linklib"
  1462.       fi
  1463.     else
  1464.       # We cannot seem to hardcode it, guess we'll fake it.
  1465.       add_dir="-L$libdir"
  1466.       # Try looking first in the location we're being installed to.
  1467.       if test -n "$inst_prefix_dir"; then
  1468. case $libdir in
  1469.   [\/]*)
  1470.     add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1471.     ;;
  1472. esac
  1473.       fi
  1474.       add="-l$name"
  1475.     fi
  1476.     if test "$linkmode" = prog; then
  1477.       test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  1478.       test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  1479.     else
  1480.       test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1481.       test -n "$add" && deplibs="$add $deplibs"
  1482.     fi
  1483.   fi
  1484. elif test "$linkmode" = prog; then
  1485.   # Here we assume that one of hardcode_direct or hardcode_minus_L
  1486.   # is not unsupported.  This is valid on all known static and
  1487.   # shared platforms.
  1488.   if test "$hardcode_direct" != unsupported; then
  1489.     test -n "$old_library" && linklib="$old_library"
  1490.     compile_deplibs="$dir/$linklib $compile_deplibs"
  1491.     finalize_deplibs="$dir/$linklib $finalize_deplibs"
  1492.   else
  1493.     compile_deplibs="-l$name -L$dir $compile_deplibs"
  1494.     finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  1495.   fi
  1496. elif test "$build_libtool_libs" = yes; then
  1497.   # Not a shared library
  1498.   if test "$deplibs_check_method" != pass_all; then
  1499.     # We're trying link a shared library against a static one
  1500.     # but the system doesn't support it.
  1501.     # Just print a warning and add the library to dependency_libs so
  1502.     # that the program can be linked against the static library.
  1503.     $ECHO
  1504.     $ECHO "*** Warning: This system can not link to static lib archive $lib."
  1505.     $ECHO "*** I have the capability to make that library automatically link in when"
  1506.     $ECHO "*** you link to this library.  But I can only do this if you have a"
  1507.     $ECHO "*** shared version of the library, which you do not appear to have."
  1508.     if test "$module" = yes; then
  1509.       $ECHO "*** But as you try to build a module library, libtool will still create "
  1510.       $ECHO "*** a static module, that should work as long as the dlopening application"
  1511.       $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
  1512.       if test -z "$global_symbol_pipe"; then
  1513. $ECHO
  1514. $ECHO "*** However, this would only work if libtool was able to extract symbol"
  1515. $ECHO "*** lists from a program, using `nm' or equivalent, but libtool could"
  1516. $ECHO "*** not find such a program.  So, this module is probably useless."
  1517. $ECHO "*** `nm' from GNU binutils and a full rebuild may help."
  1518.       fi
  1519.       if test "$build_old_libs" = no; then
  1520. build_libtool_libs=module
  1521. build_old_libs=yes
  1522.       else
  1523. build_libtool_libs=no
  1524.       fi
  1525.     fi
  1526.   else
  1527.     deplibs="$dir/$old_library $deplibs"
  1528.     link_static=yes
  1529.   fi
  1530. fi # link shared/static library?
  1531. if test "$linkmode" = lib; then
  1532.   if test -n "$dependency_libs" &&
  1533.      { test "$hardcode_into_libs" != yes ||
  1534.        test "$build_old_libs" = yes ||
  1535.        test "$link_static" = yes; }; then
  1536.     # Extract -R from dependency_libs
  1537.     temp_deplibs=
  1538.     for libdir in $dependency_libs; do
  1539.       case $libdir in
  1540.       -R*) func_stripname '-R' '' "$libdir"
  1541.            temp_xrpath=$func_stripname_result
  1542.    case " $xrpath " in
  1543.    *" $temp_xrpath "*) ;;
  1544.    *) xrpath="$xrpath $temp_xrpath";;
  1545.    esac;;
  1546.       *) temp_deplibs="$temp_deplibs $libdir";;
  1547.       esac
  1548.     done
  1549.     dependency_libs="$temp_deplibs"
  1550.   fi
  1551.   newlib_search_path="$newlib_search_path $absdir"
  1552.   # Link against this library
  1553.   test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  1554.   # ... and its dependency_libs
  1555.   tmp_libs=
  1556.   for deplib in $dependency_libs; do
  1557.     newdependency_libs="$deplib $newdependency_libs"
  1558.     if $opt_duplicate_deps ; then
  1559.       case "$tmp_libs " in
  1560.       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1561.       esac
  1562.     fi
  1563.     tmp_libs="$tmp_libs $deplib"
  1564.   done
  1565.   if test "$link_all_deplibs" != no; then
  1566.     # Add the search paths of all dependency libraries
  1567.     for deplib in $dependency_libs; do
  1568.       case $deplib in
  1569.       -L*) path="$deplib" ;;
  1570.       *.la)
  1571.         func_dirname "$deplib" "" "."
  1572. dir="$func_dirname_result"
  1573. # We need an absolute path.
  1574. case $dir in
  1575. [\/]* | [A-Za-z]:[\/]*) absdir="$dir" ;;
  1576. *)
  1577.   absdir=`cd "$dir" && pwd`
  1578.   if test -z "$absdir"; then
  1579.     func_warning "cannot determine absolute directory name of `$dir'"
  1580.     absdir="$dir"
  1581.   fi
  1582.   ;;
  1583. esac
  1584. if $GREP "^installed=no" $deplib > /dev/null; then
  1585. case $host in
  1586. *-*-darwin*)
  1587.   depdepl=
  1588.   eval deplibrary_names=`${SED} -n -e 's/^library_names=(.*)$/1/p' $deplib`
  1589.   if test -n "$deplibrary_names" ; then
  1590.     for tmp in $deplibrary_names ; do
  1591.       depdepl=$tmp
  1592.     done
  1593.     if test -f "$absdir/$objdir/$depdepl" ; then
  1594.       depdepl="$absdir/$objdir/$depdepl"
  1595.       darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  1596.                       if test -z "$darwin_install_name"; then
  1597.                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
  1598.                       fi
  1599.       compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  1600.       linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
  1601.       path=
  1602.     fi
  1603.   fi
  1604.   ;;
  1605. *)
  1606.   path="-L$absdir/$objdir"
  1607.   ;;
  1608. esac
  1609. else
  1610.   eval libdir=`${SED} -n -e 's/^libdir=(.*)$/1/p' $deplib`
  1611.   test -z "$libdir" && 
  1612.     func_fatal_error "`$deplib' is not a valid libtool archive"
  1613.   test "$absdir" != "$libdir" && 
  1614.     func_warning "`$deplib' seems to be moved"
  1615.   path="-L$absdir"
  1616. fi
  1617. ;;
  1618.       esac
  1619.       case " $deplibs " in
  1620.       *" $path "*) ;;
  1621.       *) deplibs="$path $deplibs" ;;
  1622.       esac
  1623.     done
  1624.   fi # link_all_deplibs != no
  1625. fi # linkmode = lib
  1626.       done # for deplib in $libs
  1627.       if test "$pass" = link; then
  1628. if test "$linkmode" = "prog"; then
  1629.   compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  1630.   finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  1631. else
  1632.   compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  1633. fi
  1634.       fi
  1635.       dependency_libs="$newdependency_libs"
  1636.       if test "$pass" = dlpreopen; then
  1637. # Link the dlpreopened libraries before other libraries
  1638. for deplib in $save_deplibs; do
  1639.   deplibs="$deplib $deplibs"
  1640. done
  1641.       fi
  1642.       if test "$pass" != dlopen; then
  1643. if test "$pass" != conv; then
  1644.   # Make sure lib_search_path contains only unique directories.
  1645.   lib_search_path=
  1646.   for dir in $newlib_search_path; do
  1647.     case "$lib_search_path " in
  1648.     *" $dir "*) ;;
  1649.     *) lib_search_path="$lib_search_path $dir" ;;
  1650.     esac
  1651.   done
  1652.   newlib_search_path=
  1653. fi
  1654. if test "$linkmode,$pass" != "prog,link"; then
  1655.   vars="deplibs"
  1656. else
  1657.   vars="compile_deplibs finalize_deplibs"
  1658. fi
  1659. for var in $vars dependency_libs; do
  1660.   # Add libraries to $var in reverse order
  1661.   eval tmp_libs="$$var"
  1662.   new_libs=
  1663.   for deplib in $tmp_libs; do
  1664.     # FIXME: Pedantically, this is the right thing to do, so
  1665.     #        that some nasty dependency loop isn't accidentally
  1666.     #        broken:
  1667.     #new_libs="$deplib $new_libs"
  1668.     # Pragmatically, this seems to cause very few problems in
  1669.     # practice:
  1670.     case $deplib in
  1671.     -L*) new_libs="$deplib $new_libs" ;;
  1672.     -R*) ;;
  1673.     *)
  1674.       # And here is the reason: when a library appears more
  1675.       # than once as an explicit dependence of a library, or
  1676.       # is implicitly linked in more than once by the
  1677.       # compiler, it is considered special, and multiple
  1678.       # occurrences thereof are not removed.  Compare this
  1679.       # with having the same library being listed as a
  1680.       # dependency of multiple other libraries: in this case,
  1681.       # we know (pedantically, we assume) the library does not
  1682.       # need to be listed more than once, so we keep only the
  1683.       # last copy.  This is not always right, but it is rare
  1684.       # enough that we require users that really mean to play
  1685.       # such unportable linking tricks to link the library
  1686.       # using -Wl,-lname, so that libtool does not consider it
  1687.       # for duplicate removal.
  1688.       case " $specialdeplibs " in
  1689.       *" $deplib "*) new_libs="$deplib $new_libs" ;;
  1690.       *)
  1691. case " $new_libs " in
  1692. *" $deplib "*) ;;
  1693. *) new_libs="$deplib $new_libs" ;;
  1694. esac
  1695. ;;
  1696.       esac
  1697.       ;;
  1698.     esac
  1699.   done
  1700.   tmp_libs=
  1701.   for deplib in $new_libs; do
  1702.     case $deplib in
  1703.     -L*)
  1704.       case " $tmp_libs " in
  1705.       *" $deplib "*) ;;
  1706.       *) tmp_libs="$tmp_libs $deplib" ;;
  1707.       esac
  1708.       ;;
  1709.     *) tmp_libs="$tmp_libs $deplib" ;;
  1710.     esac
  1711.   done
  1712.   eval $var="$tmp_libs"
  1713. done # for var
  1714.       fi
  1715.       # Last step: remove runtime libs from dependency_libs
  1716.       # (they stay in deplibs)
  1717.       tmp_libs=
  1718.       for i in $dependency_libs ; do
  1719. case " $predeps $postdeps $compiler_lib_search_path " in
  1720. *" $i "*)
  1721.   i=""
  1722.   ;;
  1723. esac
  1724. if test -n "$i" ; then
  1725.   tmp_libs="$tmp_libs $i"
  1726. fi
  1727.       done
  1728.       dependency_libs=$tmp_libs
  1729.     done # for pass
  1730.     if test "$linkmode" = prog; then
  1731.       dlfiles="$newdlfiles"
  1732.     fi
  1733.     if test "$linkmode" = prog || test "$linkmode" = lib; then
  1734.       dlprefiles="$newdlprefiles"
  1735.     fi
  1736.     case $linkmode in
  1737.     oldlib)
  1738.       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1739. func_warning "`-dlopen' is ignored for archives"
  1740.       fi
  1741.       case " $deplibs" in
  1742.       * -l* | * -L*)
  1743. func_warning "`-l' and `-L' are ignored for archives" ;;
  1744.       esac
  1745.       test -n "$rpath" && 
  1746. func_warning "`-rpath' is ignored for archives"
  1747.       test -n "$xrpath" && 
  1748. func_warning "`-R' is ignored for archives"
  1749.       test -n "$vinfo" && 
  1750. func_warning "`-version-info/-version-number' is ignored for archives"
  1751.       test -n "$release" && 
  1752. func_warning "`-release' is ignored for archives"
  1753.       test -n "$export_symbols$export_symbols_regex" && 
  1754. func_warning "`-export-symbols' is ignored for archives"
  1755.       # Now set the variables for building old libraries.
  1756.       build_libtool_libs=no
  1757.       oldlibs="$output"
  1758.       objs="$objs$old_deplibs"
  1759.       ;;
  1760.     lib)
  1761.       # Make sure we only generate libraries of the form `libNAME.la'.
  1762.       case $outputname in
  1763.       lib*)
  1764. func_stripname 'lib' '.la' "$outputname"
  1765. name=$func_stripname_result
  1766. eval shared_ext="$shrext_cmds"
  1767. eval libname="$libname_spec"
  1768. ;;
  1769.       *)
  1770. test "$module" = no && 
  1771.   func_fatal_help "libtool library `$output' must begin with `lib'"
  1772. if test "$need_lib_prefix" != no; then
  1773.   # Add the "lib" prefix for modules if required
  1774.   func_stripname '' '.la' "$outputname"
  1775.   name=$func_stripname_result
  1776.   eval shared_ext="$shrext_cmds"
  1777.   eval libname="$libname_spec"
  1778. else
  1779.   func_stripname '' '.la' "$outputname"
  1780.   libname=$func_stripname_result
  1781. fi
  1782. ;;
  1783.       esac
  1784.       if test -n "$objs"; then
  1785. if test "$deplibs_check_method" != pass_all; then
  1786.   func_fatal_error "cannot build libtool library `$output' from non-libtool objects on this host:$objs"
  1787. else
  1788.   $ECHO
  1789.   $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  1790.   $ECHO "*** objects $objs is not portable!"
  1791.   libobjs="$libobjs $objs"
  1792. fi
  1793.       fi
  1794.       test "$dlself" != no && 
  1795. func_warning "`-dlopen self' is ignored for libtool libraries"
  1796.       set dummy $rpath
  1797.       shift
  1798.       test "$#" -gt 1 && 
  1799. func_warning "ignoring multiple `-rpath's for a libtool library"
  1800.       install_libdir="$1"
  1801.       oldlibs=
  1802.       if test -z "$rpath"; then
  1803. if test "$build_libtool_libs" = yes; then
  1804.   # Building a libtool convenience library.
  1805.   # Some compilers have problems with a `.al' extension so
  1806.   # convenience libraries should have the same extension an
  1807.   # archive normally would.
  1808.   oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1809.   build_libtool_libs=convenience
  1810.   build_old_libs=yes
  1811. fi
  1812. test -n "$vinfo" && 
  1813.   func_warning "`-version-info/-version-number' is ignored for convenience libraries"
  1814. test -n "$release" && 
  1815.   func_warning "`-release' is ignored for convenience libraries"
  1816.       else
  1817. # Parse the version information argument.
  1818. save_ifs="$IFS"; IFS=':'
  1819. set dummy $vinfo 0 0 0
  1820. shift
  1821. IFS="$save_ifs"
  1822. test -n "$7" && 
  1823.   func_fatal_help "too many parameters to `-version-info'"
  1824. # convert absolute version numbers to libtool ages
  1825. # this retains compatibility with .la files and attempts
  1826. # to make the code below a bit more comprehensible
  1827. case $vinfo_number in
  1828. yes)
  1829.   number_major="$1"
  1830.   number_minor="$2"
  1831.   number_revision="$3"
  1832.   #
  1833.   # There are really only two kinds -- those that
  1834.   # use the current revision as the major version
  1835.   # and those that subtract age and use age as
  1836.   # a minor version.  But, then there is irix
  1837.   # which has an extra 1 added just for fun
  1838.   #
  1839.   case $version_type in
  1840.   darwin|linux|osf|windows|none)
  1841.     func_arith $number_major + $number_minor
  1842.     current=$func_arith_result
  1843.     age="$number_minor"
  1844.     revision="$number_revision"
  1845.     ;;
  1846.   freebsd-aout|freebsd-elf|sunos)
  1847.     current="$number_major"
  1848.     revision="$number_minor"
  1849.     age="0"
  1850.     ;;
  1851.   irix|nonstopux)
  1852.     func_arith $number_major + $number_minor
  1853.     current=$func_arith_result
  1854.     age="$number_minor"
  1855.     revision="$number_minor"
  1856.     lt_irix_increment=no
  1857.     ;;
  1858.   esac
  1859.   ;;
  1860. no)
  1861.   current="$1"
  1862.   revision="$2"
  1863.   age="$3"
  1864.   ;;
  1865. esac
  1866. # Check that each of the things are valid numbers.
  1867. case $current in
  1868. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  1869. *)
  1870.   func_error "CURRENT `$current' must be a nonnegative integer"
  1871.   func_fatal_error "`$vinfo' is not valid version information"
  1872.   ;;
  1873. esac
  1874. case $revision in
  1875. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  1876. *)
  1877.   func_error "REVISION `$revision' must be a nonnegative integer"
  1878.   func_fatal_error "`$vinfo' is not valid version information"
  1879.   ;;
  1880. esac
  1881. case $age in
  1882. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  1883. *)
  1884.   func_error "AGE `$age' must be a nonnegative integer"
  1885.   func_fatal_error "`$vinfo' is not valid version information"
  1886.   ;;
  1887. esac
  1888. if test "$age" -gt "$current"; then
  1889.   func_error "AGE `$age' is greater than the current interface number `$current'"
  1890.   func_fatal_error "`$vinfo' is not valid version information"
  1891. fi
  1892. # Calculate the version variables.
  1893. major=
  1894. versuffix=
  1895. verstring=
  1896. case $version_type in
  1897. none) ;;
  1898. darwin)
  1899.   # Like Linux, but with the current version available in
  1900.   # verstring for coding it into the library header
  1901.   func_arith $current - $age
  1902.   major=.$func_arith_result
  1903.   versuffix="$major.$age.$revision"
  1904.   # Darwin ld doesn't like 0 for these options...
  1905.   func_arith $current + 1
  1906.   minor_current=$func_arith_result
  1907.   xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  1908.   verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  1909.   ;;
  1910. freebsd-aout)
  1911.   major=".$current"
  1912.   versuffix=".$current.$revision";
  1913.   ;;
  1914. freebsd-elf)
  1915.   major=".$current"
  1916.   versuffix=".$current"
  1917.   ;;
  1918. irix | nonstopux)
  1919.   if test "X$lt_irix_increment" = "Xno"; then
  1920.     func_arith $current - $age
  1921.   else
  1922.     func_arith $current - $age + 1
  1923.   fi
  1924.   major=$func_arith_result
  1925.   case $version_type in
  1926.     nonstopux) verstring_prefix=nonstopux ;;
  1927.     *)         verstring_prefix=sgi ;;
  1928.   esac
  1929.   verstring="$verstring_prefix$major.$revision"
  1930.   # Add in all the interfaces that we are compatible with.
  1931.   loop=$revision
  1932.   while test "$loop" -ne 0; do
  1933.     func_arith $revision - $loop
  1934.     iface=$func_arith_result
  1935.     func_arith $loop - 1
  1936.     loop=$func_arith_result
  1937.     verstring="$verstring_prefix$major.$iface:$verstring"
  1938.   done
  1939.   # Before this point, $major must not contain `.'.
  1940.   major=.$major
  1941.   versuffix="$major.$revision"
  1942.   ;;
  1943. linux)
  1944.   func_arith $current - $age
  1945.   major=.$func_arith_result
  1946.   versuffix="$major.$age.$revision"
  1947.   ;;
  1948. osf)
  1949.   func_arith $current - $age
  1950.   major=.$func_arith_result
  1951.   versuffix=".$current.$age.$revision"
  1952.   verstring="$current.$age.$revision"
  1953.   # Add in all the interfaces that we are compatible with.
  1954.   loop=$age
  1955.   while test "$loop" -ne 0; do
  1956.     func_arith $current - $loop
  1957.     iface=$func_arith_result
  1958.     func_arith $loop - 1
  1959.     loop=$func_arith_result
  1960.     verstring="$verstring:${iface}.0"
  1961.   done
  1962.   # Make executables depend on our current version.
  1963.   verstring="$verstring:${current}.0"
  1964.   ;;
  1965. qnx)
  1966.   major=".$current"
  1967.   versuffix=".$current"
  1968.   ;;
  1969. sunos)
  1970.   major=".$current"
  1971.   versuffix=".$current.$revision"
  1972.   ;;
  1973. windows)
  1974.   # Use '-' rather than '.', since we only want one
  1975.   # extension on DOS 8.3 filesystems.
  1976.   func_arith $current - $age
  1977.   major=$func_arith_result
  1978.   versuffix="-$major"
  1979.   ;;
  1980. *)
  1981.   func_fatal_configuration "unknown library version type `$version_type'"
  1982.   ;;
  1983. esac
  1984. # Clear the version info if we defaulted, and they specified a release.
  1985. if test -z "$vinfo" && test -n "$release"; then
  1986.   major=
  1987.   case $version_type in
  1988.   darwin)
  1989.     # we can't check for "0.0" in archive_cmds due to quoting
  1990.     # problems, so we reset it completely
  1991.     verstring=
  1992.     ;;
  1993.   *)
  1994.     verstring="0.0"
  1995.     ;;
  1996.   esac
  1997.   if test "$need_version" = no; then
  1998.     versuffix=
  1999.   else
  2000.     versuffix=".0.0"
  2001.   fi
  2002. fi
  2003. # Remove version info from name if versioning should be avoided
  2004. if test "$avoid_version" = yes && test "$need_version" = no; then
  2005.   major=
  2006.   versuffix=
  2007.   verstring=""
  2008. fi
  2009. # Check to see if the archive will have undefined symbols.
  2010. if test "$allow_undefined" = yes; then
  2011.   if test "$allow_undefined_flag" = unsupported; then
  2012.     func_warning "undefined symbols not allowed in $host shared libraries"
  2013.     build_libtool_libs=no
  2014.     build_old_libs=yes
  2015.   fi
  2016. else
  2017.   # Don't allow undefined symbols.
  2018.   allow_undefined_flag="$no_undefined_flag"
  2019. fi
  2020.       fi
  2021.       func_generate_dlsyms "$libname" "$libname" "yes"
  2022.       libobjs="$libobjs $symfileobj"
  2023.       test "X$libobjs" = "X " && libobjs=
  2024.       if test "$mode" != relink; then
  2025. # Remove our outputs, but don't remove object files since they
  2026. # may have been created when compiling PIC objects.
  2027. removelist=
  2028. tempremovelist=`$ECHO "$output_objdir/*"`
  2029. for p in $tempremovelist; do
  2030.   case $p in
  2031.     *.$objext | *.gcno)
  2032.        ;;
  2033.     $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  2034.        if test "X$precious_files_regex" != "X"; then
  2035.  if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  2036.  then
  2037.    continue
  2038.  fi
  2039.        fi
  2040.        removelist="$removelist $p"
  2041.        ;;
  2042.     *) ;;
  2043.   esac
  2044. done
  2045. test -n "$removelist" && 
  2046.   func_show_eval "${RM}r $removelist"
  2047.       fi
  2048.       # Now set the variables for building old libraries.
  2049.       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  2050. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2051. # Transform .lo files to .o files.
  2052. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2053.       fi
  2054.       # Eliminate all temporary directories.
  2055.       #for path in $notinst_path; do
  2056.       # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
  2057.       # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
  2058.       # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
  2059.       #done
  2060.       if test -n "$xrpath"; then
  2061. # If the user specified any rpath flags, then add them.
  2062. temp_xrpath=
  2063. for libdir in $xrpath; do
  2064.   temp_xrpath="$temp_xrpath -R$libdir"
  2065.   case "$finalize_rpath " in
  2066.   *" $libdir "*) ;;
  2067.   *) finalize_rpath="$finalize_rpath $libdir" ;;
  2068.   esac
  2069. done
  2070. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  2071.   dependency_libs="$temp_xrpath $dependency_libs"
  2072. fi
  2073.       fi
  2074.       # Make sure dlfiles contains only unique files that won't be dlpreopened
  2075.       old_dlfiles="$dlfiles"
  2076.       dlfiles=
  2077.       for lib in $old_dlfiles; do
  2078. case " $dlprefiles $dlfiles " in
  2079. *" $lib "*) ;;
  2080. *) dlfiles="$dlfiles $lib" ;;
  2081. esac
  2082.       done
  2083.       # Make sure dlprefiles contains only unique files
  2084.       old_dlprefiles="$dlprefiles"
  2085.       dlprefiles=
  2086.       for lib in $old_dlprefiles; do
  2087. case "$dlprefiles " in
  2088. *" $lib "*) ;;
  2089. *) dlprefiles="$dlprefiles $lib" ;;
  2090. esac
  2091.       done
  2092.       if test "$build_libtool_libs" = yes; then
  2093. if test -n "$rpath"; then
  2094.   case $host in
  2095.   *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
  2096.     # these systems don't actually have a c library (as such)!
  2097.     ;;
  2098.   *-*-rhapsody* | *-*-darwin1.[012])
  2099.     # Rhapsody C library is in the System framework
  2100.     deplibs="$deplibs System.ltframework"
  2101.     ;;
  2102.   *-*-netbsd*)
  2103.     # Don't link with libc until the a.out ld.so is fixed.
  2104.     ;;
  2105.   *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  2106.     # Do not include libc due to us having libc/libc_r.
  2107.     ;;
  2108.   *-*-sco3.2v5* | *-*-sco5v6*)
  2109.     # Causes problems with __ctype
  2110.     ;;
  2111.   *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  2112.     # Compiler inserts libc in the correct place for threads to work
  2113.     ;;
  2114.   *)
  2115.     # Add libc to deplibs on all other systems if necessary.
  2116.     if test "$build_libtool_need_lc" = "yes"; then
  2117.       deplibs="$deplibs -lc"
  2118.     fi
  2119.     ;;
  2120.   esac
  2121. fi
  2122. # Transform deplibs into only deplibs that can be linked in shared.
  2123. name_save=$name
  2124. libname_save=$libname
  2125. release_save=$release
  2126. versuffix_save=$versuffix
  2127. major_save=$major
  2128. # I'm not sure if I'm treating the release correctly.  I think
  2129. # release should show up in the -l (ie -lgmp5) so we don't want to
  2130. # add it in twice.  Is that correct?
  2131. release=""
  2132. versuffix=""
  2133. major=""
  2134. newdeplibs=
  2135. droppeddeps=no
  2136. case $deplibs_check_method in
  2137. pass_all)
  2138.   # Don't check for shared/static.  Everything works.
  2139.   # This might be a little naive.  We might want to check
  2140.   # whether the library exists or not.  But this is on
  2141.   # osf3 & osf4 and I'm not really sure... Just
  2142.   # implementing what was already the behavior.
  2143.   newdeplibs=$deplibs
  2144.   ;;
  2145. test_compile)
  2146.   # This code stresses the "libraries are programs" paradigm to its
  2147.   # limits. Maybe even breaks it.  We compile a program, linking it
  2148.   # against the deplibs as a proxy for the library.  Then we can check
  2149.   # whether they linked in statically or dynamically with ldd.
  2150.   $opt_dry_run || $RM conftest.c
  2151.   cat > conftest.c <<EOF
  2152.   int main() { return 0; }
  2153. EOF
  2154.   $opt_dry_run || $RM conftest
  2155.   if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  2156.     ldd_output=`ldd conftest`
  2157.     for i in $deplibs; do
  2158.       case $i in
  2159.       -l*)
  2160. func_stripname -l '' "$i"
  2161. name=$func_stripname_result
  2162. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2163.   case " $predeps $postdeps " in
  2164.   *" $i "*)
  2165.     newdeplibs="$newdeplibs $i"
  2166.     i=""
  2167.     ;;
  2168.   esac
  2169. fi
  2170. if test -n "$i" ; then
  2171.   libname=`eval "\$ECHO "$libname_spec""`
  2172.   deplib_matches=`eval "\$ECHO "$library_names_spec""`
  2173.   set dummy $deplib_matches; shift
  2174.   deplib_match=$1
  2175.   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2176.     newdeplibs="$newdeplibs $i"
  2177.   else
  2178.     droppeddeps=yes
  2179.     $ECHO
  2180.     $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  2181.     $ECHO "*** I have the capability to make that library automatically link in when"
  2182.     $ECHO "*** you link to this library.  But I can only do this if you have a"
  2183.     $ECHO "*** shared version of the library, which I believe you do not have"
  2184.     $ECHO "*** because a test_compile did reveal that the linker did not use it for"
  2185.     $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
  2186.   fi
  2187. fi
  2188. ;;
  2189.       *)
  2190. newdeplibs="$newdeplibs $i"
  2191. ;;
  2192.       esac
  2193.     done
  2194.   else
  2195.     # Error occurred in the first compile.  Let's try to salvage
  2196.     # the situation: Compile a separate program for each library.
  2197.     for i in $deplibs; do
  2198.       case $i in
  2199.       -l*)
  2200. func_stripname -l '' "$i"
  2201. name=$func_stripname_result
  2202. $opt_dry_run || $RM conftest
  2203. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  2204.   ldd_output=`ldd conftest`
  2205.   if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2206.     case " $predeps $postdeps " in
  2207.     *" $i "*)
  2208.       newdeplibs="$newdeplibs $i"
  2209.       i=""
  2210.       ;;
  2211.     esac
  2212.   fi
  2213.   if test -n "$i" ; then
  2214.     libname=`eval "\$ECHO "$libname_spec""`
  2215.     deplib_matches=`eval "\$ECHO "$library_names_spec""`
  2216.     set dummy $deplib_matches; shift
  2217.     deplib_match=$1
  2218.     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2219.       newdeplibs="$newdeplibs $i"
  2220.     else
  2221.       droppeddeps=yes
  2222.       $ECHO
  2223.       $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  2224.       $ECHO "*** I have the capability to make that library automatically link in when"
  2225.       $ECHO "*** you link to this library.  But I can only do this if you have a"
  2226.       $ECHO "*** shared version of the library, which you do not appear to have"
  2227.       $ECHO "*** because a test_compile did reveal that the linker did not use this one"
  2228.       $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
  2229.     fi
  2230.   fi
  2231. else
  2232.   droppeddeps=yes
  2233.   $ECHO
  2234.   $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
  2235.   $ECHO "*** make it link in!  You will probably need to install it or some"
  2236.   $ECHO "*** library that it depends on before this library will be fully"
  2237.   $ECHO "*** functional.  Installing it before continuing would be even better."
  2238. fi
  2239. ;;
  2240.       *)
  2241. newdeplibs="$newdeplibs $i"
  2242. ;;
  2243.       esac
  2244.     done
  2245.   fi
  2246.   ;;
  2247. file_magic*)
  2248.   set dummy $deplibs_check_method; shift
  2249.   file_magic_regex=`expr "$deplibs_check_method" : "$1 (.*)"`
  2250.   for a_deplib in $deplibs; do
  2251.     case $a_deplib in
  2252.     -l*)
  2253.       func_stripname -l '' "$a_deplib"
  2254.       name=$func_stripname_result
  2255.       if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2256. case " $predeps $postdeps " in
  2257. *" $a_deplib "*)
  2258.   newdeplibs="$newdeplibs $a_deplib"
  2259.   a_deplib=""
  2260.   ;;
  2261. esac
  2262.       fi
  2263.       if test -n "$a_deplib" ; then
  2264. libname=`eval "\$ECHO "$libname_spec""`
  2265. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2266.   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2267.   for potent_lib in $potential_libs; do
  2268.       # Follow soft links.
  2269.       if ls -lLd "$potent_lib" 2>/dev/null |
  2270.  $GREP " -> " >/dev/null; then
  2271. continue
  2272.       fi
  2273.       # The statement above tries to avoid entering an
  2274.       # endless loop below, in case of cyclic links.
  2275.       # We might still enter an endless loop, since a link
  2276.       # loop can be closed while we follow links,
  2277.       # but so what?
  2278.       potlib="$potent_lib"
  2279.       while test -h "$potlib" 2>/dev/null; do
  2280. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  2281. case $potliblink in
  2282. [\/]* | [A-Za-z]:[\/]*) potlib="$potliblink";;
  2283. *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2284. esac
  2285.       done
  2286.       if eval $file_magic_cmd "$potlib" 2>/dev/null |
  2287.  $SED -e 10q |
  2288.  $EGREP "$file_magic_regex" > /dev/null; then
  2289. newdeplibs="$newdeplibs $a_deplib"
  2290. a_deplib=""
  2291. break 2
  2292.       fi
  2293.   done
  2294. done
  2295.       fi
  2296.       if test -n "$a_deplib" ; then
  2297. droppeddeps=yes
  2298. $ECHO
  2299. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  2300. $ECHO "*** I have the capability to make that library automatically link in when"
  2301. $ECHO "*** you link to this library.  But I can only do this if you have a"
  2302. $ECHO "*** shared version of the library, which you do not appear to have"
  2303. $ECHO "*** because I did check the linker path looking for a file starting"
  2304. if test -z "$potlib" ; then
  2305.   $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  2306. else
  2307.   $ECHO "*** with $libname and none of the candidates passed a file format test"
  2308.   $ECHO "*** using a file magic. Last file checked: $potlib"
  2309. fi
  2310.       fi
  2311.       ;;
  2312.     *)
  2313.       # Add a -L argument.
  2314.       newdeplibs="$newdeplibs $a_deplib"
  2315.       ;;
  2316.     esac
  2317.   done # Gone through all deplibs.
  2318.   ;;
  2319. match_pattern*)
  2320.   set dummy $deplibs_check_method; shift
  2321.   match_pattern_regex=`expr "$deplibs_check_method" : "$1 (.*)"`
  2322.   for a_deplib in $deplibs; do
  2323.     case $a_deplib in
  2324.     -l*)
  2325.       func_stripname -l '' "$a_deplib"
  2326.       name=$func_stripname_result
  2327.       if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2328. case " $predeps $postdeps " in
  2329. *" $a_deplib "*)
  2330.   newdeplibs="$newdeplibs $a_deplib"
  2331.   a_deplib=""
  2332.   ;;
  2333. esac
  2334.       fi
  2335.       if test -n "$a_deplib" ; then
  2336. libname=`eval "\$ECHO "$libname_spec""`
  2337. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2338.   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2339.   for potent_lib in $potential_libs; do
  2340.     potlib="$potent_lib" # see symlink-check above in file_magic test
  2341.     if eval "$ECHO "X$potent_lib"" 2>/dev/null | $Xsed -e 10q | 
  2342.        $EGREP "$match_pattern_regex" > /dev/null; then
  2343.       newdeplibs="$newdeplibs $a_deplib"
  2344.       a_deplib=""
  2345.       break 2
  2346.     fi
  2347.   done
  2348. done
  2349.       fi
  2350.       if test -n "$a_deplib" ; then
  2351. droppeddeps=yes
  2352. $ECHO
  2353. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  2354. $ECHO "*** I have the capability to make that library automatically link in when"
  2355. $ECHO "*** you link to this library.  But I can only do this if you have a"
  2356. $ECHO "*** shared version of the library, which you do not appear to have"
  2357. $ECHO "*** because I did check the linker path looking for a file starting"
  2358. if test -z "$potlib" ; then
  2359.   $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  2360. else
  2361.   $ECHO "*** with $libname and none of the candidates passed a file format test"
  2362.   $ECHO "*** using a regex pattern. Last file checked: $potlib"
  2363. fi
  2364.       fi
  2365.       ;;
  2366.     *)
  2367.       # Add a -L argument.
  2368.       newdeplibs="$newdeplibs $a_deplib"
  2369.       ;;
  2370.     esac
  2371.   done # Gone through all deplibs.
  2372.   ;;
  2373. none | unknown | *)
  2374.   newdeplibs=""
  2375.   tmp_deplibs=`$ECHO "X $deplibs" | $Xsed 
  2376.       -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
  2377.   if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2378.     for i in $predeps $postdeps ; do
  2379.       # can't use Xsed below, because $i might contain '/'
  2380.       tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
  2381.     done
  2382.   fi
  2383.   if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[  ]//g' |
  2384.      $GREP . >/dev/null; then
  2385.     $ECHO
  2386.     if test "X$deplibs_check_method" = "Xnone"; then
  2387.       $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
  2388.     else
  2389.       $ECHO "*** Warning: inter-library dependencies are not known to be supported."
  2390.     fi
  2391.     $ECHO "*** All declared inter-library dependencies are being dropped."
  2392.     droppeddeps=yes
  2393.   fi
  2394.   ;;
  2395. esac
  2396. versuffix=$versuffix_save
  2397. major=$major_save
  2398. release=$release_save
  2399. libname=$libname_save
  2400. name=$name_save
  2401. case $host in
  2402. *-*-rhapsody* | *-*-darwin1.[012])
  2403.   # On Rhapsody replace the C library with the System framework
  2404.   newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  2405.   ;;
  2406. esac
  2407. if test "$droppeddeps" = yes; then
  2408.   if test "$module" = yes; then
  2409.     $ECHO
  2410.     $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
  2411.     $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
  2412.     $ECHO "*** a static module, that should work as long as the dlopening"
  2413.     $ECHO "*** application is linked with the -dlopen flag."
  2414.     if test -z "$global_symbol_pipe"; then
  2415.       $ECHO
  2416.       $ECHO "*** However, this would only work if libtool was able to extract symbol"
  2417.       $ECHO "*** lists from a program, using `nm' or equivalent, but libtool could"
  2418.       $ECHO "*** not find such a program.  So, this module is probably useless."
  2419.       $ECHO "*** `nm' from GNU binutils and a full rebuild may help."
  2420.     fi
  2421.     if test "$build_old_libs" = no; then
  2422.       oldlibs="$output_objdir/$libname.$libext"
  2423.       build_libtool_libs=module
  2424.       build_old_libs=yes
  2425.     else
  2426.       build_libtool_libs=no
  2427.     fi
  2428.   else
  2429.     $ECHO "*** The inter-library dependencies that have been dropped here will be"
  2430.     $ECHO "*** automatically added whenever a program is linked with this library"
  2431.     $ECHO "*** or is declared to -dlopen it."
  2432.     if test "$allow_undefined" = no; then
  2433.       $ECHO
  2434.       $ECHO "*** Since this library must not contain undefined symbols,"
  2435.       $ECHO "*** because either the platform does not support them or"
  2436.       $ECHO "*** it was explicitly requested with -no-undefined,"
  2437.       $ECHO "*** libtool will only create a static version of it."
  2438.       if test "$build_old_libs" = no; then
  2439. oldlibs="$output_objdir/$libname.$libext"
  2440. build_libtool_libs=module
  2441. build_old_libs=yes
  2442.       else
  2443. build_libtool_libs=no
  2444.       fi
  2445.     fi
  2446.   fi
  2447. fi
  2448. # Done checking deplibs!
  2449. deplibs=$newdeplibs
  2450.       fi
  2451.       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  2452.       case $host in
  2453. *-*-darwin*)
  2454.   newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  2455.   new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  2456.   deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  2457.   ;;
  2458.       esac
  2459.       # move library search paths that coincide with paths to not yet
  2460.       # installed libraries to the beginning of the library search list
  2461.       new_libs=
  2462.       for path in $notinst_path; do
  2463. case " $new_libs " in
  2464. *" -L$path/$objdir "*) ;;
  2465. *)
  2466.   case " $deplibs " in
  2467.   *" -L$path/$objdir "*)
  2468.     new_libs="$new_libs -L$path/$objdir" ;;
  2469.   esac
  2470.   ;;
  2471. esac
  2472.       done
  2473.       for deplib in $deplibs; do
  2474. case $deplib in
  2475. -L*)
  2476.   case " $new_libs " in
  2477.   *" $deplib "*) ;;
  2478.   *) new_libs="$new_libs $deplib" ;;
  2479.   esac
  2480.   ;;
  2481. *) new_libs="$new_libs $deplib" ;;
  2482. esac
  2483.       done
  2484.       deplibs="$new_libs"
  2485.       # All the library-specific variables (install_libdir is set above).
  2486.       library_names=
  2487.       old_library=
  2488.       dlname=
  2489.       # Test again, we may have decided not to build it any more
  2490.       if test "$build_libtool_libs" = yes; then
  2491. if test "$hardcode_into_libs" = yes; then
  2492.   # Hardcode the library paths
  2493.   hardcode_libdirs=
  2494.   dep_rpath=
  2495.   rpath="$finalize_rpath"
  2496.   test "$mode" != relink && rpath="$compile_rpath$rpath"
  2497.   for libdir in $rpath; do
  2498.     if test -n "$hardcode_libdir_flag_spec"; then
  2499.       if test -n "$hardcode_libdir_separator"; then
  2500. if test -z "$hardcode_libdirs"; then
  2501.   hardcode_libdirs="$libdir"
  2502. else
  2503.   # Just accumulate the unique libdirs.
  2504.   case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  2505.   *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2506.     ;;
  2507.   *)
  2508.     hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2509.     ;;
  2510.   esac
  2511. fi
  2512.       else
  2513. eval flag="$hardcode_libdir_flag_spec"
  2514. dep_rpath="$dep_rpath $flag"
  2515.       fi
  2516.     elif test -n "$runpath_var"; then
  2517.       case "$perm_rpath " in
  2518.       *" $libdir "*) ;;
  2519.       *) perm_rpath="$perm_rpath $libdir" ;;
  2520.       esac
  2521.     fi
  2522.   done
  2523.   # Substitute the hardcoded libdirs into the rpath.
  2524.   if test -n "$hardcode_libdir_separator" &&
  2525.      test -n "$hardcode_libdirs"; then
  2526.     libdir="$hardcode_libdirs"
  2527.     if test -n "$hardcode_libdir_flag_spec_ld"; then
  2528.       eval dep_rpath="$hardcode_libdir_flag_spec_ld"
  2529.     else
  2530.       eval dep_rpath="$hardcode_libdir_flag_spec"
  2531.     fi
  2532.   fi
  2533.   if test -n "$runpath_var" && test -n "$perm_rpath"; then
  2534.     # We should set the runpath_var.
  2535.     rpath=
  2536.     for dir in $perm_rpath; do
  2537.       rpath="$rpath$dir:"
  2538.     done
  2539.     eval "$runpath_var='$rpath$$runpath_var'; export $runpath_var"
  2540.   fi
  2541.   test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  2542. fi
  2543. shlibpath="$finalize_shlibpath"
  2544. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  2545. if test -n "$shlibpath"; then
  2546.   eval "$shlibpath_var='$shlibpath$$shlibpath_var'; export $shlibpath_var"
  2547. fi
  2548. # Get the real and link names of the library.
  2549. eval shared_ext="$shrext_cmds"
  2550. eval library_names="$library_names_spec"
  2551. set dummy $library_names
  2552. shift
  2553. realname="$1"
  2554. shift
  2555. if test -n "$soname_spec"; then
  2556.   eval soname="$soname_spec"
  2557. else
  2558.   soname="$realname"
  2559. fi
  2560. if test -z "$dlname"; then
  2561.   dlname=$soname
  2562. fi
  2563. lib="$output_objdir/$realname"
  2564. linknames=
  2565. for link
  2566. do
  2567.   linknames="$linknames $link"
  2568. done
  2569. # Use standard objects if they are pic
  2570. test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2571. test "X$libobjs" = "X " && libobjs=
  2572. delfiles=
  2573. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2574.   $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  2575.   export_symbols="$output_objdir/$libname.uexp"
  2576.   delfiles="$delfiles $export_symbols"
  2577. fi
  2578. orig_export_symbols=
  2579. case $host_os in
  2580. cygwin* | mingw* | cegcc*)
  2581.   if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  2582.     # exporting using user supplied symfile
  2583.     if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  2584.       # and it's NOT already a .def file. Must figure out
  2585.       # which of the given symbols are data symbols and tag
  2586.       # them as such. So, trigger use of export_symbols_cmds.
  2587.       # export_symbols gets reassigned inside the "prepare
  2588.       # the list of exported symbols" if statement, so the
  2589.       # include_expsyms logic still works.
  2590.       orig_export_symbols="$export_symbols"
  2591.       export_symbols=
  2592.       always_export_symbols=yes
  2593.     fi
  2594.   fi
  2595.   ;;
  2596. esac
  2597. # Prepare the list of exported symbols
  2598. if test -z "$export_symbols"; then
  2599.   if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2600.     func_verbose "generating symbol list for `$libname.la'"
  2601.     export_symbols="$output_objdir/$libname.exp"
  2602.     $opt_dry_run || $RM $export_symbols
  2603.     cmds=$export_symbols_cmds
  2604.     save_ifs="$IFS"; IFS='~'
  2605.     for cmd in $cmds; do
  2606.       IFS="$save_ifs"
  2607.       eval cmd="$cmd"
  2608.       func_len " $cmd"
  2609.       len=$func_len_result
  2610.       if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  2611. func_show_eval "$cmd" 'exit $?'
  2612. skipped_export=false
  2613.       else
  2614. # The command line is too long to execute in one step.
  2615. func_verbose "using reloadable object file for export list..."
  2616. skipped_export=:
  2617. # Break out early, otherwise skipped_export may be
  2618. # set to false by a later but shorter cmd.
  2619. break
  2620.       fi
  2621.     done
  2622.     IFS="$save_ifs"
  2623.     if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  2624.       func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2625.       func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  2626.     fi
  2627.   fi
  2628. fi
  2629. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2630.   tmp_export_symbols="$export_symbols"
  2631.   test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  2632.   $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  2633. fi
  2634. if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  2635.   # The given exports_symbols file has to be filtered, so filter it.
  2636.   func_verbose "filter symbol list for `$libname.la' to tag DATA exports"
  2637.   # FIXME: $output_objdir/$libname.filter potentially contains lots of
  2638.   # 's' commands which not all seds can handle. GNU sed should be fine
  2639.   # though. Also, the filter scales superlinearly with the number of
  2640.   # global variables. join(1) would be nice here, but unfortunately
  2641.   # isn't a blessed tool.
  2642.   $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,(.*)([ ,].*),s|^1$|12|,' < $export_symbols > $output_objdir/$libname.filter
  2643.   delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  2644.   export_symbols=$output_objdir/$libname.def
  2645.   $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  2646. fi
  2647. tmp_deplibs=
  2648. for test_deplib in $deplibs; do
  2649.   case " $convenience " in
  2650.   *" $test_deplib "*) ;;
  2651.   *)
  2652.     tmp_deplibs="$tmp_deplibs $test_deplib"
  2653.     ;;
  2654.   esac
  2655. done
  2656. deplibs="$tmp_deplibs"
  2657. if test -n "$convenience"; then
  2658.   if test -n "$whole_archive_flag_spec" &&
  2659.     test "$compiler_needs_object" = yes &&
  2660.     test -z "$libobjs"; then
  2661.     # extract the archives, so we have objects to list.
  2662.     # TODO: could optimize this to just extract one archive.
  2663.     whole_archive_flag_spec=
  2664.   fi
  2665.   if test -n "$whole_archive_flag_spec"; then
  2666.     save_libobjs=$libobjs
  2667.     eval libobjs="$libobjs $whole_archive_flag_spec"
  2668.     test "X$libobjs" = "X " && libobjs=
  2669.   else
  2670.     gentop="$output_objdir/${outputname}x"
  2671.     generated="$generated $gentop"
  2672.     func_extract_archives $gentop $convenience
  2673.     libobjs="$libobjs $func_extract_archives_result"
  2674.     test "X$libobjs" = "X " && libobjs=
  2675.   fi
  2676. fi
  2677. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2678.   eval flag="$thread_safe_flag_spec"
  2679.   linker_flags="$linker_flags $flag"
  2680. fi
  2681. # Make a backup of the uninstalled library when relinking
  2682. if test "$mode" = relink; then
  2683.   $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  2684. fi
  2685. # Do each of the archive commands.
  2686. if test "$module" = yes && test -n "$module_cmds" ; then
  2687.   if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  2688.     eval test_cmds="$module_expsym_cmds"
  2689.     cmds=$module_expsym_cmds
  2690.   else
  2691.     eval test_cmds="$module_cmds"
  2692.     cmds=$module_cmds
  2693.   fi
  2694. else
  2695.   if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2696.     eval test_cmds="$archive_expsym_cmds"
  2697.     cmds=$archive_expsym_cmds
  2698.   else
  2699.     eval test_cmds="$archive_cmds"
  2700.     cmds=$archive_cmds
  2701.   fi
  2702. fi
  2703. if test "X$skipped_export" != "X:" &&
  2704.    func_len " $test_cmds" &&
  2705.    len=$func_len_result &&
  2706.    test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  2707.   :
  2708. else
  2709.   # The command line is too long to link in one step, link piecewise
  2710.   # or, if using GNU ld and skipped_export is not :, use a linker
  2711.   # script.
  2712.   # Save the value of $output and $libobjs because we want to
  2713.   # use them later.  If we have whole_archive_flag_spec, we
  2714.   # want to use save_libobjs as it was before
  2715.   # whole_archive_flag_spec was expanded, because we can't
  2716.   # assume the linker understands whole_archive_flag_spec.
  2717.   # This may have to be revisited, in case too many
  2718.   # convenience libraries get linked in and end up exceeding
  2719.   # the spec.
  2720.   if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  2721.     save_libobjs=$libobjs
  2722.   fi
  2723.   save_output=$output
  2724.   output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
  2725.   # Clear the reloadable object creation command queue and
  2726.   # initialize k to one.
  2727.   test_cmds=
  2728.   concat_cmds=
  2729.   objlist=
  2730.   last_robj=
  2731.   k=1
  2732.   if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  2733.     output=${output_objdir}/${output_la}.lnkscript
  2734.     func_verbose "creating GNU ld script: $output"
  2735.     $ECHO 'INPUT (' > $output
  2736.     for obj in $save_libobjs
  2737.     do
  2738.       $ECHO "$obj" >> $output
  2739.     done
  2740.     $ECHO ')' >> $output
  2741.     delfiles="$delfiles $output"
  2742.   elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  2743.     output=${output_objdir}/${output_la}.lnk
  2744.     func_verbose "creating linker input file list: $output"
  2745.     : > $output
  2746.     set x $save_libobjs
  2747.     shift
  2748.     firstobj=
  2749.     if test "$compiler_needs_object" = yes; then
  2750.       firstobj="$1 "
  2751.       shift
  2752.     fi
  2753.     for obj
  2754.     do
  2755.       $ECHO "$obj" >> $output
  2756.     done
  2757.     delfiles="$delfiles $output"
  2758.     output=$firstobj"$file_list_spec$output"
  2759.   else
  2760.     if test -n "$save_libobjs"; then
  2761.       func_verbose "creating reloadable object files..."
  2762.       output=$output_objdir/$output_la-${k}.$objext
  2763.       eval test_cmds="$reload_cmds"
  2764.       func_len " $test_cmds"
  2765.       len0=$func_len_result
  2766.       len=$len0
  2767.       # Loop over the list of objects to be linked.
  2768.       for obj in $save_libobjs
  2769.       do
  2770. func_len " $obj"
  2771. func_arith $len + $func_len_result
  2772. len=$func_arith_result
  2773. if test "X$objlist" = X ||
  2774.    test "$len" -lt "$max_cmd_len"; then
  2775.   func_append objlist " $obj"
  2776. else
  2777.   # The command $test_cmds is almost too long, add a
  2778.   # command to the queue.
  2779.   if test "$k" -eq 1 ; then
  2780.     # The first file doesn't have a previous command to add.
  2781.     eval concat_cmds="$reload_cmds $objlist $last_robj"
  2782.   else
  2783.     # All subsequent reloadable object files will link in
  2784.     # the last one created.
  2785.     eval concat_cmds="$concat_cmds~$reload_cmds $objlist $last_robj~$RM $last_robj"
  2786.   fi
  2787.   last_robj=$output_objdir/$output_la-${k}.$objext
  2788.   func_arith $k + 1
  2789.   k=$func_arith_result
  2790.   output=$output_objdir/$output_la-${k}.$objext
  2791.   objlist=$obj
  2792.   func_len " $last_robj"
  2793.   func_arith $len0 + $func_len_result
  2794.   len=$func_arith_result
  2795. fi
  2796.       done
  2797.       # Handle the remaining objects by creating one last
  2798.       # reloadable object file.  All subsequent reloadable object
  2799.       # files will link in the last one created.
  2800.       test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  2801.       eval concat_cmds="${concat_cmds}$reload_cmds $objlist $last_robj"
  2802.       if test -n "$last_robj"; then
  2803.         eval concat_cmds="${concat_cmds}~$RM $last_robj"
  2804.       fi
  2805.       delfiles="$delfiles $output"
  2806.     else
  2807.       output=
  2808.     fi
  2809.     if ${skipped_export-false}; then
  2810.       func_verbose "generating symbol list for `$libname.la'"
  2811.       export_symbols="$output_objdir/$libname.exp"
  2812.       $opt_dry_run || $RM $export_symbols
  2813.       libobjs=$output
  2814.       # Append the command to create the export file.
  2815.       test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  2816.       eval concat_cmds="$concat_cmds$export_symbols_cmds"
  2817.       if test -n "$last_robj"; then
  2818. eval concat_cmds="$concat_cmds~$RM $last_robj"
  2819.       fi
  2820.     fi
  2821.     test -n "$save_libobjs" &&
  2822.       func_verbose "creating a temporary reloadable object file: $output"
  2823.     # Loop through the commands generated above and execute them.
  2824.     save_ifs="$IFS"; IFS='~'
  2825.     for cmd in $concat_cmds; do
  2826.       IFS="$save_ifs"
  2827.       $opt_silent || {
  2828.   func_quote_for_expand "$cmd"
  2829.   eval "func_echo $func_quote_for_expand_result"
  2830.       }
  2831.       $opt_dry_run || eval "$cmd" || {
  2832. lt_exit=$?
  2833. # Restore the uninstalled library and exit
  2834. if test "$mode" = relink; then
  2835.   ( cd "$output_objdir" && 
  2836.     $RM "${realname}T" && 
  2837.     $MV "${realname}U" "$realname" )
  2838. fi
  2839. exit $lt_exit
  2840.       }
  2841.     done
  2842.     IFS="$save_ifs"
  2843.     if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  2844.       func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2845.       func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  2846.     fi
  2847.   fi
  2848.           if ${skipped_export-false}; then
  2849.     if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2850.       tmp_export_symbols="$export_symbols"
  2851.       test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  2852.       $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  2853.     fi
  2854.     if test -n "$orig_export_symbols"; then
  2855.       # The given exports_symbols file has to be filtered, so filter it.
  2856.       func_verbose "filter symbol list for `$libname.la' to tag DATA exports"
  2857.       # FIXME: $output_objdir/$libname.filter potentially contains lots of
  2858.       # 's' commands which not all seds can handle. GNU sed should be fine
  2859.       # though. Also, the filter scales superlinearly with the number of
  2860.       # global variables. join(1) would be nice here, but unfortunately
  2861.       # isn't a blessed tool.
  2862.       $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,(.*)([ ,].*),s|^1$|12|,' < $export_symbols > $output_objdir/$libname.filter
  2863.       delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  2864.       export_symbols=$output_objdir/$libname.def
  2865.       $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  2866.     fi
  2867.   fi
  2868.   libobjs=$output
  2869.   # Restore the value of output.
  2870.   output=$save_output
  2871.   if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  2872.     eval libobjs="$libobjs $whole_archive_flag_spec"
  2873.     test "X$libobjs" = "X " && libobjs=
  2874.   fi
  2875.   # Expand the library linking commands again to reset the
  2876.   # value of $libobjs for piecewise linking.
  2877.   # Do each of the archive commands.
  2878.   if test "$module" = yes && test -n "$module_cmds" ; then
  2879.     if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  2880.       cmds=$module_expsym_cmds
  2881.     else
  2882.       cmds=$module_cmds
  2883.     fi
  2884.   else
  2885.     if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2886.       cmds=$archive_expsym_cmds
  2887.     else
  2888.       cmds=$archive_cmds
  2889.     fi
  2890.   fi
  2891. fi
  2892. if test -n "$delfiles"; then
  2893.   # Append the command to remove temporary files to $cmds.
  2894.   eval cmds="$cmds~$RM $delfiles"
  2895. fi
  2896. # Add any objects from preloaded convenience libraries
  2897. if test -n "$dlprefiles"; then
  2898.   gentop="$output_objdir/${outputname}x"
  2899.   generated="$generated $gentop"
  2900.   func_extract_archives $gentop $dlprefiles
  2901.   libobjs="$libobjs $func_extract_archives_result"
  2902.   test "X$libobjs" = "X " && libobjs=
  2903. fi
  2904. save_ifs="$IFS"; IFS='~'
  2905. for cmd in $cmds; do
  2906.   IFS="$save_ifs"
  2907.   eval cmd="$cmd"
  2908.   $opt_silent || {
  2909.     func_quote_for_expand "$cmd"
  2910.     eval "func_echo $func_quote_for_expand_result"
  2911.   }
  2912.   $opt_dry_run || eval "$cmd" || {
  2913.     lt_exit=$?
  2914.     # Restore the uninstalled library and exit
  2915.     if test "$mode" = relink; then
  2916.       ( cd "$output_objdir" && 
  2917.         $RM "${realname}T" && 
  2918. $MV "${realname}U" "$realname" )
  2919.     fi
  2920.     exit $lt_exit
  2921.   }
  2922. done
  2923. IFS="$save_ifs"
  2924. # Restore the uninstalled library and exit
  2925. if test "$mode" = relink; then
  2926.   $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  2927.   if test -n "$convenience"; then
  2928.     if test -z "$whole_archive_flag_spec"; then
  2929.       func_show_eval '${RM}r "$gentop"'
  2930.     fi
  2931.   fi
  2932.   exit $EXIT_SUCCESS
  2933. fi
  2934. # Create links to the real library.
  2935. for linkname in $linknames; do
  2936.   if test "$realname" != "$linkname"; then
  2937.     func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  2938.   fi
  2939. done
  2940. # If -module or -export-dynamic was specified, set the dlname.
  2941. if test "$module" = yes || test "$export_dynamic" = yes; then
  2942.   # On all known operating systems, these are identical.
  2943.   dlname="$soname"
  2944. fi
  2945.       fi
  2946.       ;;
  2947.     obj)
  2948.       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2949. func_warning "`-dlopen' is ignored for objects"
  2950.       fi
  2951.       case " $deplibs" in
  2952.       * -l* | * -L*)
  2953. func_warning "`-l' and `-L' are ignored for objects" ;;
  2954.       esac
  2955.       test -n "$rpath" && 
  2956. func_warning "`-rpath' is ignored for objects"
  2957.       test -n "$xrpath" && 
  2958. func_warning "`-R' is ignored for objects"
  2959.       test -n "$vinfo" && 
  2960. func_warning "`-version-info' is ignored for objects"
  2961.       test -n "$release" && 
  2962. func_warning "`-release' is ignored for objects"
  2963.       case $output in
  2964.       *.lo)
  2965. test -n "$objs$old_deplibs" && 
  2966.   func_fatal_error "cannot build library object `$output' from non-libtool objects"
  2967. libobj=$output
  2968. func_lo2o "$libobj"
  2969. obj=$func_lo2o_result
  2970. ;;
  2971.       *)
  2972. libobj=
  2973. obj="$output"
  2974. ;;
  2975.       esac
  2976.       # Delete the old objects.
  2977.       $opt_dry_run || $RM $obj $libobj
  2978.       # Objects from convenience libraries.  This assumes
  2979.       # single-version convenience libraries.  Whenever we create
  2980.       # different ones for PIC/non-PIC, this we'll have to duplicate
  2981.       # the extraction.
  2982.       reload_conv_objs=
  2983.       gentop=
  2984.       # reload_cmds runs $LD directly, so let us get rid of
  2985.       # -Wl from whole_archive_flag_spec and hope we can get by with
  2986.       # turning comma into space..
  2987.       wl=
  2988.       if test -n "$convenience"; then
  2989. if test -n "$whole_archive_flag_spec"; then
  2990.   eval tmp_whole_archive_flags="$whole_archive_flag_spec"
  2991.   reload_conv_objs=$reload_objs `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  2992. else
  2993.   gentop="$output_objdir/${obj}x"
  2994.   generated="$generated $gentop"
  2995.   func_extract_archives $gentop $convenience
  2996.   reload_conv_objs="$reload_objs $func_extract_archives_result"
  2997. fi
  2998.       fi
  2999.       # Create the old-style object.
  3000.       reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/.'${libext}$'/d' -e '/.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  3001.       output="$obj"
  3002.       func_execute_cmds "$reload_cmds" 'exit $?'
  3003.       # Exit if we aren't doing a library object file.
  3004.       if test -z "$libobj"; then
  3005. if test -n "$gentop"; then
  3006.   func_show_eval '${RM}r "$gentop"'
  3007. fi
  3008. exit $EXIT_SUCCESS
  3009.       fi
  3010.       if test "$build_libtool_libs" != yes; then
  3011. if test -n "$gentop"; then
  3012.   func_show_eval '${RM}r "$gentop"'
  3013. fi
  3014. # Create an invalid libtool object if no PIC, so that we don't
  3015. # accidentally link it into a program.
  3016. # $show "echo timestamp > $libobj"
  3017. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  3018. exit $EXIT_SUCCESS
  3019.       fi
  3020.       if test -n "$pic_flag" || test "$pic_mode" != default; then
  3021. # Only do commands if we really have different PIC objects.
  3022. reload_objs="$libobjs $reload_conv_objs"
  3023. output="$libobj"
  3024. func_execute_cmds "$reload_cmds" 'exit $?'
  3025.       fi
  3026.       if test -n "$gentop"; then
  3027. func_show_eval '${RM}r "$gentop"'
  3028.       fi
  3029.       exit $EXIT_SUCCESS
  3030.       ;;
  3031.     prog)
  3032.       case $host in
  3033. *cygwin*) func_stripname '' '.exe' "$output"
  3034.           output=$func_stripname_result.exe;;
  3035.       esac
  3036.       test -n "$vinfo" && 
  3037. func_warning "`-version-info' is ignored for programs"
  3038.       test -n "$release" && 
  3039. func_warning "`-release' is ignored for programs"
  3040.       test "$preload" = yes 
  3041.         && test "$dlopen_support" = unknown 
  3042. && test "$dlopen_self" = unknown 
  3043. && test "$dlopen_self_static" = unknown && 
  3044.   func_warning "`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  3045.       case $host in
  3046.       *-*-rhapsody* | *-*-darwin1.[012])
  3047. # On Rhapsody replace the C library is the System framework
  3048. compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  3049. finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  3050. ;;
  3051.       esac
  3052.       case $host in
  3053.       *-*-darwin*)
  3054. # Don't allow lazy linking, it breaks C++ global constructors
  3055. # But is supposedly fixed on 10.4 or later (yay!).
  3056. if test "$tagname" = CXX ; then
  3057.   case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  3058.     10.[0123])
  3059.       compile_command="$compile_command ${wl}-bind_at_load"
  3060.       finalize_command="$finalize_command ${wl}-bind_at_load"
  3061.     ;;
  3062.   esac
  3063. fi
  3064. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  3065. compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  3066. finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% ([^ $]*).ltframework% -framework 1%g'`
  3067. ;;
  3068.       esac
  3069.       # move library search paths that coincide with paths to not yet
  3070.       # installed libraries to the beginning of the library search list
  3071.       new_libs=
  3072.       for path in $notinst_path; do
  3073. case " $new_libs " in
  3074. *" -L$path/$objdir "*) ;;
  3075. *)
  3076.   case " $compile_deplibs " in
  3077.   *" -L$path/$objdir "*)
  3078.     new_libs="$new_libs -L$path/$objdir" ;;
  3079.   esac
  3080.   ;;
  3081. esac
  3082.       done
  3083.       for deplib in $compile_deplibs; do
  3084. case $deplib in
  3085. -L*)
  3086.   case " $new_libs " in
  3087.   *" $deplib "*) ;;
  3088.   *) new_libs="$new_libs $deplib" ;;
  3089.   esac
  3090.   ;;
  3091. *) new_libs="$new_libs $deplib" ;;
  3092. esac
  3093.       done
  3094.       compile_deplibs="$new_libs"
  3095.       compile_command="$compile_command $compile_deplibs"
  3096.       finalize_command="$finalize_command $finalize_deplibs"
  3097.       if test -n "$rpath$xrpath"; then
  3098. # If the user specified any rpath flags, then add them.
  3099. for libdir in $rpath $xrpath; do
  3100.   # This is the magic to use -rpath.
  3101.   case "$finalize_rpath " in
  3102.   *" $libdir "*) ;;
  3103.   *) finalize_rpath="$finalize_rpath $libdir" ;;
  3104.   esac
  3105. done
  3106.       fi
  3107.       # Now hardcode the library paths
  3108.       rpath=
  3109.       hardcode_libdirs=
  3110.       for libdir in $compile_rpath $finalize_rpath; do
  3111. if test -n "$hardcode_libdir_flag_spec"; then
  3112.   if test -n "$hardcode_libdir_separator"; then
  3113.     if test -z "$hardcode_libdirs"; then
  3114.       hardcode_libdirs="$libdir"
  3115.     else
  3116.       # Just accumulate the unique libdirs.
  3117.       case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3118.       *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3119. ;;
  3120.       *)
  3121. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3122. ;;
  3123.       esac
  3124.     fi
  3125.   else
  3126.     eval flag="$hardcode_libdir_flag_spec"
  3127.     rpath="$rpath $flag"
  3128.   fi
  3129. elif test -n "$runpath_var"; then
  3130.   case "$perm_rpath " in
  3131.   *" $libdir "*) ;;
  3132.   *) perm_rpath="$perm_rpath $libdir" ;;
  3133.   esac
  3134. fi
  3135. case $host in
  3136. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  3137.   testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  3138.   case :$dllsearchpath: in
  3139.   *":$libdir:"*) ;;
  3140.   ::) dllsearchpath=$libdir;;
  3141.   *) dllsearchpath="$dllsearchpath:$libdir";;
  3142.   esac
  3143.   case :$dllsearchpath: in
  3144.   *":$testbindir:"*) ;;
  3145.   ::) dllsearchpath=$testbindir;;
  3146.   *) dllsearchpath="$dllsearchpath:$testbindir";;
  3147.   esac
  3148.   ;;
  3149. esac
  3150.       done
  3151.       # Substitute the hardcoded libdirs into the rpath.
  3152.       if test -n "$hardcode_libdir_separator" &&
  3153.  test -n "$hardcode_libdirs"; then
  3154. libdir="$hardcode_libdirs"
  3155. eval rpath=" $hardcode_libdir_flag_spec"
  3156.       fi
  3157.       compile_rpath="$rpath"
  3158.       rpath=
  3159.       hardcode_libdirs=
  3160.       for libdir in $finalize_rpath; do
  3161. if test -n "$hardcode_libdir_flag_spec"; then
  3162.   if test -n "$hardcode_libdir_separator"; then
  3163.     if test -z "$hardcode_libdirs"; then
  3164.       hardcode_libdirs="$libdir"
  3165.     else
  3166.       # Just accumulate the unique libdirs.
  3167.       case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3168.       *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3169. ;;
  3170.       *)
  3171. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3172. ;;
  3173.       esac
  3174.     fi
  3175.   else
  3176.     eval flag="$hardcode_libdir_flag_spec"
  3177.     rpath="$rpath $flag"
  3178.   fi
  3179. elif test -n "$runpath_var"; then
  3180.   case "$finalize_perm_rpath " in
  3181.   *" $libdir "*) ;;
  3182.   *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  3183.   esac
  3184. fi
  3185.       done
  3186.       # Substitute the hardcoded libdirs into the rpath.
  3187.       if test -n "$hardcode_libdir_separator" &&
  3188.  test -n "$hardcode_libdirs"; then
  3189. libdir="$hardcode_libdirs"
  3190. eval rpath=" $hardcode_libdir_flag_spec"
  3191.       fi
  3192.       finalize_rpath="$rpath"
  3193.       if test -n "$libobjs" && test "$build_old_libs" = yes; then
  3194. # Transform all the library objects into standard objects.
  3195. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3196. finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3197.       fi
  3198.       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  3199.       # template prelinking step
  3200.       if test -n "$prelink_cmds"; then
  3201. func_execute_cmds "$prelink_cmds" 'exit $?'
  3202.       fi
  3203.       wrappers_required=yes
  3204.       case $host in
  3205.       *cygwin* | *mingw* )
  3206.         if test "$build_libtool_libs" != yes; then
  3207.           wrappers_required=no
  3208.         fi
  3209.         ;;
  3210.       *cegcc)
  3211.         # Disable wrappers for cegcc, we are cross compiling anyway.
  3212.         wrappers_required=no
  3213.         ;;
  3214.       *)
  3215.         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  3216.           wrappers_required=no
  3217.         fi
  3218.         ;;
  3219.       esac
  3220.       if test "$wrappers_required" = no; then
  3221. # Replace the output file specification.
  3222. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3223. link_command="$compile_command$compile_rpath"
  3224. # We have no uninstalled library dependencies, so finalize right now.
  3225. exit_status=0
  3226. func_show_eval "$link_command" 'exit_status=$?'
  3227. # Delete the generated files.
  3228. if test -f "$output_objdir/${outputname}S.${objext}"; then
  3229.   func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  3230. fi
  3231. exit $exit_status
  3232.       fi
  3233.       if test -n "$compile_shlibpath$finalize_shlibpath"; then
  3234. compile_command="$shlibpath_var="$compile_shlibpath$finalize_shlibpath$$shlibpath_var" $compile_command"
  3235.       fi
  3236.       if test -n "$finalize_shlibpath"; then
  3237. finalize_command="$shlibpath_var="$finalize_shlibpath$$shlibpath_var" $finalize_command"
  3238.       fi
  3239.       compile_var=
  3240.       finalize_var=
  3241.       if test -n "$runpath_var"; then
  3242. if test -n "$perm_rpath"; then
  3243.   # We should set the runpath_var.
  3244.   rpath=
  3245.   for dir in $perm_rpath; do
  3246.     rpath="$rpath$dir:"
  3247.   done
  3248.   compile_var="$runpath_var="$rpath$$runpath_var" "
  3249. fi
  3250. if test -n "$finalize_perm_rpath"; then
  3251.   # We should set the runpath_var.
  3252.   rpath=
  3253.   for dir in $finalize_perm_rpath; do
  3254.     rpath="$rpath$dir:"
  3255.   done
  3256.   finalize_var="$runpath_var="$rpath$$runpath_var" "
  3257. fi
  3258.       fi
  3259.       if test "$no_install" = yes; then
  3260. # We don't need to create a wrapper script.
  3261. link_command="$compile_var$compile_command$compile_rpath"
  3262. # Replace the output file specification.
  3263. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  3264. # Delete the old output file.
  3265. $opt_dry_run || $RM $output
  3266. # Link the executable and exit
  3267. func_show_eval "$link_command" 'exit $?'
  3268. exit $EXIT_SUCCESS
  3269.       fi
  3270.       if test "$hardcode_action" = relink; then
  3271. # Fast installation is not supported
  3272. link_command="$compile_var$compile_command$compile_rpath"
  3273. relink_command="$finalize_var$finalize_command$finalize_rpath"
  3274. func_warning "this platform does not like uninstalled shared libraries"
  3275. func_warning "`$output' will be relinked during installation"
  3276.       else
  3277. if test "$fast_install" != no; then
  3278.   link_command="$finalize_var$compile_command$finalize_rpath"
  3279.   if test "$fast_install" = yes; then
  3280.     relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%$progdir/$file%g'`
  3281.   else
  3282.     # fast_install is set to needless
  3283.     relink_command=
  3284.   fi
  3285. else
  3286.   link_command="$compile_var$compile_command$compile_rpath"
  3287.   relink_command="$finalize_var$finalize_command$finalize_rpath"
  3288. fi
  3289.       fi
  3290.       # Replace the output file specification.
  3291.       link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3292.       # Delete the old output files.
  3293.       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  3294.       func_show_eval "$link_command" 'exit $?'
  3295.       # Now create the wrapper script.
  3296.       func_verbose "creating $output"
  3297.       # Quote the relink command for shipping.
  3298.       if test -n "$relink_command"; then
  3299. # Preserve any variables that may affect compiler behavior
  3300. for var in $variables_saved_for_relink; do
  3301.   if eval test -z "${$var+set}"; then
  3302.     relink_command="{ test -z "${$var+set}" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  3303.   elif eval var_value=$$var; test -z "$var_value"; then
  3304.     relink_command="$var=; export $var; $relink_command"
  3305.   else
  3306.     func_quote_for_eval "$var_value"
  3307.     relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  3308.   fi
  3309. done
  3310. relink_command="(cd `pwd`; $relink_command)"
  3311. relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3312.       fi
  3313.       # Quote $ECHO for shipping.
  3314.       if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
  3315. case $progpath in
  3316. [\/]* | [A-Za-z]:[\/]*) qecho="$SHELL $progpath --fallback-echo";;
  3317. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  3318. esac
  3319. qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
  3320.       else
  3321. qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
  3322.       fi
  3323.       # Only actually do things if not in dry run mode.
  3324.       $opt_dry_run || {
  3325. # win32 will think the script is a binary if it has
  3326. # a .exe suffix, so we strip it off here.
  3327. case $output in
  3328.   *.exe) func_stripname '' '.exe' "$output"
  3329.          output=$func_stripname_result ;;
  3330. esac
  3331. # test for cygwin because mv fails w/o .exe extensions
  3332. case $host in
  3333.   *cygwin*)
  3334.     exeext=.exe
  3335.     func_stripname '' '.exe' "$outputname"
  3336.     outputname=$func_stripname_result ;;
  3337.   *) exeext= ;;
  3338. esac
  3339. case $host in
  3340.   *cygwin* | *mingw* )
  3341.     func_dirname_and_basename "$output" "" "."
  3342.     output_name=$func_basename_result
  3343.     output_path=$func_dirname_result
  3344.     cwrappersource="$output_path/$objdir/lt-$output_name.c"
  3345.     cwrapper="$output_path/$output_name.exe"
  3346.     $RM $cwrappersource $cwrapper
  3347.     trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  3348.     func_emit_cwrapperexe_src > $cwrappersource
  3349.     # The wrapper executable is built using the $host compiler,
  3350.     # because it contains $host paths and files. If cross-
  3351.     # compiling, it, like the target executable, must be
  3352.     # executed on the $host or under an emulation environment.
  3353.     $opt_dry_run || {
  3354.       $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  3355.       $STRIP $cwrapper
  3356.     }
  3357.     # Now, create the wrapper script for func_source use:
  3358.     func_ltwrapper_scriptname $cwrapper
  3359.     $RM $func_ltwrapper_scriptname_result
  3360.     trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  3361.     $opt_dry_run || {
  3362.       # note: this script will not be executed, so do not chmod.
  3363.       if test "x$build" = "x$host" ; then
  3364. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  3365.       else
  3366. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  3367.       fi
  3368.     }
  3369.   ;;
  3370.   * )
  3371.     $RM $output
  3372.     trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  3373.     func_emit_wrapper no > $output
  3374.     chmod +x $output
  3375.   ;;
  3376. esac
  3377.       }
  3378.       exit $EXIT_SUCCESS
  3379.       ;;
  3380.     esac
  3381.     # See if we need to build an old-fashioned archive.
  3382.     for oldlib in $oldlibs; do
  3383.       if test "$build_libtool_libs" = convenience; then
  3384. oldobjs="$libobjs_save $symfileobj"
  3385. addlibs="$convenience"
  3386. build_libtool_libs=no
  3387.       else
  3388. if test "$build_libtool_libs" = module; then
  3389.   oldobjs="$libobjs_save"
  3390.   build_libtool_libs=no
  3391. else
  3392.   oldobjs="$old_deplibs $non_pic_objects"
  3393.   if test "$preload" = yes && test -f "$symfileobj"; then
  3394.     oldobjs="$oldobjs $symfileobj"
  3395.   fi
  3396. fi
  3397. addlibs="$old_convenience"
  3398.       fi
  3399.       if test -n "$addlibs"; then
  3400. gentop="$output_objdir/${outputname}x"
  3401. generated="$generated $gentop"
  3402. func_extract_archives $gentop $addlibs
  3403. oldobjs="$oldobjs $func_extract_archives_result"
  3404.       fi
  3405.       # Do each command in the archive commands.
  3406.       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3407. cmds=$old_archive_from_new_cmds
  3408.       else
  3409. # Add any objects from preloaded convenience libraries
  3410. if test -n "$dlprefiles"; then
  3411.   gentop="$output_objdir/${outputname}x"
  3412.   generated="$generated $gentop"
  3413.   func_extract_archives $gentop $dlprefiles
  3414.   oldobjs="$oldobjs $func_extract_archives_result"
  3415. fi
  3416. # POSIX demands no paths to be encoded in archives.  We have
  3417. # to avoid creating archives with duplicate basenames if we
  3418. # might have to extract them afterwards, e.g., when creating a
  3419. # static archive out of a convenience library, or when linking
  3420. # the entirety of a libtool archive into another (currently
  3421. # not supported by libtool).
  3422. if (for obj in $oldobjs
  3423.     do
  3424.       func_basename "$obj"
  3425.       $ECHO "$func_basename_result"
  3426.     done | sort | sort -uc >/dev/null 2>&1); then
  3427.   :
  3428. else
  3429.   $ECHO "copying selected object files to avoid basename conflicts..."
  3430.   gentop="$output_objdir/${outputname}x"
  3431.   generated="$generated $gentop"
  3432.   func_mkdir_p "$gentop"
  3433.   save_oldobjs=$oldobjs
  3434.   oldobjs=
  3435.   counter=1
  3436.   for obj in $save_oldobjs
  3437.   do
  3438.     func_basename "$obj"
  3439.     objbase="$func_basename_result"
  3440.     case " $oldobjs " in
  3441.     " ") oldobjs=$obj ;;
  3442.     *[ /]"$objbase "*)
  3443.       while :; do
  3444. # Make sure we don't pick an alternate name that also
  3445. # overlaps.
  3446. newobj=lt$counter-$objbase
  3447. func_arith $counter + 1
  3448. counter=$func_arith_result
  3449. case " $oldobjs " in
  3450. *[ /]"$newobj "*) ;;
  3451. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  3452. esac
  3453.       done
  3454.       func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  3455.       oldobjs="$oldobjs $gentop/$newobj"
  3456.       ;;
  3457.     *) oldobjs="$oldobjs $obj" ;;
  3458.     esac
  3459.   done
  3460. fi
  3461. eval cmds="$old_archive_cmds"
  3462. func_len " $cmds"
  3463. len=$func_len_result
  3464. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3465.   cmds=$old_archive_cmds
  3466. else
  3467.   # the command line is too long to link in one step, link in parts
  3468.   func_verbose "using piecewise archive linking..."
  3469.   save_RANLIB=$RANLIB
  3470.   RANLIB=:
  3471.   objlist=
  3472.   concat_cmds=
  3473.   save_oldobjs=$oldobjs
  3474.   oldobjs=
  3475.   # Is there a better way of finding the last object in the list?
  3476.   for obj in $save_oldobjs
  3477.   do
  3478.     last_oldobj=$obj
  3479.   done
  3480.   eval test_cmds="$old_archive_cmds"
  3481.   func_len " $test_cmds"
  3482.   len0=$func_len_result
  3483.   len=$len0
  3484.   for obj in $save_oldobjs
  3485.   do
  3486.     func_len " $obj"
  3487.     func_arith $len + $func_len_result
  3488.     len=$func_arith_result
  3489.     func_append objlist " $obj"
  3490.     if test "$len" -lt "$max_cmd_len"; then
  3491.       :
  3492.     else
  3493.       # the above command should be used before it gets too long
  3494.       oldobjs=$objlist
  3495.       if test "$obj" = "$last_oldobj" ; then
  3496. RANLIB=$save_RANLIB
  3497.       fi
  3498.       test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3499.       eval concat_cmds="${concat_cmds}$old_archive_cmds"
  3500.       objlist=
  3501.       len=$len0
  3502.     fi
  3503.   done
  3504.   RANLIB=$save_RANLIB
  3505.   oldobjs=$objlist
  3506.   if test "X$oldobjs" = "X" ; then
  3507.     eval cmds="$concat_cmds"
  3508.   else
  3509.     eval cmds="$concat_cmds~$old_archive_cmds"
  3510.   fi
  3511. fi
  3512.       fi
  3513.       func_execute_cmds "$cmds" 'exit $?'
  3514.     done
  3515.     test -n "$generated" && 
  3516.       func_show_eval "${RM}r$generated"
  3517.     # Now create the libtool archive.
  3518.     case $output in
  3519.     *.la)
  3520.       old_library=
  3521.       test "$build_old_libs" = yes && old_library="$libname.$libext"
  3522.       func_verbose "creating $output"
  3523.       # Preserve any variables that may affect compiler behavior
  3524.       for var in $variables_saved_for_relink; do
  3525. if eval test -z "${$var+set}"; then
  3526.   relink_command="{ test -z "${$var+set}" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  3527. elif eval var_value=$$var; test -z "$var_value"; then
  3528.   relink_command="$var=; export $var; $relink_command"
  3529. else
  3530.   func_quote_for_eval "$var_value"
  3531.   relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  3532. fi
  3533.       done
  3534.       # Quote the link command for shipping.
  3535.       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  3536.       relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3537.       if test "$hardcode_automatic" = yes ; then
  3538. relink_command=
  3539.       fi
  3540.       # Only create the output if not a dry run.
  3541.       $opt_dry_run || {
  3542. for installed in no yes; do
  3543.   if test "$installed" = yes; then
  3544.     if test -z "$install_libdir"; then
  3545.       break
  3546.     fi
  3547.     output="$output_objdir/$outputname"i
  3548.     # Replace all uninstalled libtool libraries with the installed ones
  3549.     newdependency_libs=
  3550.     for deplib in $dependency_libs; do
  3551.       case $deplib in
  3552.       *.la)
  3553. func_basename "$deplib"
  3554. name="$func_basename_result"
  3555. eval libdir=`${SED} -n -e 's/^libdir=(.*)$/1/p' $deplib`
  3556. test -z "$libdir" && 
  3557.   func_fatal_error "`$deplib' is not a valid libtool archive"
  3558. newdependency_libs="$newdependency_libs $libdir/$name"
  3559. ;;
  3560.       *) newdependency_libs="$newdependency_libs $deplib" ;;
  3561.       esac
  3562.     done
  3563.     dependency_libs="$newdependency_libs"
  3564.     newdlfiles=
  3565.     for lib in $dlfiles; do
  3566.       case $lib in
  3567.       *.la)
  3568.         func_basename "$lib"
  3569. name="$func_basename_result"
  3570. eval libdir=`${SED} -n -e 's/^libdir=(.*)$/1/p' $lib`
  3571. test -z "$libdir" && 
  3572.   func_fatal_error "`$lib' is not a valid libtool archive"
  3573. newdlfiles="$newdlfiles $libdir/$name"
  3574. ;;
  3575.       *) newdlfiles="$newdlfiles $lib" ;;
  3576.       esac
  3577.     done
  3578.     dlfiles="$newdlfiles"
  3579.     newdlprefiles=
  3580.     for lib in $dlprefiles; do
  3581.       case $lib in
  3582.       *.la)
  3583. # Only pass preopened files to the pseudo-archive (for
  3584. # eventual linking with the app. that links it) if we
  3585. # didn't already link the preopened objects directly into
  3586. # the library:
  3587. func_basename "$lib"
  3588. name="$func_basename_result"
  3589. eval libdir=`${SED} -n -e 's/^libdir=(.*)$/1/p' $lib`
  3590. test -z "$libdir" && 
  3591.   func_fatal_error "`$lib' is not a valid libtool archive"
  3592. newdlprefiles="$newdlprefiles $libdir/$name"
  3593. ;;
  3594.       esac
  3595.     done
  3596.     dlprefiles="$newdlprefiles"
  3597.   else
  3598.     newdlfiles=
  3599.     for lib in $dlfiles; do
  3600.       case $lib in
  3601. [\/]* | [A-Za-z]:[\/]*) abs="$lib" ;;
  3602. *) abs=`pwd`"/$lib" ;;
  3603.       esac
  3604.       newdlfiles="$newdlfiles $abs"
  3605.     done
  3606.     dlfiles="$newdlfiles"
  3607.     newdlprefiles=
  3608.     for lib in $dlprefiles; do
  3609.       case $lib in
  3610. [\/]* | [A-Za-z]:[\/]*) abs="$lib" ;;
  3611. *) abs=`pwd`"/$lib" ;;
  3612.       esac
  3613.       newdlprefiles="$newdlprefiles $abs"
  3614.     done
  3615.     dlprefiles="$newdlprefiles"
  3616.   fi
  3617.   $RM $output
  3618.   # place dlname in correct position for cygwin
  3619.   tdlname=$dlname
  3620.   case $host,$output,$installed,$module,$dlname in
  3621.     *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  3622.   esac
  3623.   $ECHO > $output "
  3624. # $outputname - a libtool library file
  3625. # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  3626. #
  3627. # Please DO NOT delete this file!
  3628. # It is necessary for linking the library.
  3629. # The name that we can dlopen(3).
  3630. dlname='$tdlname'
  3631. # Names of this library.
  3632. library_names='$library_names'
  3633. # The name of the static archive.
  3634. old_library='$old_library'
  3635. # Linker flags that can not go in dependency_libs.
  3636. inherited_linker_flags='$new_inherited_linker_flags'
  3637. # Libraries that this one depends upon.
  3638. dependency_libs='$dependency_libs'
  3639. # Names of additional weak libraries provided by this library
  3640. weak_library_names='$weak_libs'
  3641. # Version information for $libname.
  3642. current=$current
  3643. age=$age
  3644. revision=$revision
  3645. # Is this an already installed library?
  3646. installed=$installed
  3647. # Should we warn about portability when linking against -modules?
  3648. shouldnotlink=$module
  3649. # Files to dlopen/dlpreopen
  3650. dlopen='$dlfiles'
  3651. dlpreopen='$dlprefiles'
  3652. # Directory that this library needs to be installed in:
  3653. libdir='$install_libdir'"
  3654.   if test "$installed" = no && test "$need_relink" = yes; then
  3655.     $ECHO >> $output "
  3656. relink_command="$relink_command""
  3657.   fi
  3658. done
  3659.       }
  3660.       # Do a symbolic link so that the libtool archive can be found in
  3661.       # LD_LIBRARY_PATH before the program is installed.
  3662.       func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  3663.       ;;
  3664.     esac
  3665.     exit $EXIT_SUCCESS
  3666. }
  3667. { test "$mode" = link || test "$mode" = relink; } &&
  3668.     func_mode_link ${1+"$@"}
  3669. # func_mode_uninstall arg...
  3670. func_mode_uninstall ()
  3671. {
  3672.     $opt_debug
  3673.     RM="$nonopt"
  3674.     files=
  3675.     rmforce=
  3676.     exit_status=0
  3677.     # This variable tells wrapper scripts just to set variables rather
  3678.     # than running their programs.
  3679.     libtool_install_magic="$magic"
  3680.     for arg
  3681.     do
  3682.       case $arg in
  3683.       -f) RM="$RM $arg"; rmforce=yes ;;
  3684.       -*) RM="$RM $arg" ;;
  3685.       *) files="$files $arg" ;;
  3686.       esac
  3687.     done
  3688.     test -z "$RM" && 
  3689.       func_fatal_help "you must specify an RM program"
  3690.     rmdirs=
  3691.     origobjdir="$objdir"
  3692.     for file in $files; do
  3693.       func_dirname "$file" "" "."
  3694.       dir="$func_dirname_result"
  3695.       if test "X$dir" = X.; then
  3696. objdir="$origobjdir"
  3697.       else
  3698. objdir="$dir/$origobjdir"
  3699.       fi
  3700.       func_basename "$file"
  3701.       name="$func_basename_result"
  3702.       test "$mode" = uninstall && objdir="$dir"
  3703.       # Remember objdir for removal later, being careful to avoid duplicates
  3704.       if test "$mode" = clean; then
  3705. case " $rmdirs " in
  3706.   *" $objdir "*) ;;
  3707.   *) rmdirs="$rmdirs $objdir" ;;
  3708. esac
  3709.       fi
  3710.       # Don't error if the file doesn't exist and rm -f was used.
  3711.       if { test -L "$file"; } >/dev/null 2>&1 ||
  3712.  { test -h "$file"; } >/dev/null 2>&1 ||
  3713.  test -f "$file"; then
  3714. :
  3715.       elif test -d "$file"; then
  3716. exit_status=1
  3717. continue
  3718.       elif test "$rmforce" = yes; then
  3719. continue
  3720.       fi
  3721.       rmfiles="$file"
  3722.       case $name in
  3723.       *.la)
  3724. # Possibly a libtool archive, so verify it.
  3725. if func_lalib_p "$file"; then
  3726.   func_source $dir/$name
  3727.   # Delete the libtool libraries and symlinks.
  3728.   for n in $library_names; do
  3729.     rmfiles="$rmfiles $objdir/$n"
  3730.   done
  3731.   test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  3732.   case "$mode" in
  3733.   clean)
  3734.     case "  $library_names " in
  3735.     # "  " in the beginning catches empty $dlname
  3736.     *" $dlname "*) ;;
  3737.     *) rmfiles="$rmfiles $objdir/$dlname" ;;
  3738.     esac
  3739.     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  3740.     ;;
  3741.   uninstall)
  3742.     if test -n "$library_names"; then
  3743.       # Do each command in the postuninstall commands.
  3744.       func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  3745.     fi
  3746.     if test -n "$old_library"; then
  3747.       # Do each command in the old_postuninstall commands.
  3748.       func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  3749.     fi
  3750.     # FIXME: should reinstall the best remaining shared library.
  3751.     ;;
  3752.   esac
  3753. fi
  3754. ;;
  3755.       *.lo)
  3756. # Possibly a libtool object, so verify it.
  3757. if func_lalib_p "$file"; then
  3758.   # Read the .lo file
  3759.   func_source $dir/$name
  3760.   # Add PIC object to the list of files to remove.
  3761.   if test -n "$pic_object" &&
  3762.      test "$pic_object" != none; then
  3763.     rmfiles="$rmfiles $dir/$pic_object"
  3764.   fi
  3765.   # Add non-PIC object to the list of files to remove.
  3766.   if test -n "$non_pic_object" &&
  3767.      test "$non_pic_object" != none; then
  3768.     rmfiles="$rmfiles $dir/$non_pic_object"
  3769.   fi
  3770. fi
  3771. ;;
  3772.       *)
  3773. if test "$mode" = clean ; then
  3774.   noexename=$name
  3775.   case $file in
  3776.   *.exe)
  3777.     func_stripname '' '.exe' "$file"
  3778.     file=$func_stripname_result
  3779.     func_stripname '' '.exe' "$name"
  3780.     noexename=$func_stripname_result
  3781.     # $file with .exe has already been added to rmfiles,
  3782.     # add $file without .exe
  3783.     rmfiles="$rmfiles $file"
  3784.     ;;
  3785.   esac
  3786.   # Do a test to see if this is a libtool program.
  3787.   if func_ltwrapper_p "$file"; then
  3788.     if func_ltwrapper_executable_p "$file"; then
  3789.       func_ltwrapper_scriptname "$file"
  3790.       relink_command=
  3791.       func_source $func_ltwrapper_scriptname_result
  3792.       rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
  3793.     else
  3794.       relink_command=
  3795.       func_source $dir/$noexename
  3796.     fi
  3797.     # note $name still contains .exe if it was in $file originally
  3798.     # as does the version of $file that was added into $rmfiles
  3799.     rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  3800.     if test "$fast_install" = yes && test -n "$relink_command"; then
  3801.       rmfiles="$rmfiles $objdir/lt-$name"
  3802.     fi
  3803.     if test "X$noexename" != "X$name" ; then
  3804.       rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  3805.     fi
  3806.   fi
  3807. fi
  3808. ;;
  3809.       esac
  3810.       func_show_eval "$RM $rmfiles" 'exit_status=1'
  3811.     done
  3812.     objdir="$origobjdir"
  3813.     # Try to remove the ${objdir}s in the directories where we deleted files
  3814.     for dir in $rmdirs; do
  3815.       if test -d "$dir"; then
  3816. func_show_eval "rmdir $dir >/dev/null 2>&1"
  3817.       fi
  3818.     done
  3819.     exit $exit_status
  3820. }
  3821. { test "$mode" = uninstall || test "$mode" = clean; } &&
  3822.     func_mode_uninstall ${1+"$@"}
  3823. test -z "$mode" && {
  3824.   help="$generic_help"
  3825.   func_fatal_help "you must specify a MODE"
  3826. }
  3827. test -z "$exec_cmd" && 
  3828.   func_fatal_help "invalid operation mode `$mode'"
  3829. if test -n "$exec_cmd"; then
  3830.   eval exec "$exec_cmd"
  3831.   exit $EXIT_FAILURE
  3832. fi
  3833. exit $exit_status
  3834. # The TAGs below are defined such that we never get into a situation
  3835. # in which we disable both kinds of libraries.  Given conflicting
  3836. # choices, we go for a static library, that is the most portable,
  3837. # since we can't tell whether shared libraries were disabled because
  3838. # the user asked for that or because the platform doesn't support
  3839. # them.  This is particularly important on AIX, because we don't
  3840. # support having both static and shared libraries enabled at the same
  3841. # time on that platform, so we default to a shared-only configuration.
  3842. # If a disable-shared tag is given, we'll fallback to a static-only
  3843. # configuration.  But we'll never go from static-only to shared-only.
  3844. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  3845. build_libtool_libs=no
  3846. build_old_libs=yes
  3847. # ### END LIBTOOL TAG CONFIG: disable-shared
  3848. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  3849. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  3850. # ### END LIBTOOL TAG CONFIG: disable-static
  3851. # Local Variables:
  3852. # mode:shell-script
  3853. # sh-indentation:2
  3854. # End:
  3855. # vi:sw=2