From 2d58cdf8ca26ef884eb7afb264005687b4011965 Mon Sep 17 00:00:00 2001
From: henry <Henry Weller h.weller@opencfd.co.uk>
Date: Wed, 29 Jul 2009 12:52:06 +0100
Subject: [PATCH] Added a consistency check for the location of the
 installation.

---
 Allwmake              | 8 ++++++++
 applications/Allwmake | 9 +++++++++
 src/Allwmake          | 9 +++++++++
 3 files changed, 26 insertions(+)

diff --git a/Allwmake b/Allwmake
index c01c6c0d1a3..ee6f075a0e8 100755
--- a/Allwmake
+++ b/Allwmake
@@ -1,6 +1,14 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
 
+if [ "$PWD" != "$WM_PROJECT_DIR" ]
+then
+    echo "Error: Current directory in not \$WM_PROJECT_DIR"
+    echo "    The environment variable are not consistent with the installation."
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+fi
+
 # wmake is required for subsequent targets
 ( cd wmake/src && make )
 
diff --git a/applications/Allwmake b/applications/Allwmake
index 2a7eeae1245..82a2ec0df43 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -1,5 +1,14 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
+
+if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
+then
+    echo "Error: Current directory in not \$WM_PROJECT_DIR/applications"
+    echo "    The environment variable are not consistent with the installation."
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+fi
+
 set -x
 
 wmake all solvers
diff --git a/src/Allwmake b/src/Allwmake
index f2b2adf0378..5473238ed34 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -1,5 +1,14 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
+
+if [ "$PWD" != "$WM_PROJECT_DIR/src" ]
+then
+    echo "Error: Current directory in not \$WM_PROJECT_DIR/src"
+    echo "    The environment variable are not consistent with the installation."
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+fi
+
 set -x
 
 # update OpenFOAM version strings if required
-- 
GitLab