the package I am trying to install has the following autogen.sh (only the first lines are showed):
#! /bin/sh
libtoolize --automake
However, on Mac, once GNU libtool has been installed (via MacPorts for instance), libtoolize is renamed as glibtoolize. Following this answer, I hence want to modify the autogen.sh above into:
#! /bin/sh
if [ $(hash libtoolize 2>&-) -eq 0 ]
then
libtoolize --automake
else
glibtoolize --automake
fi
But it returns ./autogen.sh: line 6: [: -eq: unary operator expected
. What am I doing wrong here?