ltmain.sh
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:108k
源码类别:

MySQL数据库

开发平台:

Visual C++

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