libtool-patches
[Top][All Lists]
Advanced

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

FYI: small quoting fixes


From: Ralf Wildenhues
Subject: FYI: small quoting fixes
Date: Sat, 2 Jul 2005 12:20:20 +0200
User-agent: Mutt/1.4.1i

I found another couple of unportable "..`..\"...\"..`.." instances
(search for the setting of output_verbose_link_cmd and of
file_magic_regex in patch below).  Decided to also go after some more
unnecessary quotes on assignment right hand sides (those which also
contained back quotes), and after `case'.

Applied to HEAD/branch-2-0 and branch-1-5, respectively.

Still TODO: an audit of use of `eval' in ltmain.  We are using it too
often, even with $echo/$ECHO and its `$' not escaped, which is wrong..

Regards,
Ralf

HEAD/branch-2-0 patch:

        * config/ltmain.m4sh (func_mode_compile, func_mode_link),
        m4/libtool.m4 (_LT_PROG_ECHO_BACKSLASH, _LT_ENABLE_LOCK):
        Remove some unnecessary quotes.

Index: config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
retrieving revision 1.1.2.55
diff -u -r1.1.2.55 ltmain.m4sh
--- config/ltmain.m4sh  21 Jun 2005 14:17:52 -0000      1.1.2.55
+++ config/ltmain.m4sh  30 Jun 2005 13:15:24 -0000
@@ -1029,7 +1029,7 @@
 
     for arg
     do
-      case "$arg_mode" in
+      case $arg_mode in
       arg  )
        # do not "continue".  Instead, add this to base_compile
        lastarg="$arg"
@@ -3769,7 +3769,7 @@
                add_dir="-L$dir"
                # Try looking first in the location we're being installed to.
                if test -n "$inst_prefix_dir"; then
-                 case "$libdir" in
+                 case $libdir in
                    [[\\/]]*)
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
                      ;;
@@ -3841,7 +3841,7 @@
              add_dir="-L$libdir"
              # Try looking first in the location we're being installed to.
              if test -n "$inst_prefix_dir"; then
-               case "$libdir" in
+               case $libdir in
                  [[\\/]]*)
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
                    ;;
@@ -4557,7 +4557,7 @@
          if test "$?" -eq 0 ; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
-             name="`expr $i : '-l\(.*\)'`"
+             name=`expr $i : '-l\(.*\)'`
              # If $name is empty we are operating on a -L argument.
              if test "$name" != "" && test "$name" -ne "0"; then
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then
@@ -4594,7 +4594,7 @@
            # Error occurred in the first compile.  Let's try to salvage
            # the situation: Compile a separate program for each library.
            for i in $deplibs; do
-             name="`expr $i : '-l\(.*\)'`"
+             name=`expr $i : '-l\(.*\)'`
              # If $name is empty we are operating on a -L argument.
              if test "$name" != "" && test "$name" != "0"; then
                $RM conftest
@@ -4646,7 +4646,7 @@
          set dummy $deplibs_check_method; shift
          file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
          for a_deplib in $deplibs; do
-           name="`expr $a_deplib : '-l\(.*\)'`"
+           name=`expr $a_deplib : '-l\(.*\)'`
            # If $name is empty we are operating on a -L argument.
            if test "$name" != "" && test  "$name" != "0"; then
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then
@@ -4715,7 +4715,7 @@
          set dummy $deplibs_check_method; shift
          match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
          for a_deplib in $deplibs; do
-           name="`expr $a_deplib : '-l\(.*\)'`"
+           name=`expr $a_deplib : '-l\(.*\)'`
            # If $name is empty we are operating on a -L argument.
            if test -n "$name" && test "$name" != "0"; then
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.125.2.62
diff -u -r1.125.2.62 libtool.m4
--- m4/libtool.m4       29 Jun 2005 08:24:19 -0000      1.125.2.62
+++ m4/libtool.m4       30 Jun 2005 13:15:24 -0000
@@ -791,8 +791,8 @@
     # find a string as large as possible, as long as the shell can cope with it
     for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q 
"[$]0"' 'echo test'; do
       # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-         echo_test_string="`eval $cmd`" &&
+      if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+         echo_test_string=`eval $cmd` &&
          (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
       then
         break
@@ -966,7 +966,7 @@
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
       *32-bit*)
        case $host in
          x86_64-*linux*)


branch-1-5 patch:

        * ltmain.in (compile mode, link mode),
        libtool.m4 (_LT_AC_PROG_ECHO_BACKSLASH, _LT_AC_LOCK,
        AC_LIBTOOL_SYS_DYNAMIC_LINKER,  AC_PATH_TOOL_PREFIX,
        AC_DEPLIBS_CHECK_METHOD,   AC_LIBTOOL_LANG_C_CONFIG,
        AC_LIBTOOL_LANG_CXX_CONFIG,  AC_LIBTOOL_POSTDEP_PREDEP,
        AC_LIBTOOL_LANG_F77_CONFIG,  AC_LIBTOOL_PROG_COMPILER_PIC,
        AC_LIBTOOL_PROG_LD_SHLIBS): Remove some unnecessary quotes.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.92
diff -u -r1.314.2.92 libtool.m4
--- libtool.m4  11 Jun 2005 11:04:30 -0000      1.314.2.92
+++ libtool.m4  30 Jun 2005 13:25:00 -0000
@@ -353,8 +353,8 @@
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q 
"[$]0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -523,7 +523,7 @@
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -1411,7 +1411,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -1981,7 +1981,7 @@
       if test -n "$file_magic_test_file"; then
        case $deplibs_check_method in
        "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic 
\(.*\)\"`"
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
            $EGREP "$file_magic_regex" > /dev/null; then
@@ -2237,7 +2237,7 @@
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic 
(s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -2625,7 +2625,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -2947,7 +2947,7 @@
     fi
   ;;
       darwin* | rhapsody*)
-        case "$host_os" in
+        case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
${wl}suppress'
          ;;
@@ -3078,7 +3078,7 @@
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*)
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
@@ -3094,7 +3094,7 @@
         ;;
       esac
     fi
-    case "$host_cpu" in
+    case $host_cpu in
     hppa*64*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -3120,7 +3120,7 @@
        _LT_AC_TAGVAR(ld_shlibs, $1)=no
        ;;
       aCC*)
-       case "$host_cpu" in
+       case $host_cpu in
        hppa*64*|ia64*)
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib 
$linker_flags $libobjs $deplibs'
          ;;
@@ -3141,7 +3141,7 @@
       *)
        if test "$GXX" = yes; then
          if test $with_gnu_ld = no; then
-           case "$host_cpu" in
+           case $host_cpu in
            ia64*|hppa*64*)
              _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib 
$linker_flags $libobjs $deplibs'
              ;;
@@ -3666,7 +3666,7 @@
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e 
\"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e 
"$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -3811,7 +3811,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -4714,7 +4714,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
        ;;
       *)
@@ -4783,7 +4783,7 @@
          aCC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
            _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a 
${ac_cv_prog_cc_wl}archive"
-           case "$host_cpu" in
+           case $host_cpu in
            hppa*64*|ia64*)
              # +Z the default
              ;;
@@ -4988,7 +4988,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
        # +Z the default
        ;;
@@ -5035,7 +5035,7 @@
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
        # +Z the default
        ;;
@@ -5153,7 +5153,7 @@
     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
@@ -5594,7 +5594,7 @@
       ;;
 
     darwin* | rhapsody*)
-      case "$host_os" in
+      case $host_os in
         rhapsody* | darwin1.[[012]])
          _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
${wl}suppress'
          ;;
@@ -5698,7 +5698,7 @@
 
     hpux10* | hpux11*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case "$host_cpu" in
+       case $host_cpu in
        hppa*64*|ia64*)
          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o 
$lib $libobjs $deplibs $compiler_flags'
          ;;
@@ -5707,7 +5707,7 @@
          ;;
        esac
       else
-       case "$host_cpu" in
+       case $host_cpu in
        hppa*64*|ia64*)
          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs 
$deplibs $linker_flags'
          ;;
@@ -5717,7 +5717,7 @@
        esac
       fi
       if test "$with_gnu_ld" = no; then
-       case "$host_cpu" in
+       case $host_cpu in
        hppa*64*)
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
          _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.73
diff -u -r1.334.2.73 ltmain.in
--- ltmain.in   21 Jun 2005 14:16:58 -0000      1.334.2.73
+++ ltmain.in   30 Jun 2005 13:25:00 -0000
@@ -575,7 +575,7 @@
 
     for arg
     do
-      case "$arg_mode" in
+      case $arg_mode in
       arg  )
        # do not "continue".  Instead, add this to base_compile
        lastarg="$arg"
@@ -2593,7 +2594,7 @@
                add_dir="-L$dir"
                # Try looking first in the location we're being installed to.
                if test -n "$inst_prefix_dir"; then
-                 case "$libdir" in
+                 case $libdir in
                    [\\/]*)
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
                      ;;
@@ -2666,7 +2667,7 @@
              add_dir="-L$libdir"
              # Try looking first in the location we're being installed to.
              if test -n "$inst_prefix_dir"; then
-               case "$libdir" in
+               case $libdir in
                  [\\/]*)
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
                    ;;
@@ -3416,7 +3418,7 @@
          if test "$?" -eq 0 ; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
-             name="`expr $i : '-l\(.*\)'`"
+             name=`expr $i : '-l\(.*\)'`
              # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" -ne "0"; then
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then
@@ -3453,7 +3455,7 @@
            # Error occurred in the first compile.  Let's try to salvage
            # the situation: Compile a separate program for each library.
            for i in $deplibs; do
-             name="`expr $i : '-l\(.*\)'`"
+             name=`expr $i : '-l\(.*\)'`
              # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
                $rm conftest
@@ -3505,7 +3507,7 @@
          set dummy $deplibs_check_method
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
          for a_deplib in $deplibs; do
-           name="`expr $a_deplib : '-l\(.*\)'`"
+           name=`expr $a_deplib : '-l\(.*\)'`
            # If $name is empty we are operating on a -L argument.
             if test "$name" != "" && test  "$name" != "0"; then
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then
@@ -3574,7 +3576,7 @@
          set dummy $deplibs_check_method
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
          for a_deplib in $deplibs; do
-           name="`expr $a_deplib : '-l\(.*\)'`"
+           name=`expr $a_deplib : '-l\(.*\)'`
            # If $name is empty we are operating on a -L argument.
            if test -n "$name" && test "$name" != "0"; then
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 
then




reply via email to

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