Avoid use of $(...) as backticks in SH code
authorEric Brine <ikegami@adaelis.com>
Fri, 19 Apr 2013 03:57:54 +0000 (20:57 -0700)
committerRicardo Signes <rjbs@cpan.org>
Tue, 23 Apr 2013 14:15:20 +0000 (10:15 -0400)
Avoid use of $(...) as backticks in SH code as it is not supported
by all /bin/sh. RT#115708.

Makefile.SH

index 93c7385..171eb2a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # quote() - Creates a shell literal
-# Usage:  echo "...$( quote "..." )..."
+# Usage:  echo "...` quote "..." `..."
 quote() {
        case "$1" in
        '') echo "''" ;;
@@ -37,6 +37,7 @@ case "$0" in
 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
 esac
 
+pwd="`pwd`"
 linklibperl='$(LIBPERL)'
 linklibperl_nonshr=''
 shrpldflags='$(LDDLFLAGS)'
@@ -48,8 +49,8 @@ true)
        # Prefix all runs of 'miniperl' and 'perl' with
        # $ldlibpth so that ./perl finds *this* shared libperl.
        case "$LD_LIBRARY_PATH" in
-       '')  ldlibpth="LD_LIBRARY_PATH=$( quote "`pwd`" )" ;;
-       *)   ldlibpth="LD_LIBRARY_PATH=$( quote "`pwd`" ):$( quote "$LD_LIBRARY_PATH" )" ;;
+       '')  ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+       *)   ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
        esac
 
        pldlflags="$cccdlflags"
@@ -131,8 +132,8 @@ true)
                eval "ldlibpthval=\"\$$ldlibpthname\""
 
                case "$ldlibpthval" in
-               '')  ldlibpth="$ldlibpthname=$( quote "`pwd`" )" ;;
-               *)   ldlibpth="$ldlibpthname=$( quote "`pwd`" ):$( quote "$ldlibpthval" )" ;;
+               '')  ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
+               *)   ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
                esac
 
                ;;