maint: update copyright
[gnulib.git] / m4 / ldd.m4
index 84ed61b..0ec7fad 100644 (file)
--- a/m4/ldd.m4
+++ b/m4/ldd.m4
@@ -1,5 +1,5 @@
 # ldd.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -21,10 +21,10 @@ AC_DEFUN([gl_LDD],
   LDDPROG=':'
   LDDPOSTPROC=
   dnl First try objdump, since it works when cross-compiling.
-  AC_CHECK_TOOL([OBJDUMP], [objdump], [:])
+  AC_CHECK_TOOL([OBJDUMP], [objdump], [false])
 changequote(,)dnl
-  if test "$OBJDUMP" != ":"; then
-    LDDPROG="LC_ALL=C $OBJDUMP -p"
+  if test "$OBJDUMP" != "false"; then
+    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 @@ changequote(,)dnl
       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:
@@ -70,16 +70,16 @@ changequote(,)dnl
           dnl                         ***Loader Section***
           dnl                       Loader Header Information
           dnl VERSION#         #SYMtableENT     #RELOCent        LENidSTR
-          dnl 0x00000001       0x00000005       0x0000000d       0x0000001e       
-          dnl 
+          dnl 0x00000001       0x00000005       0x0000000d       0x0000001e
+          dnl
           dnl #IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
-          dnl 0x00000002       0x00000134       0x0000000d       0x00000152       
-          dnl 
-          dnl 
+          dnl 0x00000002       0x00000134       0x0000000d       0x00000152
+          dnl
+          dnl
           dnl                         ***Import File Strings***
-          dnl INDEX  PATH                          BASE                MEMBER              
-          dnl 0      /usr/lib:/lib                                                         
-          dnl 1                                    libc.a              shr.o               
+          dnl INDEX  PATH                          BASE                MEMBER
+          dnl 0      /usr/lib:/lib
+          dnl 1                                    libc.a              shr.o
           dnl
           LDDPOSTPROC="2>/dev/null | sed -e '/^[^0-9]/d' -e '/^0x/d' | sed -n -e 's,^[0-9]*         *\\([^     ]*\\).*\$,\\1,p' | sed -e 's,^.*/,,'"
           ;;
@@ -91,17 +91,17 @@ changequote(,)dnl
           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 
+          dnl program:
+          dnl          shared executable
           dnl          shared library dynamic path search:
-          dnl              SHLIB_PATH     disabled  second 
+          dnl              SHLIB_PATH     disabled  second
           dnl              embedded path  disabled  first  Not Defined
           dnl          shared library list:
           dnl              dynamic   /usr/lib/libc.2
           dnl          shared library binding:
-          dnl              deferred 
+          dnl              deferred
           dnl          global hash table disabled
           dnl          plabel caching disabled
           dnl          global hash array size:1103
@@ -126,7 +126,7 @@ changequote(,)dnl
           dnl a.out:
           dnl          32-bit ELF executable
           dnl          shared library dynamic path search:
-          dnl              LD_LIBRARY_PATH    enabled  first 
+          dnl              LD_LIBRARY_PATH    enabled  first
           dnl              SHLIB_PATH         enabled  second
           dnl              embedded path      enabled  third  /usr/lib/hpux32:/opt/langtools/lib/hpux32
           dnl          shared library list:
@@ -144,7 +144,7 @@ changequote(,)dnl
           dnl                  7 text     04000000     z---c-    D (default)
           dnl                  8 data     40000000     ---m--    D (default)
           dnl          executable from stack: D (default)
-          dnl          kernel assisted branch prediction enabled 
+          dnl          kernel assisted branch prediction enabled
           dnl          lazy swap allocation for dynamic segments disabled
           dnl          nulptr references disabled
           dnl          address space model: default
@@ -166,14 +166,14 @@ changequote(,)dnl
           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 @@ changequote(,)dnl
           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 @@ changequote(,)dnl
       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])