]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Document --mode short-hands better, and test them.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 29 Jan 2009 18:54:31 +0000 (19:54 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 29 Jan 2009 18:55:19 +0000 (19:55 +0100)
* doc/libtool.texi (Invoking libtool): Give examples for using
the `--mode=MODE' short-hand `MODE', or abbreviations thereof.
* libltdl/config/ltmain.m4sh: Mention the short-hand for MODE
in the --help output.
* tests/help.at (mode short-hands): New test group.
Suggestion by Bruno Haible.

ChangeLog
doc/libtool.texi
libltdl/config/ltmain.m4sh
tests/help.at

index 7c92026de2ae93d4446f2f07a087db51916e97c6..2a54a646496ae03471fd6e7e818beaeba1a97161 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-01-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Document --mode short-hands better, and test them.
+       * doc/libtool.texi (Invoking libtool): Give examples for using
+       the `--mode=MODE' short-hand `MODE', or abbreviations thereof.
+       * libltdl/config/ltmain.m4sh: Mention the short-hand for MODE
+       in the --help output.
+       * tests/help.at (mode short-hands): New test group.
+       Suggestion by Bruno Haible.
+
        func_version copes with multi-line copyright headers.
        * libltdl/config/getopt.m4sh (func_version): Slurp in copyright
        lines until a period is found.
index c3a2906332e8fca8cc1430acba50e6fc9ad31fc4..02340d9237758d0d5c5f33bfd60ef1f6b53ff745 100644 (file)
@@ -1161,8 +1161,16 @@ operation mode, and exit.
 Use @var{mode} as the operation mode.  When using libtool from the
 command line, you can give just @var{mode} (or a unique abbreviation
 of it) as the first argument as a shorthand for the full
-@option{--mode=@var{mode}}.
+@option{--mode=@var{mode}}.  For example, the following are equivalent:
 
+@example
+$ @kbd{libtool --mode=execute --dry-run gdb prog.exe}
+$ @kbd{libtool        execute --dry-run gdb prog.exe}
+$ @kbd{libtool        exe     --dry-run gdb prog.exe}
+$ @kbd{libtool        e       --dry-run gdb prog.exe}
+@end example
+
+@noindent
 @var{mode} must be set to one of the following:
 
 @table @option
index 83bfaf441f52b3c4367912d82f1ecb20ac2f7016..de63a8301464277bf3e95e6642a179116075ae24 100644 (file)
@@ -59,7 +59,8 @@ m4_divert_push([SCRIPT])# @configure_input@
 #         link               create a library or an executable
 #         uninstall          remove libraries from an installed directory
 #
-# MODE-ARGS vary depending on the MODE.
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
 #
 # When reporting a bug, please describe a test case to reproduce it and
index f0e7e9448266ce8312580391a3167f1321cc199c..3460a2b47558429c7bec23eef001bdb78a4a1b7b 100644 (file)
@@ -36,3 +36,55 @@ AT_CHECK([$LIBTOOL --version], [], [stdout])
 AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
 
 AT_CLEANUP
+
+
+AT_SETUP([mode short-hands])
+
+AT_DATA([a.c],
+[[int a () { return 0; }
+]])
+
+AT_DATA([main.c],
+[[extern int a ();
+int main () { return a (); }
+]])
+
+inst=`pwd`/inst
+libdir=$inst/lib
+bindir=$inst/bin
+mkdir $inst $libdir $bindir
+
+AT_CHECK([$LIBTOOL compile $CC $CPPFLAGS $CFLAGS -c a.c],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL co $CC $CPPFLAGS $CFLAGS -c main.c],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL co $CC $CPPFLAGS $CFLAGS -c main.c],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL link $CC $CFLAGS $LDFLAGS -o liba.la a.lo ]dnl
+        [-no-undefined -rpath $libdir], [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL l $CC $CFLAGS $LDFLAGS -o main$EXEEXT main.lo ]dnl
+        [liba.la], [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL execute --dry-run ./main$EXEEXT],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL exe --dry-run ./main$EXEEXT],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL e --dry-run ./main$EXEEXT],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL install cp liba.la $libdir],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL i cp main$EXEEXT $bindir],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL finish $libdir],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL f $libdir],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL uninstall rm -f $libdir/liba.la],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL u rm -f $bindir/main$EXEEXT],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL clean rm -f main$EXEEXT],
+        [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL cl liba.la],
+        [], [ignore], [ignore])
+
+AT_CLEANUP