bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'ldd'


From: Bruno Haible
Subject: Re: new module 'ldd'
Date: Thu, 12 Jan 2006 18:59:13 +0100
User-agent: KMail/1.5

Ralf Wildenhues wrote:
> >   AC_CHECK_TOOL([OBJDUMP], [objdump], [:])
>
> This will conflict with libtool-set $OBJDUMP in packages that use
> libtool.  Libtool currently uses
>   AC_CHECK_TOOL([OBJDUMP], [objdump], [false])

OK, I'm changing ldd.m4 to use the same.

> This is not portable to packages that use libtool.

Do you see other incompatibilities?

The fact that a libtool created "program" is not actually a program but a
script, is a problem of libtool. Fix that, then we can also use
"gdb program" instead of the surprising syntax "libtool gdb program".

> >     LDDPROG="LC_ALL=C $OBJDUMP -p"
>
> I'd rather put the LC_ALL=C elsewhere.  configure scripts set this by
> default already.  Your shell wrapper could trivially set this before
> invoking the tool.

The LDDPROG can also be used outside the shell wrapper, by other macros
or Makefile commands, where LC_ALL=C is not necessarily guaranteed. But
it will probably not hurt if I put LC_ALL=C before any LDDPROG value.

Bruno


--- ldd.m4      12 Jan 2006 18:04:16 -0000      1.3
+++ ldd.m4      12 Jan 2006 18:06:59 -0000
@@ -24,7 +24,7 @@
   AC_CHECK_TOOL([OBJDUMP], [objdump], [false])
 changequote(,)dnl
   if test "$OBJDUMP" != "false"; then
-    LDDPROG="LC_ALL=C $OBJDUMP -p"
+    LDDPROG="$OBJDUMP -p"
     dnl The output of "LC_ALL=C objdump -p program" of a program or library
     dnl looks like this:
     dnl
@@ -62,7 +62,7 @@
       dnl Not cross-compiling. Try system dependent vendor tools.
       case "$host_os" in
         aix*)
-          LDDPROG="LC_ALL=C dump -H"
+          LDDPROG="dump -H"
           dnl The output of "LC_ALL=C dump -H program" looks like this:
           dnl
           dnl program:
@@ -91,7 +91,7 @@
           LDDPOSTPROC="2>/dev/null | sed -n -e 's,^    \\([^   
]*\\).*\$,\\1,p' | sed -e 's,^.*/,,'"
           ;;
         hpux*)
-          LDDPROG="LC_ALL=C chatr"
+          LDDPROG="chatr"
           dnl The output of "LC_ALL=C chatr program" looks like this:
           dnl program: 
           dnl          shared executable 
@@ -166,14 +166,14 @@
           LDDPOSTPROC="2>/dev/null | sed -n -e 's,^[[][0-9]*[]].*      0x[^    
]*      [^      ][^     ]*      \\([^   ][^     ]*\\).*\$,\\1,p' | sed -e 
's,^.*/,,'"
           ;;
         linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) # glibc-based systems
-          LDDPROG="LC_ALL=C ldd"
+          LDDPROG="ldd"
           dnl The output of "ldd program" looks like this:
           dnl         libc.so.6 => /lib/libc.so.6 (0x4002d000)
           dnl         /lib/ld-linux.so.2 (0x40000000)
           LDDPOSTPROC="2>/dev/null | sed -n -e 's,^    \\([^   ][^     
]*\\).*\$,\\1,p' | sed -e 's,^.*/,,'"
           ;;
         osf*)
-          LDDPROG="LC_ALL=C odump -Dl"
+          LDDPROG="odump -Dl"
           dnl The output of "odump -Dl program" looks like this:
           dnl
           dnl                         ***LIBRARY LIST SECTION***
@@ -184,7 +184,7 @@
           LDDPOSTPROC="2>/dev/null | sed -n -e 's,^    \\([^   ][^     
]*\\).*,\\1,p' | sed -e '/^Name\$/d' | sed -e 's,^.*/,,'"
           ;;
         solaris*)
-          LDDPROG="LC_ALL=C ldd"
+          LDDPROG="ldd"
           dnl The output of "ldd program" looks like this:
           dnl         libc.so.1 =>     /usr/lib/libc.so.1
           dnl         libdl.so.1 =>    /usr/lib/libdl.so.1
@@ -197,6 +197,10 @@
       esac
     fi
   fi
+  dnl Avoid locale dependencies.
+  if test "$LDDPROG" != ":"; then
+    LDDPROG="LC_ALL=C $LDDPROG"
+  fi
 changequote([,])dnl
   AC_SUBST([LDDPROG])
   AC_SUBST([LDDPOSTPROC])





reply via email to

[Prev in Thread] Current Thread [Next in Thread]