aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
author1138-4EB <1138-4EB@users.noreply.github.com>2019-10-23 17:39:58 +0100
committertgingold <tgingold@users.noreply.github.com>2019-10-23 18:39:58 +0200
commit1dc2bb2266d14dfc082706a947a5f8668ed51a0c (patch)
treeadbafc133064894eaf5b44aed13ff39980ea61d8 /configure
parenta08e8ce832701dd0832330e783009b20b34f6782 (diff)
downloadghdl-1dc2bb2266d14dfc082706a947a5f8668ed51a0c.tar.gz
ghdl-1dc2bb2266d14dfc082706a947a5f8668ed51a0c.tar.bz2
ghdl-1dc2bb2266d14dfc082706a947a5f8668ed51a0c.zip
fix(configure): use '/dev/null' to check 'cmp', use 'sed' to compare versions (#986)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure b/configure
index 7335523fa..ac84f61a3 100755
--- a/configure
+++ b/configure
@@ -164,7 +164,7 @@ if ! grep $pat $srcdir/configure > /dev/null 2>&1; then
exit 1
fi
-if ! `cmp --help > /dev/null 2>&1`; then
+if ! `cmp /dev/null /dev/null > /dev/null 2>&1`; then
echo "Sorry, you need 'cmp' to configure GHDL.";
exit 1
fi
@@ -191,8 +191,8 @@ fi
# Check the version of libghdl is correct.
if [ "$enable_libghdl" = true ]; then
libghdl_version="$srcdir/python/libghdl/version.py"
- # Compare a fixed number of bytes (-n), to avoid false positives due to LF/CRLF mismatch.
- if ! echo "__version__ = '${ghdl_version}'" | cmp -n "${#ghdl_version}" "$libghdl_version" ; then
+ # Extract content between sinlge quotes in version.py, to avoid false positives due to LF/CRLF mismatch.
+ if [ "$ghdl_version" != "`sed "s/.*'\(.*\)'.*/\1/g" $libghdl_version`" ]; then
echo "Sorry, the version of $libghdl_version is not correct"
echo "update the version to: $ghdl_version"
echo "or use --disable-libghdl"