shave-libtool.in 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # we need sed
  3. SED=@SED@
  4. if test -z "$SED" ; then
  5. SED=sed
  6. fi
  7. lt_unmangle ()
  8. {
  9. last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_]\*_la-##'`
  10. }
  11. # the real libtool to use
  12. LIBTOOL="$1"
  13. shift
  14. # if 1, don't print anything, the underlaying wrapper will do it
  15. pass_though=0
  16. # scan the arguments, keep the right ones for libtool, and discover the mode
  17. preserved_args=
  18. while test "$#" -gt 0; do
  19. opt="$1"
  20. shift
  21. case $opt in
  22. --mode=*)
  23. mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
  24. preserved_args="$preserved_args $opt"
  25. ;;
  26. -o)
  27. lt_output="$1"
  28. preserved_args="$preserved_args $opt"
  29. ;;
  30. *)
  31. preserved_args="$preserved_args $opt"
  32. ;;
  33. esac
  34. done
  35. case "$mode" in
  36. compile)
  37. # shave will be called and print the actual CC/CXX/LINK line
  38. preserved_args="--tag=CC $preserved_args --shave-mode=$mode"
  39. pass_though=1
  40. ;;
  41. link)
  42. preserved_args="--tag=CC $preserved_args --shave-mode=$mode"
  43. Q=" LINK "
  44. ;;
  45. *)
  46. # let's u
  47. # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
  48. ;;
  49. esac
  50. lt_unmangle "$lt_output"
  51. output=$last_result
  52. if test -z $V; then
  53. if test $pass_though -eq 0; then
  54. echo "$Q$output"
  55. fi
  56. $LIBTOOL --silent $preserved_args
  57. else
  58. echo $LIBTOOL $preserved_args
  59. $LIBTOOL $preserved_args
  60. fi