ltmain.sh
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:72k
源码类别:

mpeg/mp3

开发平台:

C/C++

  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  3. #
  4. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  5. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. # As a special exception to the GNU General Public License, if you
  22. # distribute this file as part of a program that contains a
  23. # configuration script generated by Autoconf, you may include it under
  24. # the same distribution terms that you use for the rest of that program.
  25. # Check that we have a working $echo.
  26. if test "X$1" = X--no-reexec; then
  27.   # Discard the --no-reexec flag, and continue.
  28.   shift
  29. elif test "X`($echo 't') 2>/dev/null`" = 'Xt'; then
  30.   # Yippee, $echo works!
  31.   :
  32. else
  33.   # Restart under the correct shell, and then maybe $echo will work.
  34.   exec $SHELL "$0" --no-reexec ${1+"$@"}
  35. fi
  36. # The name of this program.
  37. progname=`$echo "$0" | sed 's%^.*/%%'`
  38. modename="$progname"
  39. # Constants.
  40. PROGRAM=ltmain.sh
  41. PACKAGE=libtool
  42. VERSION=1.2b
  43. default_mode=
  44. help="Try `$progname --help' for more information."
  45. magic="%%%MAGIC variable%%%"
  46. mkdir="mkdir"
  47. mv="mv -f"
  48. rm="rm -f"
  49. # Sed substitution that helps us do robust quoting.  It backslashifies
  50. # metacharacters that are still active within double-quoted strings.
  51. Xsed='sed -e s/^X//'
  52. sed_quote_subst='s/([\`\"$\\])/\1/g'
  53. # NLS nuisances.
  54. # Only set LANG and LC_ALL to C if already set.
  55. # These must not be set unconditionally because not all systems understand
  56. # e.g. LANG=C (notably SCO).
  57. # We save the old values to restore during execute mode.
  58. if test "${LC_ALL+set}" = set; then
  59.   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  60. fi
  61. if test "${LANG+set}" = set; then
  62.   save_LANG="$LANG"; LANG=C; export LANG
  63. fi
  64. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  65.   echo "$modename: ltconfig version `$LTCONFIG_VERSION' does not match $PROGRAM version `$VERSION'" 1>&2
  66.   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  67.   exit 1
  68. fi
  69. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  70.   echo "$modename: not configured to build any kind of library" 1>&2
  71.   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  72.   exit 1
  73. fi
  74. # Global variables.
  75. mode=$default_mode
  76. nonopt=
  77. prev=
  78. prevopt=
  79. run=
  80. show="$echo"
  81. show_help=
  82. execute_dlfiles=
  83. # Parse our command line options once, thoroughly.
  84. while test $# -gt 0
  85. do
  86.   arg="$1"
  87.   shift
  88.   case "$arg" in
  89.   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  90.   *) optarg= ;;
  91.   esac
  92.   # If the previous option needs an argument, assign it.
  93.   if test -n "$prev"; then
  94.     case "$prev" in
  95.     execute_dlfiles)
  96.       eval "$prev="$$prev $arg""
  97.       ;;
  98.     *)
  99.       eval "$prev=$arg"
  100.       ;;
  101.     esac
  102.     prev=
  103.     prevopt=
  104.     continue
  105.   fi
  106.   # Have we seen a non-optional argument yet?
  107.   case "$arg" in
  108.   --help)
  109.     show_help=yes
  110.     ;;
  111.   --version)
  112.     echo "$PROGRAM (GNU $PACKAGE) $VERSION"
  113.     exit 0
  114.     ;;
  115.   --config)
  116.     sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  117.     exit 0
  118.     ;;
  119.   --debug)
  120.     echo "$progname: enabling shell trace mode"
  121.     set -x
  122.     ;;
  123.   --dry-run | -n)
  124.     run=:
  125.     ;;
  126.   --features)
  127.     echo "host: $host"
  128.     if test "$build_libtool_libs" = yes; then
  129.       echo "enable shared libraries"
  130.     else
  131.       echo "disable shared libraries"
  132.     fi
  133.     if test "$build_old_libs" = yes; then
  134.       echo "enable static libraries"
  135.     else
  136.       echo "disable static libraries"
  137.     fi
  138.     exit 0
  139.     ;;
  140.   --finish) mode="finish" ;;
  141.   --mode) prevopt="--mode" prev=mode ;;
  142.   --mode=*) mode="$optarg" ;;
  143.   --quiet | --silent)
  144.     show=:
  145.     ;;
  146.   -dlopen)
  147.     prevopt="-dlopen"
  148.     prev=execute_dlfiles
  149.     ;;
  150.   -*)
  151.     $echo "$modename: unrecognized option `$arg'" 1>&2
  152.     $echo "$help" 1>&2
  153.     exit 1
  154.     ;;
  155.   *)
  156.     nonopt="$arg"
  157.     break
  158.     ;;
  159.   esac
  160. done
  161. if test -n "$prevopt"; then
  162.   $echo "$modename: option `$prevopt' requires an argument" 1>&2
  163.   $echo "$help" 1>&2
  164.   exit 1
  165. fi
  166. if test -z "$show_help"; then
  167.   # Infer the operation mode.
  168.   if test -z "$mode"; then
  169.     case "$nonopt" in
  170.     *cc | *++ | gcc* | *-gcc*)
  171.       mode=link
  172.       for arg
  173.       do
  174.         case "$arg" in
  175.         -c)
  176.            mode=compile
  177.            break
  178.            ;;
  179.         esac
  180.       done
  181.       ;;
  182.     *db | *dbx | *strace | *truss)
  183.       mode=execute
  184.       ;;
  185.     *install*|cp|mv)
  186.       mode=install
  187.       ;;
  188.     *rm)
  189.       mode=uninstall
  190.       ;;
  191.     *)
  192.       # If we have no mode, but dlfiles were specified, then do execute mode.
  193.       test -n "$execute_dlfiles" && mode=execute
  194.       # Just use the default operation mode.
  195.       if test -z "$mode"; then
  196.         if test -n "$nonopt"; then
  197.           $echo "$modename: warning: cannot infer operation mode from `$nonopt'" 1>&2
  198.         else
  199.           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  200.         fi
  201.       fi
  202.       ;;
  203.     esac
  204.   fi
  205.   # Only execute mode is allowed to have -dlopen flags.
  206.   if test -n "$execute_dlfiles" && test "$mode" != execute; then
  207.     $echo "$modename: unrecognized option `-dlopen'" 1>&2
  208.     $echo "$help" 1>&2
  209.     exit 1
  210.   fi
  211.   # Change the help message to a mode-specific one.
  212.   generic_help="$help"
  213.   help="Try `$modename --help --mode=$mode' for more information."
  214.   # These modes are in order of execution frequency so that they run quickly.
  215.   case "$mode" in
  216.   # libtool compile mode
  217.   compile)
  218.     modename="$modename: compile"
  219.     # Get the compilation command and the source file.
  220.     base_compile=
  221.     lastarg=
  222.     srcfile="$nonopt"
  223.     suppress_output=
  224.     for arg
  225.     do
  226.       # Accept any command-line options.
  227.       case "$arg" in
  228.       -o)
  229. $echo "$modename: you cannot specify the output filename with `-o'" 1>&2
  230. $echo "$help" 1>&2
  231. exit 1
  232. ;;
  233.       -static)
  234. build_old_libs=yes
  235. continue
  236. ;;
  237.       esac
  238.       # Accept the current argument as the source file.
  239.       lastarg="$srcfile"
  240.       srcfile="$arg"
  241.       # Aesthetically quote the previous argument.
  242.       # Backslashify any backslashes, double quotes, and dollar signs.
  243.       # These are the only characters that are still specially
  244.       # interpreted inside of double-quoted scrings.
  245.       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  246.       # Double-quote args containing other shell metacharacters.
  247.       # Many Bourne shells cannot handle close brackets correctly in scan
  248.       # sets, so we specify it separately.
  249.       case "$lastarg" in
  250.       *[[~#^&*(){}|;<>?'  ]*|*]*)
  251. lastarg=""$lastarg""
  252. ;;
  253.       esac
  254.       # Add the previous argument to base_compile.
  255.       if test -z "$base_compile"; then
  256. base_compile="$lastarg"
  257.       else
  258. base_compile="$base_compile $lastarg"
  259.       fi
  260.     done
  261.     # Get the name of the library object.
  262.     libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  263.     # Recognize several different file suffixes.
  264.     xform='[cCFSfms]'
  265.     case "$libobj" in
  266.     *.ada) xform=ada ;;
  267.     *.adb) xform=adb ;;
  268.     *.ads) xform=ads ;;
  269.     *.asm) xform=asm ;;
  270.     *.c++) xform=c++ ;;
  271.     *.cc) xform=cc ;;
  272.     *.cpp) xform=cpp ;;
  273.     *.cxx) xform=cxx ;;
  274.     *.f90) xform=f90 ;;
  275.     *.for) xform=for ;;
  276.     esac
  277.     libobj=`$echo "X$libobj" | $Xsed -e "s/.$xform$/.lo/"`
  278.     case "$libobj" in
  279.     *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/.lo$/.o/'` ;;
  280.     *)
  281.       $echo "$modename: cannot determine name of library object from `$srcfile'" 1>&2
  282.       exit 1
  283.       ;;
  284.     esac
  285.     if test -z "$base_compile"; then
  286.       $echo "$modename: you must specify a compilation command" 1>&2
  287.       $echo "$help" 1>&2
  288.       exit 1
  289.     fi
  290.     # Delete any leftover library objects.
  291.     if test "$build_old_libs" = yes; then
  292.       $run $rm $obj $libobj
  293.       trap "$run $rm $obj $libobj; exit 1" 1 2 15
  294.     else
  295.       $run $rm $libobj
  296.       trap "$run $rm $libobj; exit 1" 1 2 15
  297.     fi
  298.     # Only build a PIC object if we are building libtool libraries.
  299.     if test "$build_libtool_libs" = yes; then
  300.       # Without this assignment, base_compile gets emptied.
  301.       fbsd_hideous_sh_bug=$base_compile
  302.       # All platforms use -DPIC, to notify preprocessed assembler code.
  303.       $show "$base_compile$pic_flag -DPIC $srcfile"
  304.       if $run eval "$base_compile$pic_flag -DPIC $srcfile"; then :
  305.       else
  306.         test -n "$obj" && $run $rm $obj
  307.         exit 1
  308.       fi
  309.       # If we have no pic_flag, then copy the object into place and finish.
  310.       if test -z "$pic_flag"; then
  311.         $show "$LN_S $obj $libobj"
  312.         $run $LN_S $obj $libobj
  313.         exit $?
  314.       fi
  315.       # Just move the object, then go on to compile the next one
  316.       $show "$mv $obj $libobj"
  317.       $run $mv $obj $libobj || exit $?
  318.       # Allow error messages only from the first compilation.
  319.       suppress_output=' >/dev/null 2>&1'
  320.     fi
  321.     # Only build a position-dependent object if we build old libraries.
  322.     if test "$build_old_libs" = yes; then
  323.       # Suppress compiler output if we already did a PIC compilation.
  324.       $show "$base_compile $srcfile$suppress_output"
  325.       if $run eval "$base_compile $srcfile$suppress_output"; then :
  326.       else
  327.         $run $rm $obj $libobj
  328.         exit 1
  329.       fi
  330.     fi
  331.     # Create an invalid libtool object if no PIC, so that we do not
  332.     # accidentally link it into a program.
  333.     if test "$build_libtool_libs" != yes; then
  334.       $show "echo timestamp > $libobj"
  335.       $run eval "echo timestamp > $libobj" || exit $?
  336.     fi
  337.     exit 0
  338.     ;;
  339.   # libtool link mode
  340.   link)
  341.     modename="$modename: link"
  342.     CC="$nonopt"
  343.     allow_undefined=yes
  344.     compile_command="$CC"
  345.     finalize_command="$CC"
  346.     compile_shlibpath=
  347.     finalize_shlibpath=
  348.     convenience=
  349.     old_convenience=
  350.     deplibs=
  351.     dlfiles=
  352.     dlprefiles=
  353.     export_dynamic=no
  354.     generated=
  355.     hardcode_libdirs=
  356.     libobjs=
  357.     link_against_libtool_libs=
  358.     ltlibs=
  359.     objs=
  360.     prev=
  361.     prevarg=
  362.     release=
  363.     rpath=
  364.     perm_rpath=
  365.     temp_rpath=
  366.     vinfo=
  367.     # We need to know -static, to get the right output filenames.
  368.     for arg
  369.     do
  370.       case "$arg" in
  371.       -all-static | -static)
  372.         if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  373.     $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  374.         fi
  375.         build_libtool_libs=no
  376. build_old_libs=yes
  377.         break
  378.         ;;
  379.       esac
  380.     done
  381.     # See if our shared archives depend on static archives.
  382.     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  383.     # Go through the arguments, transforming them on the way.
  384.     while test $# -gt 0; do
  385.       arg="$1"
  386.       shift
  387.       # If the previous option needs an argument, assign it.
  388.       if test -n "$prev"; then
  389.         case "$prev" in
  390.         output)
  391.           compile_command="$compile_command @OUTPUT@"
  392.           finalize_command="$finalize_command @OUTPUT@"
  393.           ;;
  394.         esac
  395.         case "$prev" in
  396.         dlfiles|dlprefiles)
  397.           case "$arg" in
  398.           *.la | *.lo) ;;  # We handle these cases below.
  399.           *)
  400.             dlprefiles="$dlprefiles $arg"
  401.             test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  402.             prev=
  403.             ;;
  404.           esac
  405.           ;;
  406. release)
  407.   release="-$arg"
  408.   prev=
  409.   continue
  410.   ;;
  411.         rpath)
  412.           rpath="$rpath $arg"
  413.   prev=
  414.   continue
  415.   ;;
  416.         *)
  417.           eval "$prev="$arg""
  418.           prev=
  419.           continue
  420.           ;;
  421.         esac
  422.       fi
  423.       prevarg="$arg"
  424.       case "$arg" in
  425.       -all-static)
  426. if test -n "$link_static_flag"; then
  427.           compile_command="$compile_command $link_static_flag"
  428.   finalize_command="$finalize_command $link_static_flag"
  429.         fi
  430.         continue
  431. ;;
  432.       -allow-undefined)
  433. # FIXME: remove this flag sometime in the future.
  434. $echo "$modename: `-allow-undefined' is deprecated because it is the default" 1>&2
  435. continue
  436. ;;
  437.       -dlopen)
  438.         prev=dlfiles
  439.         continue
  440.         ;;
  441.       -dlpreopen)
  442.         prev=dlprefiles
  443.         continue
  444.         ;;
  445.       -export-dynamic)
  446.         if test "$export_dynamic" != yes; then
  447.           export_dynamic=yes
  448.   if test -n "$export_dynamic_flag_spec"; then
  449.     eval arg="$export_dynamic_flag_spec"
  450.   else
  451.     arg=
  452.   fi
  453.           # Add the symbol object into the linking commands.
  454.   compile_command="$compile_command @SYMFILE@"
  455.   finalize_command="$finalize_command @SYMFILE@"
  456.         fi
  457.         ;;
  458.       -L*)
  459.         dir=`$echo "X$arg" | $Xsed -e 's%^-L(.*)$%1%'`
  460.         case "$dir" in
  461.         /* | [A-Za-z]:[/\]*)
  462.   # Add the corresponding hardcode_libdir_flag, if it is not identical.
  463.           ;;
  464.         *)
  465.           $echo "$modename: `-L$dir' cannot specify a relative directory" 1>&2
  466.           exit 1
  467.           ;;
  468.         esac
  469.         deplibs="$deplibs $arg"
  470.         ;;
  471.       -l*) deplibs="$deplibs $arg" ;;
  472.       -no-undefined)
  473. allow_undefined=no
  474. continue
  475. ;;
  476.       -o) prev=output ;;
  477.       -release)
  478. prev=release
  479. continue
  480. ;;
  481.       -rpath)
  482.         prev=rpath
  483.         continue
  484.         ;;
  485.       -static)
  486. # If we have no pic_flag, then this is the same as -all-static.
  487. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  488.           compile_command="$compile_command $link_static_flag"
  489.   finalize_command="$finalize_command $link_static_flag"
  490.         fi
  491. continue
  492. ;;
  493.       -version-info)
  494.         prev=vinfo
  495.         continue
  496.         ;;
  497.       # Some other compiler flag.
  498.       -* | +*)
  499. # Unknown arguments in both finalize_command and compile_command need
  500. # to be aesthetically quoted because they are evaled later.
  501. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  502. case "$arg" in
  503. *[[~#^&*(){}|;<>?'  ]*|*]*)
  504.   arg=""$arg""
  505.   ;;
  506. esac
  507.         ;;
  508.       *.o | *.a)
  509.         # A standard object.
  510.         objs="$objs $arg"
  511.         ;;
  512.       *.lo)
  513.         # A library object.
  514. if test "$prev" = dlfiles; then
  515.   dlfiles="$dlfiles $arg"
  516.   if test "$build_libtool_libs" = yes; then
  517.     prev=
  518.     continue
  519.   else
  520.     # If libtool objects are unsupported, then we need to preload.
  521.     prev=dlprefiles
  522.   fi
  523. fi
  524. if test "$prev" = dlprefiles; then
  525.   # Preload the old-style object.
  526.   dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/.lo$/.o/'`
  527.   prev=
  528. fi
  529. libobjs="$libobjs $arg"
  530.         ;;
  531.       *.la)
  532.         # A libtool-controlled library.
  533.         dlname=
  534.         libdir=
  535.         library_names=
  536.         old_library=
  537.         # Check to see that this really is a libtool archive.
  538.         if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  539.         else
  540.           $echo "$modename: `$arg' is not a valid libtool archive" 1>&2
  541.           exit 1
  542.         fi
  543.         # If there is no directory component, then add one.
  544.         case "$arg" in
  545.         */* | *\*) . $arg ;;
  546.         *) . ./$arg ;;
  547.         esac
  548.         # Get the name of the library we link against.
  549.         linklib=
  550.         for l in $old_library $library_names; do
  551.           linklib="$l"
  552.         done
  553.         if test -z "$linklib"; then
  554.           $echo "$modename: cannot find name of link library for `$arg'" 1>&2
  555.           exit 1
  556.         fi
  557.         # Find the relevant object directory and library name.
  558.         name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/.la$//' -e 's/^lib//'`
  559.         dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  560.         if test "X$dir" = "X$arg"; then
  561.           dir="$objdir"
  562.         else
  563.           dir="$dir/$objdir"
  564.         fi
  565.         if test -z "$libdir"; then
  566.   # It is a libtool convenience library, so add in its objects.
  567.   convenience="$convenience $dir/$old_library"l
  568.   old_convenience="$old_convenience $dir/$old_library"
  569.   compile_command="$compile_command $dir/$old_library"
  570.   finalize_command="$finalize_command $dir/$old_library"
  571.   continue
  572. fi
  573.         # This library was specified with -dlopen.
  574.         if test "$prev" = dlfiles; then
  575.           dlfiles="$dlfiles $arg"
  576.           if test -z "$dlname"; then
  577.             # If there is no dlname, we need to preload.
  578.             prev=dlprefiles
  579.           else
  580.             # We should not create a dependency on this library, but we
  581.     # may need any libraries it requires.
  582.     compile_command="$compile_command$dependency_libs"
  583.     finalize_command="$finalize_command$dependency_libs"
  584.             prev=
  585.             continue
  586.           fi
  587.         fi
  588.         # The library was specified with -dlpreopen.
  589.         if test "$prev" = dlprefiles; then
  590.           # Prefer using a static library (so that no silly _DYNAMIC symbols
  591.           # are required to link).
  592.           if test -n "$old_library"; then
  593.             dlprefiles="$dlprefiles $dir/$old_library"
  594.           else
  595.             dlprefiles="$dlprefiles $dir/$linklib"
  596.           fi
  597.           prev=
  598.         fi
  599.         if test "$build_libtool_libs" = yes && test -n "$library_names"; then
  600.           link_against_libtool_libs="$link_against_libtool_libs $arg"
  601.           if test -n "$shlibpath_var"; then
  602.             # Make sure the rpath contains only unique directories.
  603.             case "$temp_rpath " in
  604.             *" $dir "*) ;;
  605.             *) temp_rpath="$temp_rpath $dir" ;;
  606.             esac
  607.           fi
  608.   # This is the magic to use -rpath.
  609.           if test -n "$hardcode_libdir_flag_spec"; then
  610.             if test -n "$hardcode_libdir_separator"; then
  611.               if test -z "$hardcode_libdirs"; then
  612.                 # Put the magic libdir with the hardcode flag.
  613.                 hardcode_libdirs="$libdir"
  614.                 libdir="@HARDCODE_LIBDIRS@"
  615.               else
  616.                 # Just accumulate the unique libdirs.
  617. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  618. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  619.   ;;
  620. *)
  621.   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  622.   ;;
  623. esac
  624.                 libdir=
  625.               fi
  626.             fi
  627.             if test -n "$libdir"; then
  628.               eval flag="$hardcode_libdir_flag_spec"
  629.               compile_command="$compile_command $flag"
  630.               finalize_command="$finalize_command $flag"
  631.             fi
  632.           elif test -n "$runpath_var"; then
  633.             # Do the same for the permanent run path.
  634.             case "$perm_rpath " in
  635.             *" $libdir "*) ;;
  636.             *) perm_rpath="$perm_rpath $libdir" ;;
  637.             esac
  638.           fi
  639.   lib_linked=yes
  640.           case "$hardcode_action" in
  641.           immediate | unsupported)
  642.             if test "$hardcode_direct" = no; then
  643.               compile_command="$compile_command $dir/$linklib"
  644.             elif test "$hardcode_minus_L" = no; then
  645.               compile_command="$compile_command -L$dir -l$name"
  646.             elif test "$hardcode_shlibpath_var" = no; then
  647.               compile_shlibpath="$compile_shlibpath$dir:"
  648.               compile_command="$compile_command -l$name"
  649.     else
  650.       lib_linked=no
  651.             fi
  652.             ;;
  653.           relink)
  654.             # We need an absolute path.
  655.             case "$dir" in
  656.             /* | [A-Za-z]:[/\]*) ;;
  657.             *)
  658.               absdir=`cd "$dir" && pwd`
  659.               if test -z "$absdir"; then
  660.                 $echo "$modename: cannot determine absolute directory name of `$dir'" 1>&2
  661.                 exit 1
  662.               fi
  663.               dir="$absdir"
  664.               ;;
  665.             esac
  666.             if test "$hardcode_direct" = yes; then
  667.               compile_command="$compile_command $dir/$linklib"
  668.             elif test "$hardcode_minus_L" = yes; then
  669.               compile_command="$compile_command -L$dir -l$name"
  670.             elif test "$hardcode_shlibpath_var" = yes; then
  671.               compile_shlibpath="$compile_shlibpath$dir:"
  672.               compile_command="$compile_command -l$name"
  673.     else
  674.       lib_linked=no
  675.             fi
  676.             ;;
  677.   *)
  678.     lib_linked=no
  679.     ;;
  680.           esac
  681.   if test "$lib_linked" != yes; then
  682.     $echo "$modename: configuration error: unsupported hardcode properties"
  683.     exit 1
  684.   fi
  685.           # Finalize command for both is simple: just hardcode it.
  686.           if test "$hardcode_direct" = yes; then
  687.             finalize_command="$finalize_command $libdir/$linklib"
  688.           elif test "$hardcode_minus_L" = yes; then
  689.             finalize_command="$finalize_command -L$libdir -l$name"
  690.           elif test "$hardcode_shlibpath_var" = yes; then
  691.             finalize_shlibpath="$finalize_shlibpath$libdir:"
  692.             finalize_command="$finalize_command -l$name"
  693.           else
  694.             # We cannot seem to hardcode it, guess we'll fake it.
  695.             finalize_command="$finalize_command -L$libdir -l$name"
  696.           fi
  697.         else
  698.           # Transform directly to old archives if we don't build new libraries.
  699.           if test -n "$pic_flag" && test -z "$old_library"; then
  700.             $echo "$modename: cannot find static library for `$arg'" 1>&2
  701.             exit 1
  702.           fi
  703.   # Here we assume that one of hardcode_direct or hardcode_minus_L
  704.   # is not unsupported.  This is valid on all known static and
  705.   # shared platforms.
  706.   if test "$hardcode_direct" != unsupported; then
  707.     test -n "$old_library" && linklib="$old_library"
  708.     compile_command="$compile_command $dir/$linklib"
  709.     finalize_command="$finalize_command $dir/$linklib"
  710.   else
  711.     compile_command="$compile_command -L$dir -l$name"
  712.     finalize_command="$finalize_command -L$dir -l$name"
  713.   fi
  714.         fi
  715. # Add in any libraries that this one depends upon.
  716. compile_command="$compile_command$dependency_libs"
  717. finalize_command="$finalize_command$dependency_libs"
  718. continue
  719.         ;;
  720.       # Some other compiler argument.
  721.       *)
  722. # Unknown arguments in both finalize_command and compile_command need
  723. # to be aesthetically quoted because they are evaled later.
  724. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  725. case "$arg" in
  726. *[[~#^&*(){}|;<>?'  ]*|*]*)
  727.   arg=""$arg""
  728.   ;;
  729. esac
  730.         ;;
  731.       esac
  732.       # Now actually substitute the argument into the commands.
  733.       if test -n "$arg"; then
  734. compile_command="$compile_command $arg"
  735. finalize_command="$finalize_command $arg"
  736.       fi
  737.     done
  738.     if test -n "$prev"; then
  739.       $echo "$modename: the `$prevarg' option requires an argument" 1>&2
  740.       $echo "$help" 1>&2
  741.       exit 1
  742.     fi
  743.     oldlibs=
  744.     case "$output" in
  745.     "")
  746.       $echo "$modename: you must specify an output file" 1>&2
  747.       $echo "$help" 1>&2
  748.       exit 1
  749.       ;;
  750.     */* | *\*)
  751.       $echo "$modename: output file `$output' must have no directory components" 1>&2
  752.       $echo "$help" 1>&2
  753.       exit 1
  754.       ;;
  755.     *.a)
  756.       if test -n "$link_against_libtool_libs"; then
  757.         $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  758.         exit 1
  759.       fi
  760.       if test -n "$deplibs"; then
  761.         $echo "$modename: warning: `-l' and `-L' are ignored for archives" 1>&2
  762.       fi
  763.       if test -n "$dlfiles$dlprefiles"; then
  764.         $echo "$modename: warning: `-dlopen' is ignored for archives" 1>&2
  765.       fi
  766.       if test -n "$rpath"; then
  767.         $echo "$modename: warning: `-rpath' is ignored for archives" 1>&2
  768.       fi
  769.       if test -n "$vinfo"; then
  770.         $echo "$modename: warning: `-version-info' is ignored for archives" 1>&2
  771.       fi
  772.       if test -n "$release"; then
  773.         $echo "$modename: warning: `-release' is ignored for archives" 1>&2
  774.       fi
  775.       # Now set the variables for building old libraries.
  776.       build_libtool_libs=no
  777.       oldlibs="$output"
  778.       ;;
  779.     *.la)
  780.       # Make sure we only generate libraries of the form `libNAME.la'.
  781.       case "$output" in
  782.       lib*) ;;
  783.       *)
  784. $echo "$modename: libtool library `$output' must begin with `lib'" 1>&2
  785. $echo "$help" 1>&2
  786. exit 1
  787. ;;
  788.       esac
  789.       name=`$echo "X$output" | $Xsed -e 's/.la$//' -e 's/^lib//'`
  790.       eval libname="$libname_spec"
  791.       # All the library-specific variables (install_libdir is set above).
  792.       library_names=
  793.       old_library=
  794.       dlname=
  795.       if test -n "$objs"; then
  796.         $echo "$modename: cannot build libtool library `$output' from non-libtool objects:$objs" 2>&1
  797.         exit 1
  798.       fi
  799.       # How the heck are we supposed to write a wrapper for a shared library?
  800.       if test -n "$link_against_libtool_libs"; then
  801.         $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  802.         exit 1
  803.       fi
  804.       if test -n "$dlfiles$dlprefiles"; then
  805.         $echo "$modename: warning: `-dlopen' is ignored for libtool libraries" 1>&2
  806.       fi
  807.       set dummy $rpath
  808.       if test $# -gt 2; then
  809. $echo "$modename: warning: ignoring multiple `-rpath's for a libtool library" 1>&2
  810.       fi
  811.       install_libdir="$2"
  812.       # Now set the variables for building old libraries.
  813.       oldlibs="$objdir/$libname.a"
  814.       if test -z "$rpath"; then
  815. # Building a libtool convenience library.
  816. oldlibs="$objdir/$libname.al $oldlibs"
  817. build_libtool_libs=convenience
  818. if test -n "$vinfo"; then
  819.   $echo "$modename: warning: `-version-info' is ignored for convenience libraries" 1>&2
  820. fi
  821. if test -n "$release"; then
  822.   $echo "$modename: warning: `-release' is ignored for convenience libraries" 1>&2
  823. fi
  824.       else
  825. # Parse the version information argument.
  826. IFS="${IFS=  }"; save_ifs="$IFS"; IFS=':'
  827. set dummy $vinfo 0 0 0
  828. IFS="$save_ifs"
  829. if test -n "$8"; then
  830.   $echo "$modename: too many parameters to `-version-info'" 1>&2
  831.   $echo "$help" 1>&2
  832.   exit 1
  833. fi
  834. current="$2"
  835. revision="$3"
  836. age="$4"
  837. # Check that each of the things are valid numbers.
  838. case "$current" in
  839. 0 | [1-9] | [1-9][0-9]*) ;;
  840. *)
  841.   $echo "$modename: CURRENT `$current' is not a nonnegative integer" 1>&2
  842.   $echo "$modename: `$vinfo' is not valid version information" 1>&2
  843.   exit 1
  844.   ;;
  845. esac
  846. case "$revision" in
  847. 0 | [1-9] | [1-9][0-9]*) ;;
  848. *)
  849.   $echo "$modename: REVISION `$revision' is not a nonnegative integer" 1>&2
  850.   $echo "$modename: `$vinfo' is not valid version information" 1>&2
  851.   exit 1
  852.   ;;
  853. esac
  854. case "$age" in
  855. 0 | [1-9] | [1-9][0-9]*) ;;
  856. *)
  857.   $echo "$modename: AGE `$age' is not a nonnegative integer" 1>&2
  858.   $echo "$modename: `$vinfo' is not valid version information" 1>&2
  859.   exit 1
  860.   ;;
  861. esac
  862. if test $age -gt $current; then
  863.   $echo "$modename: AGE `$age' is greater than the current interface number `$current'" 1>&2
  864.   $echo "$modename: `$vinfo' is not valid version information" 1>&2
  865.   exit 1
  866. fi
  867. # Calculate the version variables.
  868. major=
  869. versuffix=
  870. verstring=
  871. case "$version_type" in
  872. none) ;;
  873. linux)
  874.   major=.`expr $current - $age`
  875.   versuffix="$major.$age.$revision"
  876.   ;;
  877. osf)
  878.   major=`expr $current - $age`
  879.   versuffix=".$current.$age.$revision"
  880.   verstring="$current.$age.$revision"
  881.   # Add in all the interfaces that we are compatible with.
  882.   loop=$age
  883.   while test $loop != 0; do
  884.     iface=`expr $current - $loop`
  885.     loop=`expr $loop - 1`
  886.     verstring="$verstring:${iface}.0"
  887.   done
  888.   # Make executables depend on our current version.
  889.   verstring="$verstring:${current}.0"
  890.   ;;
  891. sunos)
  892.   major=".$current"
  893.   versuffix=".$current.$revision"
  894.   ;;
  895. *)
  896.   $echo "$modename: unknown library version type `$version_type'" 1>&2
  897.   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  898.   exit 1
  899.   ;;
  900. esac
  901. # Clear the version info if we defaulted, and they specified a release.
  902. if test -z "$vinfo" && test -n "$release"; then
  903.   major=
  904.   versuffix=
  905.   verstring="0.0"
  906. fi
  907. # Check to see if the archive will have undefined symbols.
  908. if test "$allow_undefined" = yes; then
  909.   if test "$allow_undefined_flag" = unsupported; then
  910.     $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  911.     build_libtool_libs=no
  912.     build_old_libs=yes
  913.   fi
  914. else
  915.   # Don't allow undefined symbols.
  916.   allow_undefined_flag="$no_undefined_flag"
  917. fi
  918. # Add libc to deplibs on all systems.
  919. dependency_libs="$deplibs"
  920. deplibs="$deplibs -lc"
  921.       fi
  922.       # Create the output directory, or remove our outputs if we need to.
  923.       if test -d $objdir; then
  924.         $show "${rm}r $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
  925. $run ${rm}r $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
  926.       else
  927.         $show "$mkdir $objdir"
  928.         $run $mkdir $objdir
  929.         status=$?
  930.         if test $status -ne 0 && test ! -d $objdir; then
  931.           exit $status
  932.         fi
  933.       fi
  934.       if test "$build_libtool_libs" = yes; then
  935. # Get the real and link names of the library.
  936. eval library_names="$library_names_spec"
  937. set dummy $library_names
  938. realname="$2"
  939. shift; shift
  940. if test -n "$soname_spec"; then
  941.   eval soname="$soname_spec"
  942. else
  943.   soname="$realname"
  944. fi
  945. lib="$objdir/$realname"
  946. for link
  947. do
  948.   linknames="$linknames $link"
  949. done
  950. # Use standard objects if they are PIC.
  951. test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/.lo /.o /g' -e 's/ $//g'`
  952. # Transform .lo files to .o files.
  953. test "$build_old_libs" = yes && oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*.a //g' -e 's/.lo /.o /g' -e 's/ $//g'`
  954. if test -n "$whole_archive_flag_spec"; then
  955.   if test -n "$convenience"; then
  956.     eval libobjs="$libobjs $whole_archive_flag_spec"
  957.   fi
  958. else
  959.   for xlib in $convenience; do
  960.     # Extract the objects.
  961.     xdir="$xlib"x
  962.     generated="$generated $xdir"
  963.     xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  964.     $show "${rm}r $xdir"
  965.     $run ${rm}r "$xdir"
  966.     $show "mkdir $xdir"
  967.     $run mkdir "$xdir"
  968.     status=$?
  969.     if test $status -ne 0 && test ! -d "$xdir"; then
  970.       exit $status
  971.     fi
  972.     $show "(cd $xdir && $AR x ../$xlib)"
  973.     $run eval "(cd $xdir && $AR x ../$xlib)" || exit $?
  974.     libobjs="$libobjs `echo $xdir/*`"
  975.   done
  976. fi
  977. # Do each of the archive commands.
  978. eval cmds="$archive_cmds"
  979. IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  980. for cmd in $cmds; do
  981.   IFS="$save_ifs"
  982.   $show "$cmd"
  983.   $run eval "$cmd" || exit $?
  984. done
  985. IFS="$save_ifs"
  986. # Create links to the real library.
  987. for linkname in $linknames; do
  988.   if test "$realname" != "$linkname"; then
  989.     $show "(cd $objdir && $LN_S $realname $linkname)"
  990.     $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
  991.   fi
  992. done
  993. # If -export-dynamic was specified, set the dlname.
  994. if test "$export_dynamic" = yes; then
  995.   # On all known operating systems, these are identical.
  996.   dlname="$soname"
  997. fi
  998.       fi
  999.       ;;
  1000.     *.lo | *.o)
  1001.       if test -n "$link_against_libtool_libs"; then
  1002.         $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  1003.         exit 1
  1004.       fi
  1005.       if test -n "$deplibs"; then
  1006.         $echo "$modename: warning: `-l' and `-L' are ignored for objects" 1>&2
  1007.       fi
  1008.       if test -n "$dlfiles$dlprefiles"; then
  1009.         $echo "$modename: warning: `-dlopen' is ignored for objects" 1>&2
  1010.       fi
  1011.       if test -n "$rpath"; then
  1012.         $echo "$modename: warning: `-rpath' is ignored for objects" 1>&2
  1013.       fi
  1014.       if test -n "$vinfo"; then
  1015.         $echo "$modename: warning: `-version-info' is ignored for objects" 1>&2
  1016.       fi
  1017.       if test -n "$release"; then
  1018.         $echo "$modename: warning: `-release' is ignored for objects" 1>&2
  1019.       fi
  1020.       case "$output" in
  1021.       *.lo)
  1022.         if test -n "$objs"; then
  1023.           $echo "$modename: cannot build library object `$output' from non-libtool objects" 1>&2
  1024.           exit 1
  1025.         fi
  1026.         libobj="$output"
  1027.         obj=`$echo "X$output" | $Xsed -e 's/.lo$/.o/'`
  1028.         ;;
  1029.       *)
  1030.         libobj=
  1031.         obj="$output"
  1032.         ;;
  1033.       esac
  1034.       # Delete the old objects.
  1035.       $run $rm $obj $libobj
  1036.       # Create the old-style object.
  1037.       reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*.a //g' -e 's/.lo /.o /g' -e 's/ $//g'`
  1038.       output="$obj"
  1039.       eval cmds="$reload_cmds"
  1040.       IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1041.       for cmd in $cmds; do
  1042.         IFS="$save_ifs"
  1043.         $show "$cmd"
  1044.         $run eval "$cmd" || exit $?
  1045.       done
  1046.       IFS="$save_ifs"
  1047.       # Exit if we aren't doing a library object file.
  1048.       test -z "$libobj" && exit 0
  1049.       if test "$build_libtool_libs" != yes; then
  1050.         # Create an invalid libtool object if no PIC, so that we don't
  1051.         # accidentally link it into a program.
  1052.         $show "echo timestamp > $libobj"
  1053.         $run eval "echo timestamp > $libobj" || exit $?
  1054.         exit 0
  1055.       fi
  1056.       if test -n "$pic_flag"; then
  1057.         # Only do commands if we really have different PIC objects.
  1058.         reload_objs="$libobjs"
  1059.         output="$libobj"
  1060.         eval cmds="$reload_cmds"
  1061.         IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1062.         for cmd in $cmds; do
  1063.           IFS="$save_ifs"
  1064.           $show "$cmd"
  1065.           $run eval "$cmd" || exit $?
  1066.         done
  1067.         IFS="$save_ifs"
  1068.       else
  1069.         # Just create a symlink.
  1070.         $show "$LN_S $obj $libobj"
  1071.         $run $LN_S $obj $libobj || exit $?
  1072.       fi
  1073.       exit 0
  1074.       ;;
  1075.     *)
  1076.       if test -n "$vinfo"; then
  1077.         $echo "$modename: warning: `-version-info' is ignored for programs" 1>&2
  1078.       fi
  1079.       if test -n "$release"; then
  1080.         $echo "$modename: warning: `-release' is ignored for programs" 1>&2
  1081.       fi
  1082.       if test -n "$rpath"; then
  1083. # If the user specified any rpath flags, then add them.
  1084. for libdir in $rpath; do
  1085.           if test -n "$hardcode_libdir_flag_spec"; then
  1086.             if test -n "$hardcode_libdir_separator"; then
  1087.               if test -z "$hardcode_libdirs"; then
  1088.                 # Put the magic libdir with the hardcode flag.
  1089.                 hardcode_libdirs="$libdir"
  1090.                 libdir="@HARDCODE_LIBDIRS@"
  1091.               else
  1092.                 # Just accumulate the unique libdirs.
  1093. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  1094. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1095.   ;;
  1096. *)
  1097.   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1098.   ;;
  1099. esac
  1100.                 libdir=
  1101.               fi
  1102.             fi
  1103.             if test -n "$libdir"; then
  1104.               eval flag="$hardcode_libdir_flag_spec"
  1105.               compile_command="$compile_command $flag"
  1106.               finalize_command="$finalize_command $flag"
  1107.             fi
  1108.           elif test -n "$runpath_var"; then
  1109.             case "$perm_rpath " in
  1110.             *" $libdir "*) ;;
  1111.             *) perm_rpath="$perm_rpath $libdir" ;;
  1112.             esac
  1113.           fi
  1114. done
  1115.       fi
  1116.       # Substitute the hardcoded libdirs into the compile commands.
  1117.       if test -n "$hardcode_libdir_separator"; then
  1118. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  1119. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  1120.       fi
  1121.       if test -n "$libobjs" && test "$build_old_libs" = yes; then
  1122.         # Transform all the library objects into standard objects.
  1123.         compile_command=`$echo "X$compile_command " | $Xsed -e 's/.lo /.o /g' -e 's/ $//'`
  1124.         finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/.lo /.o /g' -e 's/ $//'`
  1125.       fi
  1126.       if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
  1127.         dlsyms="${output}S.c"
  1128.       else
  1129.         dlsyms=
  1130.       fi
  1131.       if test -n "$dlsyms"; then
  1132.         # Add our own program objects to the preloaded list.
  1133.         dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/.lo /.o /g' -e 's/ $//'`
  1134. # Discover the nlist of each of the dlfiles.
  1135.         nlist="$objdir/${output}.nm"
  1136. if test -d $objdir; then
  1137.   $show "$rm $nlist ${nlist}T"
  1138.   $run $rm "$nlist" "${nlist}T"
  1139. else
  1140.   $show "$mkdir $objdir"
  1141.   $run $mkdir $objdir
  1142.   status=$?
  1143.   if test $status -ne 0 && test ! -d $objdir; then
  1144.     exit $status
  1145.   fi
  1146. fi
  1147.         for arg in $dlprefiles; do
  1148.   $show "extracting global C symbols from `$arg'"
  1149.   $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  1150.         done
  1151.         # Parse the name list into a source file.
  1152.         $show "creating $objdir/$dlsyms"
  1153.         if test -z "$run"; then
  1154.   # Make sure we at least have an empty file.
  1155.   test -f "$nlist" || : > "$nlist"
  1156.   # Try sorting and uniquifying the output.
  1157.   if sort "$nlist" | uniq > "$nlist"T; then
  1158.     mv -f "$nlist"T "$nlist"
  1159.     wcout=`wc "$nlist" 2>/dev/null`
  1160.     count=`echo "X$wcout" | $Xsed -e 's/^[  ]*([0-9][0-9]*).*$/1/'`
  1161.     (test "$count" -ge 0) 2>/dev/null || count=-1
  1162.   else
  1163.     $rm "$nlist"T
  1164.     count=-1
  1165.   fi
  1166.   case "$dlsyms" in
  1167.   "") ;;
  1168.   *.c)
  1169.     $echo > "$objdir/$dlsyms" "
  1170. /* $dlsyms - symbol resolution table for `$output' dlsym emulation. */
  1171. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
  1172. #ifdef __cplusplus
  1173. extern "C" {
  1174. #endif
  1175. /* Prevent the only kind of declaration conflicts we can make. */
  1176. #define dld_preloaded_symbol_count some_other_symbol
  1177. #define dld_preloaded_symbols some_other_symbol
  1178. /* External symbol declarations for the compiler. */
  1179. "
  1180.     if test -f "$nlist"; then
  1181.       sed -e 's/^.* (.*)$/extern char 1;/' < "$nlist" >> "$objdir/$dlsyms"
  1182.     else
  1183.       echo '/* NONE */' >> "$objdir/$dlsyms"
  1184.     fi
  1185.     $echo >> "$objdir/$dlsyms" "
  1186. #undef dld_preloaded_symbol_count
  1187. #undef dld_preloaded_symbols
  1188. #if defined (__STDC__) && __STDC__
  1189. # define __ptr_t void *
  1190. #else
  1191. # define __ptr_t char *
  1192. #endif
  1193. /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  1194. int dld_preloaded_symbol_count = $count;
  1195. /* The mapping between symbol names and symbols. */
  1196. struct {
  1197.   char *name;
  1198.   __ptr_t address;
  1199. }
  1200. dld_preloaded_symbols[] =
  1201. {
  1202. "
  1203.     if test -f "$nlist"; then
  1204.       sed 's/^(.*) (.*)$/  {"1", (__ptr_t) &2},/' < "$nlist" >> "$objdir/$dlsyms"
  1205.     fi
  1206.     $echo >> "$objdir/$dlsyms" "
  1207.   {0, (__ptr_t) 0}
  1208. };
  1209. #ifdef __cplusplus
  1210. }
  1211. #endif
  1212. "
  1213.     ;;
  1214.   *)
  1215.     $echo "$modename: unknown suffix for `$dlsyms'" 1>&2
  1216.     exit 1
  1217.     ;;
  1218.   esac
  1219.         fi
  1220.         # Now compile the dynamic symbol file.
  1221.         $show "(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")"
  1222.         $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
  1223.         # Transform the symbol file into the correct name.
  1224.         compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
  1225.         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
  1226.       elif test "$export_dynamic" != yes; then
  1227.         test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: `-dlopen' and `-dlpreopen' are ignored without `-export-dynamic'" 1>&2
  1228.       else
  1229.         # We keep going just in case the user didn't refer to
  1230.         # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
  1231.         # really was required.
  1232.         $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  1233.         # Nullify the symbol file.
  1234.         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  1235.         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  1236.       fi
  1237.       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  1238.         # Replace the output file specification.
  1239.         compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1240.         finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1241.         # We have no uninstalled library dependencies, so finalize right now.
  1242.         $show "$compile_command"
  1243.         $run eval "$compile_command"
  1244.         exit $?
  1245.       fi
  1246.       # Replace the output file specification.
  1247.       compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
  1248.       finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
  1249.       # Create the binary in the object directory, then wrap it.
  1250.       if test ! -d $objdir; then
  1251.         $show "$mkdir $objdir"
  1252. $run $mkdir $objdir
  1253. status=$?
  1254. if test $status -ne 0 && test ! -d $objdir; then
  1255.   exit $status
  1256. fi
  1257.       fi
  1258.       if test -n "$shlibpath_var"; then
  1259.         # We should set the shlibpath_var
  1260.         rpath=
  1261.         for dir in $temp_rpath; do
  1262.           case "$dir" in
  1263.           /* | [A-Za-z]:[/\]*)
  1264.             # Absolute path.
  1265.             rpath="$rpath$dir:"
  1266.             ;;
  1267.           *)
  1268.             # Relative path: add a thisdir entry.
  1269.             rpath="$rpath$thisdir/$dir:"
  1270.             ;;
  1271.           esac
  1272.         done
  1273.         temp_rpath="$rpath"
  1274.       fi
  1275.       # Delete the old output file.
  1276.       $run $rm $output
  1277.       if test -n "$compile_shlibpath"; then
  1278.         compile_command="$shlibpath_var="$compile_shlibpath$$shlibpath_var" $compile_command"
  1279.       fi
  1280.       if test -n "$finalize_shlibpath"; then
  1281.         finalize_command="$shlibpath_var="$finalize_shlibpath$$shlibpath_var" $finalize_command"
  1282.       fi
  1283.       if test -n "$runpath_var" && test -n "$perm_rpath"; then
  1284.         # We should set the runpath_var.
  1285.         rpath=
  1286.         for dir in $perm_rpath; do
  1287.           rpath="$rpath$dir:"
  1288.         done
  1289.         compile_command="$runpath_var="$rpath$$runpath_var" $compile_command"
  1290.         finalize_command="$runpath_var="$rpath$$runpath_var" $finalize_command"
  1291.       fi
  1292.       if test "$hardcode_action" = relink; then
  1293.         # AGH! Flame the AIX and HP-UX people for me, will ya?
  1294.         $echo "$modename: warning: using a buggy system linker" 1>&2
  1295.         $echo "$modename: relinking will be required before `$output' can be installed" 1>&2
  1296.       fi
  1297.       $show "$compile_command"
  1298.       $run eval "$compile_command" || exit $?
  1299.       # Now create the wrapper script.
  1300.       $show "creating $output"
  1301.       # Quote the finalize command for shipping.
  1302.       finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
  1303.       # Quote $echo for shipping.
  1304.       qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  1305.       # Only actually do things if our run command is non-null.
  1306.       if test -z "$run"; then
  1307.         $rm $output
  1308.         trap "$rm $output; exit 1" 1 2 15
  1309.         $echo > $output "
  1310. #! $SHELL
  1311. # $output - temporary wrapper script for $objdir/$output
  1312. # Generated by $PROGRAM - GNU $PACKAGE $VERSION
  1313. #
  1314. # The $output program cannot be directly executed until all the libtool
  1315. # libraries that it depends on are installed.
  1316. #
  1317. # This wrapper script should never be moved out of ``pwd`'.
  1318. # If it is, it will not operate correctly.
  1319. # Sed substitution that helps us do robust quoting.  It backslashifies
  1320. # metacharacters that are still active within double-quoted strings.
  1321. Xsed='sed -e s/^X//'
  1322. sed_quote_subst='$sed_quote_subst'
  1323. # The HP-UX ksh and POSIX shell print the target directory to stdout
  1324. # if CDPATH is set.
  1325. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  1326. # This environment variable determines our operation mode.
  1327. if test "$libtool_install_magic" = "$magic"; then
  1328.   # install mode needs the following variables:
  1329.   link_against_libtool_libs='$link_against_libtool_libs'
  1330.   finalize_command="$finalize_command"
  1331. else
  1332.   # When we are sourced in execute mode, $file and $echo are already set.
  1333.   if test "$libtool_execute_magic" != "$magic"; then
  1334.     echo="$qecho"
  1335.     file="$0"
  1336.     # Make sure echo works.
  1337.     if test "X$1" = X--no-reexec; then
  1338.       # Discard the --no-reexec flag, and continue.
  1339.       shift
  1340.     elif test "X`($echo 't') 2>/dev/null`" = 'Xt'; then
  1341.       # Yippee, $echo works!
  1342.       :
  1343.     else
  1344.       # Restart under the correct shell, and then maybe $echo will work.
  1345.       exec $SHELL "$0" --no-reexec ${1+"$@"}
  1346.     fi
  1347.   fi
  1348. "
  1349.         $echo >> $output "
  1350.   # Find the directory that this script lives in.
  1351.   thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1352.   test "x$thisdir" = "x$file" && thisdir=.
  1353.   # Follow symbolic links until we get to the real thisdir.
  1354.   file=`ls -ld "$file" | sed -n 's/.*-> //p'`
  1355.   while test -n "$file"; do
  1356.     destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1357.     # If there was a directory component, then change thisdir.
  1358.     if test "x$destdir" != "x$file"; then
  1359.       case "$destdir" in
  1360.       /* | [A-Za-z]:[/\]*) thisdir="$destdir" ;;
  1361.       *) thisdir="$thisdir/$destdir" ;;
  1362.       esac
  1363.     fi
  1364.     file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1365.     file=`ls -ld "$thisdir/$file" | sed -n 's/.*-> //p'`
  1366.   done
  1367.   # Try to get the absolute directory name.
  1368.   absdir=`cd "$thisdir" && pwd`
  1369.   test -n "$absdir" && thisdir="$absdir"
  1370.   progdir="$thisdir/$objdir"
  1371.   program='$output'
  1372.   if test -f "$progdir/$program"; then"
  1373.         # Export our shlibpath_var if we have one.
  1374.         if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1375.           $echo >> $output "
  1376.     # Add our own library path to $shlibpath_var
  1377.     $shlibpath_var="$temp_rpath$$shlibpath_var"
  1378.     # Some systems cannot cope with colon-terminated $shlibpath_var
  1379.     $shlibpath_var=`$echo "X$$shlibpath_var" | $Xsed -e 's/:*$//'`
  1380.     export $shlibpath_var
  1381. "
  1382.         fi
  1383.         $echo >> $output "
  1384.     if test "$libtool_execute_magic" != "$magic"; then
  1385.       # Run the actual program with our arguments.
  1386.       # Export the path to the program.
  1387.       PATH="$progdir:$PATH"
  1388.       export PATH
  1389.       exec $program ${1+"$@"}
  1390.       $echo "$0: cannot exec $program ${1+"$@"}"
  1391.       exit 1
  1392.     fi
  1393.   else
  1394.     # The program doesn't exist.
  1395.     $echo "$0: error: $progdir/$program does not exist" 1>&2
  1396.     $echo "This script is just a wrapper for $program." 1>&2
  1397.     echo "See the $PACKAGE documentation for more information." 1>&2
  1398.     exit 1
  1399.   fi
  1400. fi
  1401. "
  1402.         chmod +x $output
  1403.       fi
  1404.       exit 0
  1405.       ;;
  1406.     esac
  1407.     # See if we need to build an old-fashioned archive.
  1408.     for oldlib in $oldlibs; do
  1409.       if test "$build_libtool_libs" = convenience; then
  1410. oldobjs="$libobjs"
  1411. addlibs="$convenience"
  1412. build_libtool_libs=no
  1413.       else
  1414. addlibs="$old_convenience"
  1415.       fi
  1416.       # Add in members from convenience archives.
  1417.       for xlib in $addlibs; do
  1418. # Extract the objects.
  1419. xdir="$xlib"x
  1420. generated="$generated $xdir"
  1421. xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  1422. $show "${rm}r $xdir"
  1423. $run ${rm}r "$xdir"
  1424. $show "mkdir $xdir"
  1425. $run mkdir "$xdir"
  1426. status=$?
  1427. if test $status -ne 0 && test ! -d "$xdir"; then
  1428.   exit $status
  1429. fi
  1430. $show "(cd $xdir && $AR x ../$xlib)"
  1431. $run eval "(cd $xdir && $AR x ../$xlib)" || exit $?
  1432. oldobjs="$oldobjs `echo $xdir/*`"
  1433.       done
  1434.       # Do each command in the archive commands.
  1435.       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  1436. eval cmds="$old_archive_from_new_cmds"
  1437.       else
  1438. eval cmds="$old_archive_cmds"
  1439.       fi
  1440.       IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1441.       for cmd in $cmds; do
  1442.         IFS="$save_ifs"
  1443.         $show "$cmd"
  1444.         $run eval "$cmd" || exit $?
  1445.       done
  1446.       IFS="$save_ifs"
  1447.     done
  1448.     if test -n "$generated"; then
  1449.       $show "${rm}r$generated"
  1450.       $run ${rm}r$generated
  1451.     fi
  1452.     # Now create the libtool archive.
  1453.     case "$output" in
  1454.     *.la)
  1455.       old_library=
  1456.       test "$build_old_libs" = yes && old_library="$libname.a"
  1457.       $show "creating $output"
  1458.       # Only create the output if not a dry run.
  1459.       if test -z "$run"; then
  1460.         $echo > $output "
  1461. # $output - a libtool library file
  1462. # Generated by $PROGRAM - GNU $PACKAGE $VERSION
  1463. # The name that we can dlopen(3).
  1464. dlname='$dlname'
  1465. # Names of this library.
  1466. library_names='$library_names'
  1467. # The name of the static archive.
  1468. old_library='$old_library'
  1469. # Libraries that this one depends upon.
  1470. dependency_libs='$dependency_libs'
  1471. # Version information for $libname.
  1472. current=$current
  1473. age=$age
  1474. revision=$revision
  1475. # Directory that this library needs to be installed in:
  1476. libdir='$install_libdir'
  1477. "
  1478.       fi
  1479.       # Do a symbolic link so that the libtool archive can be found in
  1480.       # LD_LIBRARY_PATH before the program is installed.
  1481.       $show "(cd $objdir && $LN_S ../$output $output)"
  1482.       $run eval "(cd $objdir && $LN_S ../$output $output)" || exit $?
  1483.       ;;
  1484.     esac
  1485.     exit 0
  1486.     ;;
  1487.   # libtool install mode
  1488.   install)
  1489.     modename="$modename: install"
  1490.     # There may be an optional sh(1) argument at the beginning of
  1491.     # install_prog (especially on Windows NT).
  1492.     if test "$nonopt" = "$SHELL"; then
  1493.       # Aesthetically quote it.
  1494.       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  1495.       case "$arg" in
  1496.       *[[~#^&*(){}|;<>?'  ]*|*]*)
  1497. arg=""$arg""
  1498. ;;
  1499.       esac
  1500.       install_prog="$arg "
  1501.       arg="$1"
  1502.       shift
  1503.     else
  1504.       install_prog=
  1505.       arg="$nonopt"
  1506.     fi
  1507.     # The real first argument should be the name of the installation program.
  1508.     # Aesthetically quote it.
  1509.     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1510.     case "$arg" in
  1511.     *[[~#^&*(){}|;<>?'  ]*|*]*)
  1512.       arg=""$arg""
  1513.       ;;
  1514.     esac
  1515.     install_prog="$install_prog$arg"
  1516.     # We need to accept at least all the BSD install flags.
  1517.     dest=
  1518.     files=
  1519.     opts=
  1520.     prev=
  1521.     install_type=
  1522.     isdir=no
  1523.     stripme=
  1524.     for arg
  1525.     do
  1526.       if test -n "$dest"; then
  1527.         files="$files $dest"
  1528.         dest="$arg"
  1529.         continue
  1530.       fi
  1531.       case "$arg" in
  1532.       -d) isdir=yes ;;
  1533.       -f) prev="-f" ;;
  1534.       -g) prev="-g" ;;
  1535.       -m) prev="-m" ;;
  1536.       -o) prev="-o" ;;
  1537.       -s)
  1538.         stripme=" -s"
  1539.         continue
  1540.         ;;
  1541.       -*) ;;
  1542.       *)
  1543.         # If the previous option needed an argument, then skip it.
  1544.         if test -n "$prev"; then
  1545.           prev=
  1546.         else
  1547.           dest="$arg"
  1548.           continue
  1549.         fi
  1550.         ;;
  1551.       esac
  1552.       # Aesthetically quote the argument.
  1553.       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1554.       case "$arg" in
  1555.       *[[~#^&*(){}|;<>?'  ]*|*]*)
  1556. arg=""$arg""
  1557. ;;
  1558.       esac
  1559.       install_prog="$install_prog $arg"
  1560.     done
  1561.     if test -z "$install_prog"; then
  1562.       $echo "$modename: you must specify an install program" 1>&2
  1563.       $echo "$help" 1>&2
  1564.       exit 1
  1565.     fi
  1566.     if test -n "$prev"; then
  1567.       $echo "$modename: the `$prev' option requires an argument" 1>&2
  1568.       $echo "$help" 1>&2
  1569.       exit 1
  1570.     fi
  1571.     if test -z "$files"; then
  1572.       if test -z "$dest"; then
  1573.         $echo "$modename: no file or destination specified" 1>&2
  1574.       else
  1575.         $echo "$modename: you must specify a destination" 1>&2
  1576.       fi
  1577.       $echo "$help" 1>&2
  1578.       exit 1
  1579.     fi
  1580.     # Strip any trailing slash from the destination.
  1581.     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  1582.     # Check to see that the destination is a directory.
  1583.     test -d "$dest" && isdir=yes
  1584.     if test "$isdir" = yes; then
  1585.       destdir="$dest"
  1586.       destname=
  1587.     else
  1588.       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  1589.       test "X$destdir" = "X$dest" && destdir=.
  1590.       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  1591.       # Not a directory, so check to see that there is only one file specified.
  1592.       set dummy $files
  1593.       if test $# -gt 2; then
  1594.         $echo "$modename: `$dest' is not a directory" 1>&2
  1595.         $echo "$help" 1>&2
  1596.         exit 1
  1597.       fi
  1598.     fi
  1599.     case "$destdir" in
  1600.     /* | [A-Za-z]:[/\]*) ;;
  1601.     *)
  1602.       for file in $files; do
  1603.         case "$file" in
  1604.         *.lo) ;;
  1605.         *)
  1606.           $echo "$modename: `$destdir' must be an absolute directory name" 1>&2
  1607.           $echo "$help" 1>&2
  1608.           exit 1
  1609.           ;;
  1610.         esac
  1611.       done
  1612.       ;;
  1613.     esac
  1614.     # This variable tells wrapper scripts just to set variables rather
  1615.     # than running their programs.
  1616.     libtool_install_magic="$magic"
  1617.     staticlibs=
  1618.     future_libdirs=
  1619.     current_libdirs=
  1620.     for file in $files; do
  1621.       # Do each installation.
  1622.       case "$file" in
  1623.       *.a)
  1624.         # Do the static libraries later.
  1625.         staticlibs="$staticlibs $file"
  1626.         ;;
  1627.       *.la)
  1628.         # Check to see that this really is a libtool archive.
  1629.         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1630.         else
  1631.           $echo "$modename: `$file' is not a valid libtool archive" 1>&2
  1632.           $echo "$help" 1>&2
  1633.           exit 1
  1634.         fi
  1635.         library_names=
  1636.         old_library=
  1637.         # If there is no directory component, then add one.
  1638.         case "$file" in
  1639.         */* | *\*) . $file ;;
  1640.         *) . ./$file ;;
  1641.         esac
  1642.         # Add the libdir to current_libdirs if it is the destination.
  1643.         if test "X$destdir" = "X$libdir"; then
  1644.           case "$current_libdirs " in
  1645.           *" $libdir "*) ;;
  1646.           *) current_libdirs="$current_libdirs $libdir" ;;
  1647.           esac
  1648.         else
  1649.           # Note the libdir as a future libdir.
  1650.           case "$future_libdirs " in
  1651.           *" $libdir "*) ;;
  1652.           *) future_libdirs="$future_libdirs $libdir" ;;
  1653.           esac
  1654.         fi
  1655.         dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  1656.         test "X$dir" = "X$file/" && dir=
  1657.         dir="$dir$objdir"
  1658.         # See the names of the shared library.
  1659.         set dummy $library_names
  1660.         if test -n "$2"; then
  1661.           realname="$2"
  1662.           shift
  1663.           shift
  1664.           # Install the shared library and build the symlinks.
  1665.           $show "$install_prog $dir/$realname $destdir/$realname"
  1666.           $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  1667.           test "X$dlname" = "X$realname" && dlname=
  1668.           if test $# -gt 0; then
  1669.             # Delete the old symlinks.
  1670.             rmcmd="$rm"
  1671.             for linkname
  1672.             do
  1673.               rmcmd="$rmcmd $destdir/$linkname"
  1674.             done
  1675.             $show "$rmcmd"
  1676.             $run $rmcmd
  1677.             # ... and create new ones.
  1678.             for linkname
  1679.             do
  1680.               test "X$dlname" = "X$linkname" && dlname=
  1681.               $show "(cd $destdir && $LN_S $realname $linkname)"
  1682.               $run eval "(cd $destdir && $LN_S $realname $linkname)"
  1683.             done
  1684.           fi
  1685.           if test -n "$dlname"; then
  1686.             # Install the dynamically-loadable library.
  1687.             $show "$install_prog $dir/$dlname $destdir/$dlname"
  1688.             $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  1689.           fi
  1690.           # Do each command in the postinstall commands.
  1691.           lib="$destdir/$realname"
  1692.           eval cmds="$postinstall_cmds"
  1693.           IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1694.           for cmd in $cmds; do
  1695.             IFS="$save_ifs"
  1696.             $show "$cmd"
  1697.             $run eval "$cmd" || exit $?
  1698.           done
  1699.           IFS="$save_ifs"
  1700.         fi
  1701.         # Install the pseudo-library for information purposes.
  1702.         name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1703.         $show "$install_prog $file $destdir/$name"
  1704.         $run eval "$install_prog $file $destdir/$name" || exit $?
  1705.         # Maybe install the static library, too.
  1706.         test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  1707.         ;;
  1708.       *.lo)
  1709.         # Install (i.e. copy) a libtool object.
  1710.         # Figure out destination file name, if it wasn't already specified.
  1711.         if test -n "$destname"; then
  1712.           destfile="$destdir/$destname"
  1713.         else
  1714.           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1715.           destfile="$destdir/$destfile"
  1716.         fi
  1717.         # Deduce the name of the destination old-style object file.
  1718.         case "$destfile" in
  1719.         *.lo)
  1720.           staticdest=`$echo "X$destfile" | $Xsed -e 's/.lo$/.o/'`
  1721.           ;;
  1722.         *.o)
  1723.           staticdest="$destfile"
  1724.           destfile=
  1725.           ;;
  1726.         *)
  1727.           $echo "$modename: cannot copy a libtool object to `$destfile'" 1>&2
  1728.           $echo "$help" 1>&2
  1729.           exit 1
  1730.           ;;
  1731.         esac
  1732.         # Install the libtool object if requested.
  1733.         if test -n "$destfile"; then
  1734.           $show "$install_prog $file $destfile"
  1735.           $run eval "$install_prog $file $destfile" || exit $?
  1736.         fi
  1737.         # Install the old object if enabled.
  1738.         if test "$build_old_libs" = yes; then
  1739.           # Deduce the name of the old-style object file.
  1740.           staticobj=`$echo "X$file" | $Xsed -e 's/.lo$/.o/'`
  1741.           $show "$install_prog $staticobj $staticdest"
  1742.           $run eval "$install_prog $staticobj $staticdest" || exit $?
  1743.         fi
  1744.         exit 0
  1745.         ;;
  1746.       *)
  1747.         # Figure out destination file name, if it wasn't already specified.
  1748.         if test -n "$destname"; then
  1749.           destfile="$destdir/$destname"
  1750.         else
  1751.           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1752.           destfile="$destdir/$destfile"
  1753.         fi
  1754.         # Do a test to see if this is really a libtool program.
  1755.         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1756.           link_against_libtool_libs=
  1757.           finalize_command=
  1758.           # If there is no directory component, then add one.
  1759.           case "$file" in
  1760.           */* | *\*) . $file ;;
  1761.           *) . ./$file ;;
  1762.           esac
  1763.           # Check the variables that should have been set.
  1764.           if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
  1765.             $echo "$modename: invalid libtool wrapper script `$file'" 1>&2
  1766.             exit 1
  1767.           fi
  1768.           finalize=yes
  1769.           for lib in $link_against_libtool_libs; do
  1770.             # Check to see that each library is installed.
  1771.             libdir=
  1772.             if test -f "$lib"; then
  1773.               # If there is no directory component, then add one.
  1774.               case "$lib" in
  1775.               */* | *\*) . $lib ;;
  1776.               *) . ./$lib ;;
  1777.               esac
  1778.             fi
  1779.             libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  1780.             if test -n "$libdir" && test ! -f "$libfile"; then
  1781.               $echo "$modename: warning: `$lib' has not been installed in `$libdir'" 1>&2
  1782.               finalize=no
  1783.             fi
  1784.           done
  1785.           if test "$hardcode_action" = relink; then
  1786.             if test "$finalize" = yes; then
  1787.               $echo "$modename: warning: relinking `$file' on behalf of your buggy system linker" 1>&2
  1788.               $show "$finalize_command"
  1789.               if $run eval "$finalize_command"; then :
  1790.               else
  1791.                 $echo "$modename: error: relink `$file' with the above command before installing it" 1>&2
  1792.                 continue
  1793.               fi
  1794.               file="$objdir/$file"T
  1795.             else
  1796.               $echo "$modename: warning: cannot relink `$file' on behalf of your buggy system linker" 1>&2
  1797.             fi
  1798.           else
  1799.             # Install the binary that we compiled earlier.
  1800.     file=`$echo "X$file" | $Xsed -e "s%([^/]*)$%$objdir/1%"`
  1801.           fi
  1802.         fi
  1803.         $show "$install_prog$stripme $file $destfile"
  1804.         $run eval "$install_prog$stripme $file $destfile" || exit $?
  1805.         ;;
  1806.       esac
  1807.     done
  1808.     for file in $staticlibs; do
  1809.       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  1810.       # Set up the ranlib parameters.
  1811.       oldlib="$destdir/$name"
  1812.       $show "$install_prog $file $oldlib"
  1813.       $run eval "$install_prog $file $oldlib" || exit $?
  1814.       # Do each command in the postinstall commands.
  1815.       eval cmds="$old_postinstall_cmds"
  1816.       IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1817.       for cmd in $cmds; do
  1818.         IFS="$save_ifs"
  1819.         $show "$cmd"
  1820.         $run eval "$cmd" || exit $?
  1821.       done
  1822.       IFS="$save_ifs"
  1823.     done
  1824.     if test -n "$future_libdirs"; then
  1825.       $echo "$modename: warning: remember to run `$progname --finish$future_libdirs'" 1>&2
  1826.     fi
  1827.     if test -n "$current_libdirs"; then
  1828.       # Maybe just do a dry run.
  1829.       test -n "$run" && current_libdirs=" -n$current_libdirs"
  1830.       exec $SHELL $0 --finish$current_libdirs
  1831.       exit 1
  1832.     fi
  1833.     exit 0
  1834.     ;;
  1835.   # libtool finish mode
  1836.   finish)
  1837.     modename="$modename: finish"
  1838.     libdirs="$nonopt"
  1839.     admincmds=
  1840.     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  1841.       for dir
  1842.       do
  1843.         libdirs="$libdirs $dir"
  1844.       done
  1845.       for libdir in $libdirs; do
  1846. if test -n "$finish_cmds"; then
  1847.   # Do each command in the finish commands.
  1848.   eval cmds="$finish_cmds"
  1849.           IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  1850.           for cmd in $cmds; do
  1851.             IFS="$save_ifs"
  1852.             $show "$cmd"
  1853.             $run eval "$cmd" || admincmds="$admincmds
  1854.        $cmd"
  1855.           done
  1856.           IFS="$save_ifs"
  1857. fi
  1858. if test -n "$finish_eval"; then
  1859.   # Do the single finish_eval.
  1860.   eval cmds="$finish_eval"
  1861.   $run eval "$cmds" || admincmds="$admincmds
  1862.        $cmds"
  1863. fi
  1864.       done
  1865.     fi
  1866.     echo "----------------------------------------------------------------------"
  1867.     echo "Libraries have been installed in:"
  1868.     for libdir in $libdirs; do
  1869.       echo "   $libdir"
  1870.     done
  1871.     echo
  1872.     echo "To link against installed libraries in a given directory, LIBDIR,"
  1873.     echo "you must use the `-LLIBDIR' flag during linking."
  1874.     echo
  1875.     echo " You will also need to do at least one of the following:"
  1876.     if test -n "$shlibpath_var"; then
  1877.       echo "   - add LIBDIR to the `$shlibpath_var' environment variable"
  1878.       echo "     during execution"
  1879.     fi
  1880.     if test -n "$runpath_var"; then
  1881.       echo "   - add LIBDIR to the `$runpath_var' environment variable"
  1882.       echo "     during linking"
  1883.     fi
  1884.     if test -n "$hardcode_libdir_flag_spec"; then
  1885.       libdir=LIBDIR
  1886.       eval flag="$hardcode_libdir_flag_spec"
  1887.       echo "   - use the `$flag' linker flag"
  1888.     fi
  1889.     if test -n "$admincmds"; then
  1890.       echo "   - have your system administrator run these commands:$admincmds"
  1891.     fi
  1892.     if test -f /etc/ld.so.conf; then
  1893.       echo "   - have your system administrator add LIBDIR to `/etc/ld.so.conf'"
  1894.     fi
  1895.     echo
  1896.     echo "See any operating system documentation about shared libraries for"
  1897.     echo "more information, such as the ld(1) and ld.so(8) manual pages."
  1898.     echo "----------------------------------------------------------------------"
  1899.     exit 0
  1900.     ;;
  1901.   # libtool execute mode
  1902.   execute)
  1903.     modename="$modename: execute"
  1904.     # The first argument is the command name.
  1905.     cmd="$nonopt"
  1906.     if test -z "$cmd"; then
  1907.       $echo "$modename: you must specify a COMMAND" 1>&2
  1908.       $echo "$help"
  1909.       exit 1
  1910.     fi
  1911.     # Handle -dlopen flags immediately.
  1912.     for file in $execute_dlfiles; do
  1913.       if test ! -f "$file"; then
  1914. $echo "$modename: `$file' is not a file" 1>&2
  1915. $echo "$help" 1>&2
  1916. exit 1
  1917.       fi
  1918.       dir=
  1919.       case "$file" in
  1920.       *.la)
  1921.         # Check to see that this really is a libtool archive.
  1922.         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1923.         else
  1924.           $echo "$modename: `$lib' is not a valid libtool archive" 1>&2
  1925.           $echo "$help" 1>&2
  1926.           exit 1
  1927.         fi
  1928. # Read the libtool library.
  1929. dlname=
  1930. library_names=
  1931.         # If there is no directory component, then add one.
  1932. case "$file" in
  1933. */* | *\*) . $file ;;
  1934.         *) . ./$file ;;
  1935. esac
  1936. # Skip this library if it cannot be dlopened.
  1937. if test -z "$dlname"; then
  1938.   # Warn if it was a shared library.
  1939.   test -n "$library_names" && $echo "$modename: warning: `$file' was not linked with `-export-dynamic'"
  1940.   continue
  1941. fi
  1942. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1943. test "X$dir" = "X$file" && dir=.
  1944. if test -f "$dir/$objdir/$dlname"; then
  1945.   dir="$dir/$objdir"
  1946. else
  1947.   $echo "$modename: cannot find `$dlname' in `$dir' or `$dir/$objdir'" 1>&2
  1948.   exit 1
  1949. fi
  1950. ;;
  1951.       *.lo)
  1952. # Just add the directory containing the .lo file.
  1953. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  1954. test "X$dir" = "X$file" && dir=.
  1955. ;;
  1956.       *)
  1957. $echo "$modename: warning `-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  1958.         continue
  1959. ;;
  1960.       esac
  1961.       # Get the absolute pathname.
  1962.       absdir=`cd "$dir" && pwd`
  1963.       test -n "$absdir" && dir="$absdir"
  1964.       # Now add the directory to shlibpath_var.
  1965.       if eval "test -z "$$shlibpath_var""; then
  1966. eval "$shlibpath_var="$dir""
  1967.       else
  1968. eval "$shlibpath_var="$dir:$$shlibpath_var""
  1969.       fi
  1970.     done
  1971.     # This variable tells wrapper scripts just to set shlibpath_var
  1972.     # rather than running their programs.
  1973.     libtool_execute_magic="$magic"
  1974.     # Check if any of the arguments is a wrapper script.
  1975.     args=
  1976.     for file
  1977.     do
  1978.       case "$file" in
  1979.       -*) ;;
  1980.       *)
  1981.         # Do a test to see if this is really a libtool program.
  1982.         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1983.   # If there is no directory component, then add one.
  1984.   case "$file" in
  1985.   */* | *\*) . $file ;;
  1986.   *) . ./$file ;;
  1987.   esac
  1988.   # Transform arg to wrapped name.
  1989.   file="$progdir/$program"
  1990. fi
  1991.         ;;
  1992.       esac
  1993.       # Quote arguments (to preserve shell metacharacters).
  1994.       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  1995.       args="$args "$file""
  1996.     done
  1997.     if test -z "$run"; then
  1998.       # Export the shlibpath_var.
  1999.       eval "export $shlibpath_var"
  2000.       # Restore saved enviroment variables
  2001.       if test "${save_LC_ALL+set}" = set; then
  2002.         LC_ALL="$save_LC_ALL"; export LC_ALL
  2003.       fi
  2004.       if test "${save_LANG+set}" = set; then
  2005.         LANG="$save_LANG"; export LANG
  2006.       fi
  2007.       # Now actually exec the command.
  2008.       eval "exec $cmd$args"
  2009.       $echo "$modename: cannot exec $cmd$args"
  2010.       exit 1
  2011.     else
  2012.       # Display what would be done.
  2013.       eval "$echo "$shlibpath_var=$$shlibpath_var""
  2014.       $echo "export $shlibpath_var"
  2015.       $echo "$cmd$args"
  2016.       exit 0
  2017.     fi
  2018.     ;;
  2019.   # libtool uninstall mode
  2020.   uninstall)
  2021.     modename="$modename: uninstall"
  2022.     rm="$nonopt"
  2023.     files=
  2024.     for arg
  2025.     do
  2026.       case "$arg" in
  2027.       -*) rm="$rm $arg" ;;
  2028.       *) files="$files $arg" ;;
  2029.       esac
  2030.     done
  2031.     if test -z "$rm"; then
  2032.       $echo "$modename: you must specify an RM program" 1>&2
  2033.       $echo "$help" 1>&2
  2034.       exit 1
  2035.     fi
  2036.     for file in $files; do
  2037.       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  2038.       test "X$dir" = "X$file" && dir=.
  2039.       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  2040.       rmfiles="$file"
  2041.       case "$name" in
  2042.       *.la)
  2043.         # Possibly a libtool archive, so verify it.
  2044.         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  2045.           . $dir/$name
  2046.           # Delete the libtool libraries and symlinks.
  2047.           for n in $library_names; do
  2048.             rmfiles="$rmfiles $dir/$n"
  2049.             test "X$n" = "X$dlname" && dlname=
  2050.           done
  2051.           test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  2052.           test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  2053.   $show "$rm $rmfiles"
  2054.   $run $rm $rmfiles
  2055.   if test -n "$library_names"; then
  2056.     # Do each command in the postuninstall commands.
  2057.     eval cmds="$postuninstall_cmds"
  2058.     IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  2059.     for cmd in $cmds; do
  2060.       IFS="$save_ifs"
  2061.       $show "$cmd"
  2062.       $run eval "$cmd"
  2063.     done
  2064.     IFS="$save_ifs"
  2065.   fi
  2066.           if test -n "$old_library"; then
  2067.     # Do each command in the old_postuninstall commands.
  2068.     eval cmds="$old_postuninstall_cmds"
  2069.     IFS="${IFS=  }"; save_ifs="$IFS"; IFS=';'
  2070.     for cmd in $cmds; do
  2071.       IFS="$save_ifs"
  2072.       $show "$cmd"
  2073.       $run eval "$cmd"
  2074.     done
  2075.     IFS="$save_ifs"
  2076.   fi
  2077.           # FIXME: should reinstall the best remaining shared library.
  2078.         fi
  2079.         ;;
  2080.       *.lo)
  2081.         if test "$build_old_libs" = yes; then
  2082.           oldobj=`$echo "X$name" | $Xsed -e 's/.lo$/.o/'`
  2083.           rmfiles="$rmfiles $dir/$oldobj"
  2084.         fi
  2085. $show "$rm $rmfiles"
  2086. $run $rm $rmfiles
  2087.         ;;
  2088.       *)
  2089.        $show "$rm $rmfiles"
  2090. $run $rm $rmfiles
  2091. ;;
  2092.       esac
  2093.     done
  2094.     exit 0
  2095.     ;;
  2096.   "")
  2097.     $echo "$modename: you must specify a MODE" 1>&2
  2098.     $echo "$generic_help" 1>&2
  2099.     exit 1
  2100.     ;;
  2101.   esac
  2102.   $echo "$modename: invalid operation mode `$mode'" 1>&2
  2103.   $echo "$generic_help" 1>&2
  2104.   exit 1
  2105. fi # test -z "$show_help"
  2106. # We need to display help for each of the modes.
  2107. case "$mode" in
  2108. "") $echo 
  2109. "Usage: $modename [OPTION]... [MODE-ARG]...
  2110. Provide generalized library-building support services.
  2111.     --config          show all configuration variables
  2112.     --debug           enable verbose shell tracing
  2113. -n, --dry-run         display commands without modifying any files
  2114.     --features        display basic configuration information and exit
  2115.     --finish          same as `--mode=finish'
  2116.     --help            display this help message and exit
  2117.     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
  2118.     --quiet           same as `--silent'
  2119.     --silent          don't print informational messages
  2120.     --version         print version information
  2121. MODE must be one of the following:
  2122.       compile         compile a source file into a libtool object
  2123.       execute         automatically set library path, then run a program
  2124.       finish          complete the installation of libtool libraries
  2125.       install         install libraries or executables
  2126.       link            create a library or an executable
  2127.       uninstall       remove libraries from an installed directory
  2128. MODE-ARGS vary depending on the MODE.  Try `$modename --help --mode=MODE' for
  2129. a more detailed description of MODE."
  2130.   exit 0
  2131.   ;;
  2132. compile)
  2133.   $echo 
  2134. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  2135. Compile a source file into a libtool library object.
  2136. This mode accepts the following additional options:
  2137.   -static           always build a `.o' file suitable for static linking
  2138. COMPILE-COMMAND is a command to be used in creating a `standard' object file
  2139. from the given SOURCEFILE.
  2140. The output file name is determined by removing the directory component from
  2141. SOURCEFILE, then substituting the C source code suffix `.c' with the
  2142. library object suffix, `.lo'."
  2143.   ;;
  2144. execute)
  2145.   $echo 
  2146. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  2147. Automatically set library path, then run a program.
  2148. This mode accepts the following additional options:
  2149.   -dlopen FILE      add the directory containing FILE to the library path
  2150. This mode sets the library path environment variable according to `-dlopen'
  2151. flags.
  2152. If any of the ARGS are libtool executable wrappers, then they are translated
  2153. into their corresponding uninstalled binary, and any of their required library
  2154. directories are added to the library path.
  2155. Then, COMMAND is executed, with ARGS as arguments."
  2156.   ;;
  2157. finish)
  2158.   $echo 
  2159. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  2160. Complete the installation of libtool libraries.
  2161. Each LIBDIR is a directory that contains libtool libraries.
  2162. The commands that this mode executes may require superuser privileges.  Use
  2163. the `--dry-run' option if you just want to see what would be executed."
  2164.   ;;
  2165. install)
  2166.   $echo 
  2167. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  2168. Install executables or libraries.
  2169. INSTALL-COMMAND is the installation command.  The first component should be
  2170. either the `install' or `cp' program.
  2171. The rest of the components are interpreted as arguments to that command (only
  2172. BSD-compatible install options are recognized)."
  2173.   ;;
  2174. link)
  2175.   $echo 
  2176. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  2177. Link object files or libraries together to form another library, or to
  2178. create an executable program.
  2179. LINK-COMMAND is a command using the C compiler that you would use to create
  2180. a program from several object files.
  2181. The following components of LINK-COMMAND are treated specially:
  2182.   -all-static       do not do any dynamic linking at all
  2183.   -dlopen FILE      `-dlpreopen' FILE if it cannot be dlopened at runtime
  2184.   -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
  2185.   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  2186.   -LLIBDIR          search LIBDIR for required installed libraries
  2187.   -lNAME            OUTPUT-FILE requires the installed library libNAME
  2188.   -no-undefined     declare that a library does not refer to external symbols
  2189.   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  2190.   -release RELEASE  specify package release information
  2191.   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  2192.   -static           do not do any dynamic linking of libtool libraries
  2193.   -version-info CURRENT[:REVISION[:AGE]]
  2194.                     specify library version info [each variable defaults to 0]
  2195. All other options (arguments beginning with `-') are ignored.
  2196. Every other argument is treated as a filename.  Files ending in `.la' are
  2197. treated as uninstalled libtool libraries, other files are standard or library
  2198. object files.
  2199. If the OUTPUT-FILE ends in `.la', then a libtool library is created, only
  2200. library objects (`.lo' files) may be specified, and `-rpath' is required.
  2201. If OUTPUT-FILE ends in `.a', then a standard library is created using `ar'
  2202. and `ranlib'.
  2203. If OUTPUT-FILE ends in `.lo' or `.o', then a reloadable object file is
  2204. created, otherwise an executable program is created."
  2205.   ;;
  2206. uninstall)
  2207.   $echo
  2208. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  2209. Remove libraries from an installation directory.
  2210. RM is the name of the program to use to delete files associated with each FILE
  2211. (typically `/bin/rm').  RM-OPTIONS are options (such as `-f') to be passed
  2212. to RM.
  2213. If FILE is a libtool library, all the files associated with it are deleted.
  2214. Otherwise, only FILE itself is deleted using RM."
  2215.   ;;
  2216. *)
  2217.   $echo "$modename: invalid operation mode `$mode'" 1>&2
  2218.   $echo "$help" 1>&2
  2219.   exit 1
  2220.   ;;
  2221. esac
  2222. echo
  2223. $echo "Try `$modename --help' for more information about other modes."
  2224. exit 0
  2225. # Local Variables:
  2226. # mode:shell-script
  2227. # sh-indentation:2
  2228. # End: