3 # $Id: pamgdb.in 816 2014-09-12 07:50:22Z des $
6 srcdir="@abs_top_srcdir@"
7 builddir="@abs_top_builddir@"
9 # Make sure we get the right version of libpam
10 pam_libdir="${builddir}/lib/.libs"
11 LD_LIBRARY_PATH="${pam_libdir}:${LD_LIBRARY_PATH}"
12 LD_LIBRARY_PATH="${LD_LIBRARY_PATH%:}"
13 export LD_LIBRARY_PATH
15 # DWIM, assuming that the first positional argument is the name of the
16 # program to debug rather than a gdb option.
18 if expr "${prog}" : ".*/.*" >/dev/null ; then
19 # The first argument is an absolute or relative path. There
20 # is a good chance that it points to the wrapper script
21 # generated by libtool rather than the actual binary.
22 altprog="${prog%/*}/.libs/${prog##*/}"
23 if [ -x "${altprog}" ] ; then
27 elif expr "${prog}" : "[a-z.-][a-z.-]*" >/dev/null ; then
28 # The first argument is just the name of the program. Look for
29 # it in the build directory.
30 for libdir in $(find "${builddir}" -type d -name .libs -print) ; do
31 altprog="${libdir}/${prog}"
32 if [ -x "${altprog}" ] ; then