MacOS: wc does not support -L option
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sun, 15 Nov 2020 23:02:07 +0000 (00:02 +0100)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Mon, 16 Nov 2020 09:59:55 +0000 (10:59 +0100)
The default wc application on MacOS does not support the -L option. I added
autotools support to search for GNU wc and use that instead. This assumes
that the application name is gwc which is the case whan using macports.

The tex tests use wc with the -L option. These regression tests fail on MacOS if the default wc application is used.

configure.ac
tests/atlocal.in
tests/output/tex.at

index 4b72f7f7714d4c1d0c3972bf38896f143d4b6430..28ae3e4efde7af50f4aba083706ca9f38a510447 100644 (file)
@@ -48,6 +48,8 @@ PSPP_PERL
 PSPP_PYTHON
 AC_CHECK_PROGS([TEX], [tex], [no])
 AC_SUBST([TEX])
+AC_CHECK_PROGS([GWC], [gwc wc], [no])
+AC_SUBST([GWC])
 
 # This suppresses an error in gl/careadlinkat.c that otherwise can't be
 # avoided in GCC 10.x:
index 162b832dfddc4cd7b14c0bb35238123f7ee15eda..5ba794cdd0638b22800bc5e3c9a5509c8346172c 100644 (file)
@@ -23,6 +23,7 @@ EXEEXT='@EXEEXT@'
 PERL='@PERL@'
 PYTHON='@PYTHON@'
 TEX='@TEX@'
+GWC='@GWC@'
 WITH_PERL_MODULE='@WITH_PERL_MODULE@'
 host='@host@'
 PACKAGE_STRING='@PACKAGE_STRING@'
index bec2804f7a8661f749863c39d9b3fee90a433fec..456ce59757a4c8413b91bd93bedf139a2d9a9dcf 100644 (file)
@@ -181,7 +181,7 @@ descriptives /score.
 
 
 AT_CHECK([pspp -O format=tex simple.sps], [0], [])
-AT_CHECK([test $(wc -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
+AT_CHECK([test $($GWC -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
 
 AT_SKIP_IF([test "$TEX" = no])
 AT_CHECK([$TEX --halt-on-error pspp.tex], [0], [ignore])
@@ -200,7 +200,7 @@ AT_CLEANUP
 AT_SETUP([tex another example])
 
 AT_CHECK([pspp -O format=tex $abs_top_srcdir/examples/regress.sps], [0], [])
-AT_CHECK([test $(wc -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
+AT_CHECK([test $($GWC -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
 
 AT_SKIP_IF([test "$TEX" = no])
 AT_CHECK([$TEX --halt-on-error pspp.tex], [0], [ignore])
@@ -234,7 +234,7 @@ correlations
 ])
 
 AT_CHECK([pspp -O format=tex footnote.sps], [0], [])
-AT_CHECK([test $(wc -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
+AT_CHECK([test $($GWC -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
 
 AT_SKIP_IF([test "$TEX" = no])
 AT_CHECK([$TEX --halt-on-error pspp.tex], [0], [ignore])
@@ -275,7 +275,7 @@ frequencies items.
 ])
 
 AT_CHECK([LC_ALL=C.UTF-8 pspp -O format=tex utf8.sps], [0], [])
-AT_CHECK([test $(wc -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
+AT_CHECK([test $($GWC -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
 
 dnl The string "??" should not be present in pspp.tex
 AT_CHECK([grep -F '??' pspp.tex], [1])
@@ -315,7 +315,7 @@ t-test /variables=score /group=group("this", "that").
 ])
 
 AT_CHECK([pspp -O format=tex t-test.sps], [0], [])
-AT_CHECK([test $(wc -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
+AT_CHECK([test $($GWC -L pspp.tex | awk '{print $1}') -le 80], [0], [ignore])
 
 AT_SKIP_IF([test "$TEX" = no])
 AT_CHECK([$TEX --halt-on-error pspp.tex], [0], [ignore])