Browse Source

build: Work around illumos still shipping a prehistoric AWK as default

* configure.ac: illumos still ships 'oawk' (old AWK) as the default 'awk'.
  A pre-historic version of AWK, from the mists of Unix history (AT&T System
  V Release 4), which Sun kept around deliberately not updating it or fixing
  non-critical bugs, to ensure bug-for-bug compatibility.

  It doesn't support the -F <regex> argument AWK has had since...  slightly
  less deeper in the mist (e.g.  SysV R4.2, shipped as 'nawk' in Solaris and
  illumos).  Only -Fc.

  Joyent apparently has updated the default awk in SmartOS to nawk +
  extensions, and may upstream it to illumos.
Paul Jakma 4 years ago
parent
commit
17ab96ac9a
1 changed files with 8 additions and 6 deletions
  1. 8 6
      configure.ac

+ 8 - 6
configure.ac

@@ -183,12 +183,14 @@ if test "x${cflags_specified}" = "x" ; then
         dnl from ld. Disable. An issue with libtool < 2.4.6 dropping the
         dnl -fstack-protector-strong argument from the shared link.
         AC_MSG_CHECKING([whether libtool can support fstack-protector])
-        if test x"$(./libtool --version \
-         	    | awk -F '[[ \t.]]' \
-        		'NR == 1 { \
-   				if ($(NF-2) <= 2 && $(NF-1) <= 4 && $NF < 6) \
-        				print 0; \
-        			else print 1 \
+        if test x"$(./libtool --version | awk 'NR == 1 { print $NF }' \
+         	    | awk -F. '{ \
+         	    	if ($(NF-2) < 2) print 0; \
+         	    	else if ($(NF-2) > 2) print 1; \
+         	    	else if ($(NF-1) < 4) print 0; \
+         	    	else if ($(NF-1) > 4) print 1; \
+         	    	else if ($NF < 6) print 0; \
+         	    	else print 1;  \
         		}')" = "x1" ; then
         	AC_MSG_RESULT([yes])
         	AC_C_FLAG([-fstack-protector-strong])