home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 February / PCWorld_2002-02_cd.bin / Software / Vyzkuste / pdflib / pdflib-4.0.1.sit / pdflib-4.0.1 / config / ltmain.sh < prev   
Encoding:
Text File  |  2001-02-22  |  108.6 KB  |  4,042 lines  |  [TEXT/LMAN]

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