libtool-patches
[Top][All Lists]
Advanced

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

SCO/buffix patch 6 of 10: AC_PROG_NM fixes


From: Kean Johnston
Subject: SCO/buffix patch 6 of 10: AC_PROG_NM fixes
Date: Sun, 30 Oct 2005 17:06:10 -0800
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Patch 6 of 10 attached ...
Rationale:
The test for a suitable nm was too restrictive. First, it would only check
for nm with $ac_tool_prefix. But only the GNU version of nm installs itself
that way. This was thwarting finding a non-binutils nm on the path.

Second, added /usr/ccs/bin/elf to the list of paths to search, before
/usr/ccs/bin. On OpenServer, this makes sure we pick up the ELF version,
as it is a multi-ABI world, and /usr/ccs/bin/nm is a COFF/ELF schizophrenic
version that accepts slightly different arguments. This wont affect any
other systems becuase AFAIK only OSR5 has a /usr/ccs/bin/elf, and any
other system that may conceivably have it is likely to want the ELF version
of nm anyway.

Third, dont do the 'sed 1q' stuff, but grep the output returned. The
'sed 1q' was causing false negatives if there was only a single line of
output. By using grep on the entire output, we will still get the correct
result, even on HP-UX if it first ejects a warning message about unknown
options.

2005-10-24  Kean Johnston  <address@hidden>

        * libtool.m4(AC_PROG_NM): Add /usr/ccs/bin/elf to search path list.
        Look for tool both with and without ac_tool_prefix. Use grep on output
        results and dont delete first line of output in case output is
        only one line long.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.115
diff -u -3 -p -r1.314.2.115 libtool.m4
--- libtool.m4  9 Oct 2005 06:26:21 -0000       1.314.2.115
+++ libtool.m4  30 Oct 2005 21:22:24 -0000
@@ -2375,33 +2386,37 @@ AC_DEFUN([AC_PROG_NM],
   lt_cv_path_NM="$NM"
 else
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+  for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
     IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+    tmp_nm_file="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm_file" || test -f "$tmp_nm_file$ac_exeext" ; then
+      tmp_nm=$tmp_nm_file
+    else
+      tmp_nm_file="$ac_dir/nm"
+      if test -f "$tmp_nm_file" || test -f "$tmp_nm_file$ac_exeext" ; then
+        tmp_nm=$tmp_nm_file
+      fi
+    fi
+    if test -n "$tmp_nm" ; then
       # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
       # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-       lt_cv_path_NM="$tmp_nm -B"
+      tmp_nm_out=`$tmp_nm -B /dev/null 2>&1`
+      echo "$tmp_nm_out" | $EGREP '.*/dev/null.*|.*Invalid file or object 
type.*' > /dev/null 2>&1
+      if test $? -eq 0; then
+        lt_cv_path_NM="$tmp_nm -B"
        break
-        ;;
-      *)
-       case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-       */dev/null*)
+      else
+        tmp_nm_out=`$tmp_nm -p /dev/null 2>&1`
+        echo "$tmp_nm_out" | $EGREP '.*/dev/null.*' > /dev/null 2>&1
+       if test $? -eq 0; then
          lt_cv_path_NM="$tmp_nm -p"
          break
-         ;;
-       *)
+       else
          lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
          continue # so that we can try to find one that supports BSD flags
-         ;;
-       esac
-        ;;
-      esac
+       fi
+      fi
     fi
   done
   IFS="$lt_save_ifs"

reply via email to

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