# Wrapper for Microsoft lib.exe
me=ar-lib
-scriptversion=2012-01-30.22; # UTC
+scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
delete=
extract=
list=
+quick=
replace=
+index=
create=
while test -n "$action"
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
+ q*) quick=yes ;;
r*) replace=yes ;;
+ s*) index=yes ;;
+ S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
action=${action#?}
done
-case $delete$extract$list$replace in
- yes)
+case $delete$extract$list$quick$replace,$index in
+ yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
done
fi
-elif test -n "$replace"; then
+elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
opts=`./ar-lib ./lib r foo.lib foo.obj`
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+# Check if ar-lib can update an existing archive with "q".
+opts=`./ar-lib ./lib q foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "u" as a modifier.
+# NOTE: "u" should have an effect, but currently doesn't.
+opts=`./ar-lib ./lib ru foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "s" as a modifier.
+opts=`./ar-lib ./lib rs foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "S" as a modifier.
+opts=`./ar-lib ./lib rS foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
# Check if ar-lib passes on @FILE with "r"
opts=`./ar-lib ./lib r foo.lib @list`
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
opts=`./ar-lib ./lib t foo.lib`
test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+# Check if ar-lib accepts "v" as a modifier.
+# NOTE: "v" should have an effect, but currently doesn't.
+opts=`./ar-lib ./lib tv foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
# Check if ar-lib can extract archive members with "x"
touch fake.lib
opts=`./ar-lib ./lib x fake.lib`
opts=`./ar-lib ./lib x fake2.lib`
test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
+# Check if ar-lib accepts "s" as an action.
+opts=`./ar-lib ./lib s foo.lib`
+test x"$opts" = x
+
: