[njs] Using "printf" instead of "echo -n" for portability.

Dmitry Volyntsev xeioex at nginx.com
Tue Aug 20 17:51:53 UTC 2019


details:   https://hg.nginx.org/njs/rev/7b1a00168b25
branches:  
changeset: 1136:7b1a00168b25
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Aug 20 20:51:39 2019 +0300
description:
Using "printf" instead of "echo -n" for portability.

This closes #205 issue on Github.

diffstat:

 auto/cc       |  164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 auto/clang    |  162 ---------------------------------------------------------
 auto/deps     |   12 ++--
 auto/echo     |   12 ----
 auto/expect   |   10 +-
 auto/feature  |   24 ++++----
 auto/make     |   16 ++--
 auto/os       |   10 +---
 auto/pcre     |    8 +-
 auto/readline |    2 +-
 configure     |    1 +
 11 files changed, 202 insertions(+), 219 deletions(-)

diffs (635 lines):

diff -r e848c0ee1238 -r 7b1a00168b25 auto/cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/cc	Tue Aug 20 20:51:39 2019 +0300
@@ -0,0 +1,164 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+echo checking for C compiler: $CC
+cat << END >> $NJS_AUTOCONF_ERR
+----------------------------------------
+checking for C compiler: $CC
+END
+
+
+# Allow error exit status.
+set +e
+
+if [ -z `which $CC` ]; then
+    echo
+    echo $0: error: $CC not found.
+    echo
+    exit 1;
+fi
+
+
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NJS_AUTOCONF_ERR 2>&1`
+then
+    NJS_CC_NAME=gcc
+    echo " + using GNU C compiler"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" 2>&1`
+    echo " + $NJS_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NJS_AUTOCONF_ERR 2>&1`
+then
+    NJS_CC_NAME=clang
+    echo " + using Clang C compiler"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" 2>&1`
+    echo " + $NJS_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -v)" 2>&1 \
+                 | grep "Apple LLVM version" >> $NJS_AUTOCONF_ERR 2>&1`
+then
+    NJS_CC_NAME=clang
+    echo " + using Clang C compiler"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "Apple LLVM version" 2>&1`
+    echo " + $NJS_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NJS_AUTOCONF_ERR 2>&1`
+then
+    NJS_CC_NAME=SunC
+    echo " + using Sun C compiler"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
+    echo " + $NJS_CC_VERSION"
+
+fi # SunC
+fi # Apple LLVM clang
+fi # clang
+fi # gcc
+
+
+case $NJS_CC_NAME in
+
+    gcc)
+        njs_define=NJS_GCC . auto/define
+
+        NJS_CFLAGS="$NJS_CFLAGS -pipe"
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
+
+        # Do not export symbols except explicitly marked with NJS_EXPORT.
+        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
+
+        # c99/gnu99 conflict with Solaris XOPEN.
+        #NJS_CFLAGS="$NJS_CFLAGS -std=gnu99"
+
+        NJS_CFLAGS="$NJS_CFLAGS -O"
+        #NJS_CFLAGS="$NJS_CFLAGS -O0"
+        NJS_CFLAGS="$NJS_CFLAGS -W -Wall -Wextra"
+
+        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
+        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
+        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
+
+        # -O2 enables -fstrict-aliasing and -fstrict-overflow.
+        #NJS_CFLAGS="$NJS_CFLAGS -O2"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wno-strict-aliasing"
+
+        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
+        #NJS_CFLAGS="$NJS_CFLAGS -momit-leaf-frame-pointer"
+
+        # -Wstrict-overflow is supported by GCC 4.2+.
+        #NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
+
+        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
+
+        # Stop on warning.
+        NJS_CFLAGS="$NJS_CFLAGS -Werror"
+
+        # Debug.
+        NJS_CFLAGS="$NJS_CFLAGS -g"
+    ;;
+
+    clang)
+        njs_define=NJS_CLANG . auto/define
+
+        NJS_CFLAGS="$NJS_CFLAGS -pipe"
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
+
+        # Do not export symbols except explicitly marked with NJS_EXPORT.
+        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
+
+        NJS_CFLAGS="$NJS_CFLAGS -O"
+        #NJS_CFLAGS="$NJS_CFLAGS -O0"
+        NJS_CFLAGS="$NJS_CFLAGS -W -Wall -Wextra"
+
+        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
+        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
+        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
+        #NJS_CFLAGS="$NJS_CFLAGS -O2"
+        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
+        NJS_CFLAGS="$NJS_CFLAGS -fstrict-aliasing"
+        NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
+
+        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
+
+        # Stop on warning.
+        NJS_CFLAGS="$NJS_CFLAGS -Werror"
+
+        # Debug.
+
+        if [ "$NJS_SYSTEM_PLATFORM" != "powerpc" ]; then
+            # "-g" flag causes the "unknown pseudo-op: `.cfi_sections'"
+            # error on PowerPC Clang.
+            NJS_CFLAGS="$NJS_CFLAGS -g"
+        fi
+    ;;
+
+    SunC)
+        njs_define=NJS_SUNC . auto/define
+
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
+        # Optimization.
+        NJS_CFLAGS="$NJS_CFLAGS -O -fast"
+        # Stop on warning.
+        NJS_CFLAGS="$NJS_CFLAGS -errwarn=%all"
+        # Debug.
+        NJS_CFLAGS="$NJS_CFLAGS -g"
+    ;;
+
+    *)
+    ;;
+
+esac
+
+# Stop on error exit status again.
+set -e
+
+cat << END >> $NJS_MAKEFILE
+
+NJS_CC =	${CC}
+NJS_CFLAGS =	${NJS_CFLAGS} ${CFLAGS}
+END
diff -r e848c0ee1238 -r 7b1a00168b25 auto/clang
--- a/auto/clang	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/clang	Tue Aug 20 20:51:39 2019 +0300
@@ -2,168 +2,6 @@
 # Copyright (C) Igor Sysoev
 # Copyright (C) NGINX, Inc.
 
-
-$echo checking for C compiler: $CC
-cat << END >> $NJS_AUTOCONF_ERR
-----------------------------------------
-checking for C compiler: $CC
-END
-
-
-# Allow error exit status.
-set +e
-
-if [ -z `which $CC` ]; then
-    $echo
-    $echo $0: error: $CC not found.
-    $echo
-    exit 1;
-fi
-
-
-if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NJS_AUTOCONF_ERR 2>&1`
-then
-    NJS_CC_NAME=gcc
-    $echo " + using GNU C compiler"
-    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" 2>&1`
-    $echo " + $NJS_CC_VERSION"
-
-else
-if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NJS_AUTOCONF_ERR 2>&1`
-then
-    NJS_CC_NAME=clang
-    $echo " + using Clang C compiler"
-    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" 2>&1`
-    $echo " + $NJS_CC_VERSION"
-
-else
-if `/bin/sh -c "($CC -v)" 2>&1 \
-                 | grep "Apple LLVM version" >> $NJS_AUTOCONF_ERR 2>&1`
-then
-    NJS_CC_NAME=clang
-    $echo " + using Clang C compiler"
-    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "Apple LLVM version" 2>&1`
-    $echo " + $NJS_CC_VERSION"
-
-else
-if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NJS_AUTOCONF_ERR 2>&1`
-then
-    NJS_CC_NAME=SunC
-    $echo " + using Sun C compiler"
-    NJS_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
-    $echo " + $NJS_CC_VERSION"
-
-fi # SunC
-fi # Apple LLVM clang
-fi # clang
-fi # gcc
-
-
-case $NJS_CC_NAME in
-
-    gcc)
-        njs_define=NJS_GCC . auto/define
-
-        NJS_CFLAGS="$NJS_CFLAGS -pipe"
-        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
-
-        # Do not export symbols except explicitly marked with NJS_EXPORT.
-        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
-
-        # c99/gnu99 conflict with Solaris XOPEN.
-        #NJS_CFLAGS="$NJS_CFLAGS -std=gnu99"
-
-        NJS_CFLAGS="$NJS_CFLAGS -O"
-        #NJS_CFLAGS="$NJS_CFLAGS -O0"
-        NJS_CFLAGS="$NJS_CFLAGS -W -Wall -Wextra"
-
-        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
-        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
-        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
-        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
-
-        # -O2 enables -fstrict-aliasing and -fstrict-overflow.
-        #NJS_CFLAGS="$NJS_CFLAGS -O2"
-        #NJS_CFLAGS="$NJS_CFLAGS -Wno-strict-aliasing"
-
-        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
-        #NJS_CFLAGS="$NJS_CFLAGS -momit-leaf-frame-pointer"
-
-        # -Wstrict-overflow is supported by GCC 4.2+.
-        #NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
-
-        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
-
-        # Stop on warning.
-        NJS_CFLAGS="$NJS_CFLAGS -Werror"
-
-        # Debug.
-        NJS_CFLAGS="$NJS_CFLAGS -g"
-    ;;
-
-    clang)
-        njs_define=NJS_CLANG . auto/define
-
-        NJS_CFLAGS="$NJS_CFLAGS -pipe"
-        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
-
-        # Do not export symbols except explicitly marked with NJS_EXPORT.
-        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
-
-        NJS_CFLAGS="$NJS_CFLAGS -O"
-        #NJS_CFLAGS="$NJS_CFLAGS -O0"
-        NJS_CFLAGS="$NJS_CFLAGS -W -Wall -Wextra"
-
-        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
-        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
-        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
-        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
-        #NJS_CFLAGS="$NJS_CFLAGS -O2"
-        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
-        NJS_CFLAGS="$NJS_CFLAGS -fstrict-aliasing"
-        NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
-
-        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
-
-        # Stop on warning.
-        NJS_CFLAGS="$NJS_CFLAGS -Werror"
-
-        # Debug.
-
-        if [ "$NJS_SYSTEM_PLATFORM" != "powerpc" ]; then
-            # "-g" flag causes the "unknown pseudo-op: `.cfi_sections'"
-            # error on PowerPC Clang.
-            NJS_CFLAGS="$NJS_CFLAGS -g"
-        fi
-    ;;
-
-    SunC)
-        njs_define=NJS_SUNC . auto/define
-
-        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
-        # Optimization.
-        NJS_CFLAGS="$NJS_CFLAGS -O -fast"
-        # Stop on warning.
-        NJS_CFLAGS="$NJS_CFLAGS -errwarn=%all"
-        # Debug.
-        NJS_CFLAGS="$NJS_CFLAGS -g"
-    ;;
-
-    *)
-    ;;
-
-esac
-
-# Stop on error exit status again.
-set -e
-
-cat << END >> $NJS_MAKEFILE
-
-NJS_CC =	${CC}
-NJS_CFLAGS =	${NJS_CFLAGS} ${CFLAGS}
-END
-
-
 # C language features.
 
 njs_feature="GCC unsigned __int128"
diff -r e848c0ee1238 -r 7b1a00168b25 auto/deps
--- a/auto/deps	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/deps	Tue Aug 20 20:51:39 2019 +0300
@@ -7,23 +7,23 @@ case "$NJS_CC_NAME" in
 
     SunC):
         njs_gen_dep_flags() {
-            $echo "-xMMD -xMF $NJS_BUILD_DIR/$1.tmp"
+            echo "-xMMD -xMF $NJS_BUILD_DIR/$1.tmp"
         }
 
         njs_gen_dep_post() {
-            $echo -n "@sed -e 's#^.*:#$NJS_BUILD_DIR/$2:#' "
-            $echo -n "$NJS_BUILD_DIR/$1.tmp > $NJS_BUILD_DIR/$1"
-            $echo " && rm -f $NJS_BUILD_DIR/$1.tmp"
+            printf "@sed -e 's#^.*:#$NJS_BUILD_DIR/$2:#' "
+            printf "$NJS_BUILD_DIR/$1.tmp > $NJS_BUILD_DIR/$1"
+            echo " && rm -f $NJS_BUILD_DIR/$1.tmp"
         }
     ;;
 
     *)
         njs_gen_dep_flags() {
-            $echo "-MMD -MF $NJS_BUILD_DIR/$1 -MT $NJS_BUILD_DIR/$2"
+            echo "-MMD -MF $NJS_BUILD_DIR/$1 -MT $NJS_BUILD_DIR/$2"
         }
 
         njs_gen_dep_post() {
-            $echo ""
+            echo ""
         }
     ;;
 esac
diff -r e848c0ee1238 -r 7b1a00168b25 auto/echo
--- a/auto/echo	Tue Aug 20 20:51:33 2019 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) NGINX, Inc.
-
-
-if [ "x$1" = x-n ]; then
-   shift
-   echo "$*\c"
-
-else
-   echo "$*"
-fi
diff -r e848c0ee1238 -r 7b1a00168b25 auto/expect
--- a/auto/expect	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/expect	Tue Aug 20 20:51:39 2019 +0300
@@ -3,18 +3,18 @@
 # Copyright (C) NGINX, Inc.
 
 njs_found=no
-$echo -n "checking for expect ..."
+printf "checking for expect ..."
 
 if /bin/sh -c "(expect -v)" >> $NJS_AUTOCONF_ERR 2>&1; then
     njs_found=yes
 fi
 
 if [ $njs_found = yes ]; then
-    $echo " found"
-    $echo " + Expect version: `expect -v`"
+    echo " found"
+    echo " + Expect version: `expect -v`"
 
 else
-    $echo " not found"
+    echo " not found"
 fi
 
 if [ $njs_found = yes -a $NJS_HAVE_READLINE = YES ]; then
@@ -26,7 +26,7 @@ expect_test:	njs test/njs_expect_test.ex
 END
 
 else
-    $echo " - expect tests are disabled"
+    echo " - expect tests are disabled"
 
     cat << END >> $NJS_MAKEFILE
 
diff -r e848c0ee1238 -r 7b1a00168b25 auto/feature
--- a/auto/feature	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/feature	Tue Aug 20 20:51:39 2019 +0300
@@ -3,7 +3,7 @@
 # Copyright (C) NGINX, Inc.
 
 
-$echo -n "checking for $njs_feature ..."
+printf "checking for $njs_feature ..."
 
 cat << END >> $NJS_AUTOCONF_ERR
 ----------------------------------------
@@ -52,10 +52,10 @@ if [ -x $NJS_AUTOTEST ]; then
 
         value)
             if /bin/sh -c "($NJS_AUTOTEST)" >> $NJS_AUTOCONF_ERR 2>&1; then
-                $echo >> $NJS_AUTOCONF_ERR
+                echo >> $NJS_AUTOCONF_ERR
                 njs_found=yes
                 njs_feature_value=`$NJS_AUTOTEST`
-                $echo " $njs_feature_value"
+                echo " $njs_feature_value"
                 if [ -n "$njs_feature_name" ]; then
                     cat << END >> $NJS_AUTO_CONFIG_H
 
@@ -66,13 +66,13 @@ if [ -x $NJS_AUTOTEST ]; then
 END
                 fi
             else
-                $echo " not found"
+                echo " not found"
             fi
         ;;
 
         yes)
             if /bin/sh -c "($NJS_AUTOTEST)" >> $NJS_AUTOCONF_ERR 2>&1; then
-                $echo " found"
+                echo " found"
                 njs_found=yes
                 cat << END >> $NJS_AUTO_CONFIG_H
 
@@ -82,12 +82,12 @@ END
 
 END
             else
-                $echo " found but is not working"
+                echo " found but is not working"
             fi
         ;;
 
         *)
-            $echo " found"
+            echo " found"
             njs_found=yes
             cat << END >> $NJS_AUTO_CONFIG_H
 
@@ -100,13 +100,13 @@ END
     esac
 
 else
-    $echo " not found"
+    echo " not found"
 
-    $echo "----------"    >> $NJS_AUTOCONF_ERR
+    echo "----------"    >> $NJS_AUTOCONF_ERR
     cat $NJS_AUTOTEST.c       >> $NJS_AUTOCONF_ERR
-    $echo "----------"    >> $NJS_AUTOCONF_ERR
-    $echo $njs_test       >> $NJS_AUTOCONF_ERR
-    $echo "----------"    >> $NJS_AUTOCONF_ERR
+    echo "----------"    >> $NJS_AUTOCONF_ERR
+    echo $njs_test       >> $NJS_AUTOCONF_ERR
+    echo "----------"    >> $NJS_AUTOCONF_ERR
 fi
 
 rm -rf $NJS_AUTOTEST*
diff -r e848c0ee1238 -r 7b1a00168b25 auto/make
--- a/auto/make	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/make	Tue Aug 20 20:51:39 2019 +0300
@@ -4,7 +4,7 @@
 
 . auto/deps
 
-$echo "creating $NJS_MAKEFILE"
+echo "creating $NJS_MAKEFILE"
 
 mkdir -p $NJS_BUILD_DIR/src
 mkdir -p $NJS_BUILD_DIR/test
@@ -24,29 +24,29 @@ END
 
 # The include paths list.
 
-$echo -n "NJS_LIB_INCS =" >> $NJS_MAKEFILE
+printf "NJS_LIB_INCS =" >> $NJS_MAKEFILE
 
 for njs_inc in src $NJS_BUILD_DIR
 do
-	$echo -n " -I$njs_inc" >> $NJS_MAKEFILE
+	printf " -I$njs_inc" >> $NJS_MAKEFILE
 done
 
-$echo >> $NJS_MAKEFILE
-$echo >> $NJS_MAKEFILE
+echo >> $NJS_MAKEFILE
+echo >> $NJS_MAKEFILE
 
 
 # The njs object files list.
 
-$echo "NJS_LIB_OBJS = \\" >> $NJS_MAKEFILE
+echo "NJS_LIB_OBJS = \\" >> $NJS_MAKEFILE
 
 for njs_src in $NJS_LIB_SRCS
 do
     fname=$(basename $njs_src)
     njs_obj="src/${fname%.c}.o"
-    $echo "    $NJS_BUILD_DIR/$njs_obj \\" >> $NJS_MAKEFILE
+    echo "    $NJS_BUILD_DIR/$njs_obj \\" >> $NJS_MAKEFILE
 done
 
-$echo >> $NJS_MAKEFILE
+echo >> $NJS_MAKEFILE
 
 # The njs static library.
 
diff -r e848c0ee1238 -r 7b1a00168b25 auto/os
--- a/auto/os	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/os	Tue Aug 20 20:51:39 2019 +0300
@@ -13,7 +13,6 @@ case "$NJS_SYSTEM" in
         NJS_SYSTEM_VERSION=`uname -r 2>/dev/null`
         # Linux uname -p can return "unknown".
         NJS_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
-        echo=echo
         CC=${CC:-cc}
 
         # NAN and INFINITY require _GNU_SOURCE on old Linux.
@@ -23,7 +22,6 @@ case "$NJS_SYSTEM" in
     FreeBSD | NetBSD | OpenBSD)
         NJS_SYSTEM_VERSION=`uname -r 2>/dev/null`
         NJS_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
-        echo=echo
         CC=${CC:-cc}
         ;;
 
@@ -31,27 +29,21 @@ case "$NJS_SYSTEM" in
         njs_define=NJS_SOLARIS . auto/define
         NJS_SYSTEM_VERSION=`uname -r 2>/dev/null`
         NJS_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
-        # Solaris /bin/sh and /bin/echo do not support "-n" option.
-        echo=auto/echo
         CC=${CC:-gcc}
         ;;
 
     Darwin)
         NJS_SYSTEM_VERSION=`uname -r 2>/dev/null`
         NJS_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
-        # MacOSX /bin/sh is bash and its embedded "echo" command
-        # does not support "-n" option.
-        echo=/bin/echo
         CC=${CC:-cc}
         ;;
 
     *)
         NJS_SYSTEM_VERSION=`uname -r 2>/dev/null`
         NJS_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
-        echo=echo
         CC=${CC:-gcc}
         ;;
 
 esac
 
-$echo configuring for $NJS_SYSTEM $NJS_SYSTEM_VERSION $NJS_SYSTEM_PLATFORM
+echo configuring for $NJS_SYSTEM $NJS_SYSTEM_VERSION $NJS_SYSTEM_PLATFORM
diff -r e848c0ee1238 -r 7b1a00168b25 auto/pcre
--- a/auto/pcre	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/pcre	Tue Aug 20 20:51:39 2019 +0300
@@ -32,10 +32,10 @@ if /bin/sh -c "(pcre-config --version)" 
 fi
 
 if [ $njs_found = no ]; then
-    $echo
-    $echo $0: error: no PCRE library found.
-    $echo
+    echo
+    echo $0: error: no PCRE library found.
+    echo
     exit 1;
 fi
 
-$echo " + PCRE version: `pcre-config --version`"
+echo " + PCRE version: `pcre-config --version`"
diff -r e848c0ee1238 -r 7b1a00168b25 auto/readline
--- a/auto/readline	Tue Aug 20 20:51:33 2019 +0300
+++ b/auto/readline	Tue Aug 20 20:51:39 2019 +0300
@@ -77,5 +77,5 @@ if [ $njs_found = yes ]; then
 
 else
     NJS_HAVE_READLINE=NO
-    $echo " - building interactive shell is not possible"
+    echo " - building interactive shell is not possible"
 fi
diff -r e848c0ee1238 -r 7b1a00168b25 configure
--- a/configure	Tue Aug 20 20:51:33 2019 +0300
+++ b/configure	Tue Aug 20 20:51:39 2019 +0300
@@ -47,6 +47,7 @@ END
 NJS_LIBRT=
 
 . auto/os
+. auto/cc
 . auto/clang
 . auto/time
 . auto/memalign


More information about the nginx-devel mailing list