[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch #39] Handle 'install' options better
From: |
Jeff Dubrule |
Subject: |
[Patch #39] Handle 'install' options better |
Date: |
Thu, 18 Oct 2001 13:17:59 -0400 |
User-agent: |
Mutt/1.2.5i |
Here's the patch I just submitted to Savannah, for the non-web-enabled:
We need this, or something similar, here at Burlington Coat Factory,
as many of our Makefiles use slightly harder-to-parse 'install' lines,
and we aren't quite ready to take the automake plunge.
-jeff
-------------
This patch allows libtool to handle the following options to install,
that it could not before:
libtool --mode=install install -svm 664 libfoo.la /usr/lib/libfoo.la
libtool --mode=install install -m664 libfoo.la /usr/lib/libfoo.la
libtool --mode=install install -svm664 libfoo.la /usr/lib/libfoo.la
--- ltmain.in.old Mon Sep 10 19:40:18 2001
+++ ltmain.in Thu Oct 18 13:04:22 2001
@@ -4014,37 +4014,65 @@
continue
fi
- case $arg in
- -d) isdir=yes ;;
- -f) prev="-f" ;;
- -g) prev="-g" ;;
- -m) prev="-m" ;;
- -o) prev="-o" ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*) ;;
+ while test -n "$arg"; do
+ case $arg in
+ -) break ;; # Jump back to the for loop
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -f*) prev="-f" ;;
+ -g) prev="-g" ;;
+ -g*) prev="-g" ;;
+ -m) prev="-m" ;;
+ -m*) prev="-m" ;;
+ -o) prev="-o" ;;
+ -o*) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ break
+ fi
+ ;;
+ esac
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- prev=
- else
- dest="$arg"
- continue
- fi
- ;;
- esac
+ if test -n "$prev"; then
+ this_arg="$arg"
+ if test X$arg != X$prev; then
+ # An option may have its argument jammed against it
+ arg=
+ prev=
+ fi
+ else
+ this_arg=`$echo "X$arg" | $Xsed -e 's/^-\(.\).*/-\1/'`
+ fi
- # Aesthetically quote the argument.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog $arg"
+ # Aesthetically quote the argument and add it to install_prog.
+ this_arg=`$echo "X$this_arg" | $Xsed -e "$sed_quote_subst"`
+ case $this_arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ this_arg="\"$this_arg\""
+ ;;
+ esac
+ install_prog="$install_prog $this_arg"
+
+ case $arg in
+ -*)
+ # Remove the first option of the arg, and repeat
+ arg="`echo $arg | sed -e's/^-./-/'`"
+ ;;
+ *)
+ # This was an argument to an option.
+ break ;;
+ esac
+ done
done
if test -z "$install_prog"; then