Fix configure version detection when building outside of srcdir.
authorAndrej Kacian <ticho@claws-mail.org>
Fri, 24 Aug 2018 11:48:38 +0000 (13:48 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Fri, 24 Aug 2018 12:23:23 +0000 (14:23 +0200)
configure.ac

index 35e3b139ecf375f9f148e52c003f1018895699bf..a3d2a672bd35ae284de313e4a68498e546bcf4dc 100644 (file)
@@ -21,8 +21,13 @@ if test \( -d .git \); then
        echo "echo ${GIT_VERSION}" > ./version
     fi
 else
        echo "echo ${GIT_VERSION}" > ./version
     fi
 else
-    GIT_VERSION=`sh -c ". ./$srcdir/version"`
+    GIT_VERSION=`sh -c ". $srcdir/version"`
 fi
 fi
+
+if test \( -z "$GIT_VERSION" \); then
+       AC_MSG_ERROR([*** could not determine program version])
+fi
+
 MAJOR_VERSION=${GIT_VERSION%%.*}
 MINOR_VERSION=${GIT_VERSION#*.}
 MINOR_VERSION=${MINOR_VERSION%%.*}
 MAJOR_VERSION=${GIT_VERSION%%.*}
 MINOR_VERSION=${GIT_VERSION#*.}
 MINOR_VERSION=${MINOR_VERSION%%.*}