Hello Bruno, * Bruno Haible wrote on Wed, Jan 14, 2009 at 10:51:46PM CET: > > The removal of */.libs/lt- prefixes is done so that "make check" produces > reliable results, and because the precise location of the executable used > under the hood by libtool is a detail that the user should not know about. > (Remember the need to use "./libtool --mode=execute gdb cp". Btw, I find > the need to mention --mode=execute explicitly really painful. As if the > command 'gdb' was not well known...)
Well, alias lgdb='libtool --mode=execute gdb' is still shorter than what you suggest, but for reference, here's a patch that does what you want. What do the others think, should libtool be lenient here? I don't have a strong preference (sure don't mind), the requirement for a mode seems to have been present for at least 10 years. Aside, I am not quite sure whether it is portable (to other systems or debugger versions) to assume that gdb will not be interactive when started with stdin redirected to /dev/null. Thanks, Ralf Execute mode works without --mode arg for `gdb'. * libltdl/config/ltmain.m4sh (main): If the first nonoption argument is `gdb', assume execute mode. * tests/execute-mode.at (execute mode): Test it. * doc/libtool.texi (Execute mode): Document it. * NEWS: Update. Suggestion from Bruno Haible. diff --git a/NEWS b/NEWS index 29a4d99..84bcfdd 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team: avoid multiple finish mode commands stemming from multiple installs into the same library directory. To avoid surprises, the old --finish option is deprecated now. + - `libtool --mode=execute gdb ...' works without the --mode argument, if + the program to be run is exactly `gdb'. * Changes in supported systems or compilers: diff --git a/doc/libtool.texi b/doc/libtool.texi index d6d95f2..9c62d86 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1571,6 +1571,9 @@ If any of the @var{args} are libtool executable wrappers, then they are translated into the name of their corresponding uninstalled binary, and any of their required library directories are added to the library path. +If the program to be run is @samp{gdb}, then the @option{--mode=execute} +may be omitted. + @node Install mode @section Install mode @cindex install mode diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 608dcff..298d7a4 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -436,8 +436,14 @@ $opt_help || { func_fatal_configuration "not configured to build any kind of library" fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - + if test -z "$mode"; then + case $nonopt in + gdb) mode=execute ;; + esac + if test -z "$mode"; then + func_fatal_error "error: you must specify a MODE." + fi + fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" diff --git a/tests/execute-mode.at b/tests/execute-mode.at index ef0ac07..c3370da 100644 --- a/tests/execute-mode.at +++ b/tests/execute-mode.at @@ -217,4 +217,8 @@ AT_CHECK([grep main stdout], [], [ignore]) AT_CHECK([grep liba.lo stdout], [], [ignore]) AT_CHECK([grep libfakelib.la stdout], [], [ignore]) +# Accept `gdb' also without --mode argument. +AT_CHECK([$LIBTOOL --mode=execute gdb /bin/ls </dev/null || exit 77], [], [ignore], [ignore]) +AT_CHECK([$LIBTOOL gdb /bin/ls </dev/null], [], [ignore], [ignore]) + AT_CLEANUP