diff --git a/Allwmake b/Allwmake
index ed3d03e7890833f2ef98cf5a51c92cb4b5855883..e5edf6fc976f79b9c499259693c8a94b44658704 100755
--- a/Allwmake
+++ b/Allwmake
@@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
     exit 1
 }
 
-# Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
diff --git a/applications/Allwmake b/applications/Allwmake
index 88211f13065b5f65c8e97df263c17d4f8b4437c2..dc3dabd798831945c0db6744668ba00357b2eaf0 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/applications" 2>/dev/null || {
     exit 1
 }
 
-# Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
diff --git a/applications/solvers/DNS/dnsFoam/Allwmake b/applications/solvers/DNS/dnsFoam/Allwmake
index 615be6fcc0203f1e550112cb841bb98b2a95e9e6..64bef012d97d728e672d3828b7bfceba53a7f073 100755
--- a/applications/solvers/DNS/dnsFoam/Allwmake
+++ b/applications/solvers/DNS/dnsFoam/Allwmake
@@ -1,8 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # run from this directory
+cd ${0%/*} || exit 1                         # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/have_fftw
 
-if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
-   [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
+#------------------------------------------------------------------------------
+
+if have_fftw
 then
     wmake
 else
diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake
index 5dee7d1a882f825e838a139e7fd3f970bbf67cac..58648ff0444dcd34d437fdba26c4ff59c5b2d285 100755
--- a/applications/solvers/compressible/rhoCentralFoam/Allwmake
+++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake
@@ -1,7 +1,5 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
 (wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake
index e3c5370297acb017e4eaeeb03313a8bea6084cfa..29e2940cd9f1bee00f1723ab8b1acdd893bdf648 100755
--- a/applications/solvers/lagrangian/DPMFoam/Allwmake
+++ b/applications/solvers/lagrangian/DPMFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType DPMTurbulenceModels
 
 wmake $targetType
diff --git a/applications/solvers/multiphase/MPPICInterFoam/Allwmake b/applications/solvers/multiphase/MPPICInterFoam/Allwmake
index 36e2f896469fff9123eb2f6b5299c4a782a857ec..6e71a313cc6a1d37ca39cf78858e6de1d57b2acf 100755
--- a/applications/solvers/multiphase/MPPICInterFoam/Allwmake
+++ b/applications/solvers/multiphase/MPPICInterFoam/Allwmake
@@ -1,5 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # run from this directory
+cd ${0%/*} || exit 1                            # Run from this directory
+
+#------------------------------------------------------------------------------
 
 wmake libso CompressibleTwoPhaseMixtureTurbulenceModels
 wmake
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
index 7ecc9f42387d73a25395e509cb5556cd51b8451f..dfd9db7d5269dcf7ecd6c3855d96b3bd444bd3e0 100755
--- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType twoPhaseMixtureThermo
 wmake $targetType surfaceTensionModels
 
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
index b92d87aef4ecf78c9f44705ed51d4727674320f4..0d361f95545c1d2ab6da0971af8da350f3f26aeb 100755
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType multiphaseMixtureThermo
 wmake $targetType
 
diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake
index 069235819e980122ae73c100e7d63a46045dfd6d..7571b50608b9288b4902f6a41905028ec35671a1 100755
--- a/applications/solvers/multiphase/driftFluxFoam/Allwmake
+++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType mixtureViscosityModels
 wmake $targetType relativeVelocityModels
 wmake $targetType
diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
index 59af9259fef2b7216a6fe8086c4337b0faf9138e..e64b0d128508c913b24f6a150a1623c6b72040f4 100755
--- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
+++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
@@ -1,10 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-targetType=libso
+cd ${0%/*} || exit 1                        # Run from this directory
+targetType=libso                            # Preferred library type
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType temperaturePhaseChangeTwoPhaseMixtures
 wmake
 
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
index dfcde284ea58f76076c3a8d09c21cdf39e6577df..6f577cedd66e7a7052af588aa1a4bdf6f7608ff8 100755
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType phaseChangeTwoPhaseMixtures
 wmake $targetType
 wmake $targetType interPhaseChangeDyMFoam
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
index d38522312d4d9a5c2889ef557cf6edf54347f8a4..e22e137bcb4b78fdd75047cae558f12da881a764 100755
--- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmakeLnInclude interfacialModels
 wmake $targetType multiphaseSystem
 wmake $targetType interfacialModels
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
index 50f78a705cd4124a619c8d7af8143bc852ea1e5e..0e3a0ff1037073a93dce6535e73063e440fa8c1f 100755
--- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType multiphaseMixture
 wmake $targetType
 wmake $targetType multiphaseInterDyMFoam
diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
index 87e6a81e3f0bfc6b1c0aa2ad7ccb3572126ab3d2..bcf5ba22e95e5e91abe786a024600edc973716ce 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmakeLnInclude interfacialModels
 wmakeLnInclude interfacialCompositionModels
 wmake $targetType phaseSystems
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
index 05211a00395fb18974f08f5bf40fa3f4bff93ac2..5ad18fcf7095aafdc7e026f60e07e2284f097c3f 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType multiphaseSystem
 wmake $targetType multiphaseCompressibleTurbulenceModels
 wmake $targetType
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
index 49c983288e0cac523f1dab93c12e8649f079a3b8..ffbeaacbfdbd7267c4f3c4677688aa66258d7b54 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType twoPhaseSystem
 wmake $targetType twoPhaseCompressibleTurbulenceModels
 wmake $targetType
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
index 9eb3ae37c4c37f266747f062116a79bf8383d045..73f0733ef12ed504730aed1f288fdc18f6b177c3 100755
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmakeLnInclude interfacialModels
 wmake $targetType twoPhaseSystem
 wmake $targetType interfacialModels
diff --git a/applications/utilities/mesh/conversion/ccm/Allwmake b/applications/utilities/mesh/conversion/ccm/Allwmake
index f0062c9774e1e0c9db6de3e1f41fd3b133ca7350..6306b02168411593b4e8807fc72f3314f91bd836 100755
--- a/applications/utilities/mesh/conversion/ccm/Allwmake
+++ b/applications/utilities/mesh/conversion/ccm/Allwmake
@@ -1,17 +1,18 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                            # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions    # General system functions
 
-# Parse arguments for compilation (at least for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+#------------------------------------------------------------------------------
 
-# Only build if libraries already exist
-if [ -e $FOAM_LIBBIN/libccm.so ]
+# Only build when the OpenFOAM libccm adaptor already exists
+if [ -f $FOAM_LIBBIN/libccm$extLibso ]
 then
     echo "==> build optional ccm conversion components"
     wmake $targetType ccmToFoam
     wmake $targetType foamToCcm
 else
-    echo "==> skip optional ccm conversion components (no libccm.so)"
+    echo "==> skip optional ccm conversion components (no libccm$extLibso)"
 fi
 
 #------------------------------------------------------------------------------
diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake
index 4abbf97bc2ec2474f081c50b0e15792f2dcd9b40..39a942aee6616be770d21454bbd877b67e78e608 100755
--- a/applications/utilities/mesh/generation/Allwmake
+++ b/applications/utilities/mesh/generation/Allwmake
@@ -1,8 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+
+#------------------------------------------------------------------------------
 
-# Parse arguments for compilation (at least for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 wmake -all $targetType blockMesh
 wmake -all $targetType extrude
 wmake -all $targetType extrude2DMesh
diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
index f8637ab7e53aa13a132944b31289c71a52025350..2b58cd08e1223bd1a5a14ee0c4636d2f0142c8dd 100755
--- a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
+++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType extrude2DMesh
 wmake $targetType
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwmake b/applications/utilities/mesh/generation/foamyMesh/Allwmake
index 6c838e5f09f05393f37a33ffade86827abb17168..3dc79feaf81d3c6535e62118216c57b851d509da 100755
--- a/applications/utilities/mesh/generation/foamyMesh/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/Allwmake
@@ -1,16 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+export WM_CONTINUE_ON_ERROR=true            # Optional unit
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+. $WM_PROJECT_DIR/wmake/scripts/have_cgal
 
-# Optional unit: continue-on-error
-# - may not have CGAL installed,
-# - or the CGAL installation moved and gives CMake problems
-export WM_CONTINUE_ON_ERROR=true
-
-# Parse arguments for library compilation
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+#------------------------------------------------------------------------------
+# Optional
+# - CGAL not installed, or installed but gives CMake problems
 
-if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
-   [ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
+if have_cgal
 then
     wmake $targetType conformalVoronoiMesh
     wmake $targetType conformalVoronoi2DMesh
diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
index c3f900341ec642c9c1d12cb4d9bbf0c8e5b0f465..1607b672aa08f80d109f8516a716d572c8a2e539 100755
--- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
@@ -1,8 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
 
-# Parse arguments for compilation (at least for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+#------------------------------------------------------------------------------
 
 if [ -d "${FASTDUALOCTREE_SRC_PATH}" ]
 then
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
index 59db39f970dea36e76f456a392f3e56c343be304..4f75bd542c9fdb988b647b7679a78e12163646f4 100755
--- a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
+++ b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
@@ -1,38 +1,27 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                            # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions    # General system functions
+. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
 
-# Parse arguments for compilation (at least for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+#------------------------------------------------------------------------------
 
 unset COMP_FLAGS LINK_FLAGS
 
-if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ]
+if [ -f $FOAM_LIBBIN/libSloanRenumber$extLibso ]
 then
     echo "    found libSloanRenumber  --  enabling sloan renumbering support."
-    export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber"
+    export LINK_FLAGS="$LINK_FLAGS -lSloanRenumber"
 fi
 
-if [ -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ]
+if [ -f $FOAM_LIBBIN/libzoltanRenumber$extLibso ]
 then
-    if [ -z "$ZOLTAN_ARCH_PATH" ]
+    if have_zoltan
     then
-        # Optional: get ZOLTAN_ARCH_PATH
-        if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
-        then
-            . $settings
-        fi
+        echo "    found libzoltanRenumber  --  enabling zoltan renumbering support."
+        export COMP_FLAGS="$COMP_FLAGS -DHAVE_ZOLTAN"
+        export LINK_FLAGS="$LINK_FLAGS -lzoltanRenumber -L$ZOLTAN_LIB_DIR -lzoltan"
     fi
-
-    for libdir in lib "lib${WM_COMPILER_LIB_ARCH}"
-    do
-        if [ -f "$ZOLTAN_ARCH_PATH/$libdir/libzoltan.a" ]
-        then
-            echo "    found libzoltanRenumber  --  enabling zoltan renumbering support."
-            export COMP_FLAGS="-DFOAM_USE_ZOLTAN"
-            export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L$ZOLTAN_ARCH_PATH/$libdir -lzoltan"
-            break
-        fi
-    done
 fi
 
 wmake $targetType
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
index a49d110df29820982632c0d15b26ea6c9fab6548..1b9c88217dbf6efea31fe37d3607a87c4c2d092c 100644
--- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
+++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
@@ -55,7 +55,7 @@ Description
 #include "processorMeshes.H"
 #include "hexRef8.H"
 
-#ifdef FOAM_USE_ZOLTAN
+#ifdef HAVE_ZOLTAN
     #include "zoltanRenumber.H"
 #endif
 
@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
 
     // Force linker to include zoltan symbols. This section is only needed since
     // Zoltan is a static library
-    #ifdef FOAM_USE_ZOLTAN
+    #ifdef HAVE_ZOLTAN
         Info<< "renumberMesh built with zoltan support." << nl << endl;
         (void)zoltanRenumber::typeName;
     #endif
diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake
index 49aaea637e3703769d9beb60d1e951b8471ceedc..dfee8bee52b5fa365c7e92e8d98da85824906beb 100755
--- a/applications/utilities/mesh/manipulation/setSet/Allwmake
+++ b/applications/utilities/mesh/manipulation/setSet/Allwmake
@@ -1,19 +1,17 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for compilation (at least for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                        # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+. $WM_PROJECT_DIR/wmake/scripts/have_readline
 
+#------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
 
-#
-# use readline if available
-#
-if [ -f /usr/include/readline/readline.h ]
+# Use readline if available
+if have_readline
 then
-    echo "    found <readline/readline.h>  --  enabling readline support."
-    export COMP_FLAGS="-DHAS_READLINE"
-    export LINK_FLAGS="-lreadline"
+    echo "    readline detected - enabling readline support."
+    export COMP_FLAGS="-DHAVE_LIBREADLINE -I$READLINE_INC_DIR"
+    export LINK_FLAGS="-L$READLINE_LIB_DIR -lreadline"
 fi
 
 wmake $targetType
diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C
index 18f5ab5b34a1ca497b13bebe0b26f9857377c029..fc99cc81e5d42dda61bce5fbe20df5052e4cbb75 100644
--- a/applications/utilities/mesh/manipulation/setSet/setSet.C
+++ b/applications/utilities/mesh/manipulation/setSet/setSet.C
@@ -55,10 +55,11 @@ Description
 
 #include <stdio.h>
 
-
-#ifdef HAS_READLINE
+#ifdef HAVE_LIBREADLINE
     #include <readline/readline.h>
     #include <readline/history.h>
+
+    static const char* historyFile = ".setSet";
 #endif
 
 using namespace Foam;
@@ -66,11 +67,6 @@ using namespace Foam;
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 
-#ifdef HAS_READLINE
-static const char* historyFile = ".setSet";
-#endif
-
-
 // Write set to VTK readable files
 void writeVTK
 (
@@ -790,7 +786,7 @@ int main(int argc, char *argv[])
     printAllSets(mesh, Info);
 
     // Read history if interactive
-    #ifdef HAS_READLINE
+    #ifdef HAVE_LIBREADLINE
     if (!batch && !read_history((runTime.path()/historyFile).c_str()))
     {
         Info<< "Successfully read history from " << historyFile << endl;
@@ -872,7 +868,7 @@ int main(int argc, char *argv[])
             }
             else
             {
-                #ifdef HAS_READLINE
+                #ifdef HAVE_LIBREADLINE
                 {
                     char* linePtr = readline("readline>");
 
diff --git a/applications/utilities/miscellaneous/foamHelp/Allwmake b/applications/utilities/miscellaneous/foamHelp/Allwmake
index c00e52a8980ad58c92d7ea61a7ea3bef2a87d584..78dc109feca3b1eff40d1c76878110b69594b77a 100755
--- a/applications/utilities/miscellaneous/foamHelp/Allwmake
+++ b/applications/utilities/miscellaneous/foamHelp/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType helpTypes
 wmake $targetType
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
index c24b4e652f9a1827da281f2d6ad522d44ba35611..ade3a2637901dfd515dbfd1029137687b2c3aa1e 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
 cd ${0%/*} || exit 1                            # Run from this directory
 export WM_CONTINUE_ON_ERROR=true                # Optional unit
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments  # Parse arguments
+. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 . $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions  # The CMake functions
 
 # -----------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake
index 2471b6d55ab7eef9d59961f2d83b4f3d41ef8205..ecb7039b93a994de65d349fce9bea25d936eea56 100755
--- a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake
+++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType
 
 #------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/noise/Allwmake b/applications/utilities/postProcessing/noise/Allwmake
index f1cf077bb17843a484d50a0670710242e99fbf40..7452621cd23b522eab94d29ac635ec519d777629 100755
--- a/applications/utilities/postProcessing/noise/Allwmake
+++ b/applications/utilities/postProcessing/noise/Allwmake
@@ -1,8 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/have_fftw
 
-if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
-   [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
+#------------------------------------------------------------------------------
+
+if have_fftw
 then
     wmake
 else
diff --git a/applications/utilities/preProcessing/boxTurb/Allwmake b/applications/utilities/preProcessing/boxTurb/Allwmake
index e4921f5485ec168d1f76b9513e822ae2781bc40d..21e6762b4ae17ae2857043fe1ddadf0cca45acb0 100755
--- a/applications/utilities/preProcessing/boxTurb/Allwmake
+++ b/applications/utilities/preProcessing/boxTurb/Allwmake
@@ -1,8 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # run from this directory
+cd ${0%/*} || exit 1                         # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/have_fftw
 
-if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
-   [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
+#------------------------------------------------------------------------------
+
+if have_fftw
 then
     wmake
 else
diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwmake b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
index 06612a9c67435428e96cbee217ea6cb2cf385606..27ff0f0215607aef31b8b8fc910b130b896fbe2e 100755
--- a/applications/utilities/preProcessing/wallFunctionTable/Allwmake
+++ b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType tabulatedWallFunction
 wmake $targetType
 
diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
index d1ec8b77c1f46ba01a16276a3bead7774a1504b9..0aae5a7cfb892026e95f8ea8e2f13deeb8b2a3b8 100755
--- a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
+++ b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
@@ -1,10 +1,11 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/have_cgal
 
+#------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
 
-if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
-   [ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
+if have_cgal
 then
     wmake PolyhedronReader
     export COMP_FLAGS='-IPolyhedronReader'
diff --git a/applications/utilities/surface/surfaceFeatureExtract/Allwmake b/applications/utilities/surface/surfaceFeatureExtract/Allwmake
index ee26d27fc3c219844019cbd6b11fafb065f749a4..913a79b6409b73656341535a70f2a143490bcfea 100755
--- a/applications/utilities/surface/surfaceFeatureExtract/Allwmake
+++ b/applications/utilities/surface/surfaceFeatureExtract/Allwmake
@@ -1,7 +1,5 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
 (wmake libso extractionMethod && wmake)
diff --git a/bin/tools/lib-dir b/bin/tools/lib-dir
index fe24e510ede4bbe7f9a4d24529d48a22c049dd0b..72b13d5a5f3e8faec65c88c8ef9e8417da877d51 100755
--- a/bin/tools/lib-dir
+++ b/bin/tools/lib-dir
@@ -142,12 +142,18 @@ fi
 
 if [ -n "$resolved" ]
 then
-    case "$optSyntax" in
-    csh)
+    case "$optSyntax-$(uname -s 2>/dev/null)" in
+    make*)
+        printf "%s\n" "-L$resolved"
+        ;;
+    csh-Darwin*)
+        echo "setenv DYLD_LIBRARY_PATH $resolved:$DYLD_LIBRARY_PATH"
+        ;;
+    csh*)
         echo "setenv LD_LIBRARY_PATH $resolved:$LD_LIBRARY_PATH"
         ;;
-    make)
-        printf "%s\n" "-L$resolved"
+    sh-Darwin*)
+        echo "DYLD_LIBRARY_PATH=$resolved:$DYLD_LIBRARY_PATH"
         ;;
     *)
         echo "LD_LIBRARY_PATH=$resolved:$LD_LIBRARY_PATH"
@@ -155,7 +161,7 @@ then
     esac
     exit 0      # Good
 else
-    exit 1    # Error
+    exit 1      # Error
 fi
 
 
diff --git a/etc/config.csh/mpi b/etc/config.csh/mpi
index 75c8ffec1e3045de63625d301d3960be50df3d15..3c59434eb81b8a3b62f95ee3857dff037f467c65 100644
--- a/etc/config.csh/mpi
+++ b/etc/config.csh/mpi
@@ -304,7 +304,7 @@ endsw
 
 
 # Add (non-dummy) MPI implementation
-# - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
+# - dummy MPI already in lib-path and has no external libraries
 if ( "$FOAM_MPI" != dummy ) then
     if ( $?FOAM_EXT_LIBBIN ) then   # External libraries (allowed to be unset)
         _foamAddLib ${FOAM_EXT_LIBBIN}/${FOAM_MPI}
diff --git a/etc/config.csh/settings b/etc/config.csh/settings
index 80ce56e41e23516e4480f05b2fd975fb5ee0ffd8..213a7334f15db6f37d4f6c381f7e8ec8a768ef27 100644
--- a/etc/config.csh/settings
+++ b/etc/config.csh/settings
@@ -106,6 +106,12 @@ case Linux:
 case Darwin:    # Presumably x86_64
     if (! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64  # Default to 64-bit
     setenv WM_ARCH darwin64
+    /bin/cat << INCOMPLETE
+===============================================================================
+Operating system '$WM_ARCH' has incomplete support in this OpenFOAM release.
+For further assistance, please contact www.OpenFOAM.com
+===============================================================================
+INCOMPLETE
     breaksw
 
 case SunOS:
@@ -118,12 +124,12 @@ case SunOS:
     breaksw
 
 default:
-    /bin/cat << UNSUPPORTED_OS
+    /bin/cat << UNSUPPORTED
 ===============================================================================
-Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
+Operating system '$WM_ARCH' is unsupported by this OpenFOAM release.
 For further assistance, please contact www.OpenFOAM.com
 ===============================================================================
-UNSUPPORTED_OS
+UNSUPPORTED
     breaksw
 
 endsw
diff --git a/etc/config.sh/functions b/etc/config.sh/functions
index 99a5ea5b1dd209d1f1cd4308b50f7f9eaa499696..9358e2d9ba218522013d2e7c50f446c489a7e99e 100644
--- a/etc/config.sh/functions
+++ b/etc/config.sh/functions
@@ -56,7 +56,7 @@ then
         [ -n "$1" ] && export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
     }
 
-    # Prefix to LD_LIBRARY_PATH with additional checking
+    # Prepend to LD_LIBRARY_PATH with additional checking
     # $1 = base directory for 'lib' or 'lib64'
     # $2 = fallback libname ('lib' or 'lib64')
     #
@@ -69,7 +69,7 @@ then
     # Return 0 on success
     _foamAddLibAuto()
     {
-        # Note ksh doesn't have 'local' thus these ugly variable names
+        # Note ksh does not have 'local' thus these ugly variable names
         foamVar_prefix="$1"
         foamVar_end="${1##*-}"
 
@@ -112,6 +112,27 @@ then
     }
 
 
+    # Special treatment for Darwin
+    # - DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
+    if [ "$(uname -s 2>/dev/null)" = Darwin ]
+    then
+        unset -f _foamAddLib _foamAddLibAuto 2>/dev/null
+
+        # Prepend DYLD_LIBRARY_PATH
+        _foamAddLib()
+        {
+            [ -n "$1" ] && export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH
+        }
+
+        # Prepend to DYLD_LIBRARY_PATH with additional checking
+        # - use lib-dir script instead of rewriting
+        _foamAddLibAuto()
+        {
+            eval "$($WM_PROJECT_DIR/bin/tools/lib-dir -sh $@)";
+        }
+    fi
+
+
     # Source an etc file, possibly with some verbosity
     # - use eval to avoid intermediate variables (ksh doesn't have 'local')
     if [ "$FOAM_VERBOSE" -a "$PS1" ]
diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi
index 55e7cda57b91cfaf0a8416ce5d40e128fa0b79f7..4feee873129a7f378082d407cd36a20bd4779d78 100644
--- a/etc/config.sh/mpi
+++ b/etc/config.sh/mpi
@@ -307,7 +307,7 @@ esac
 
 
 # Add (non-dummy) MPI implementation
-# - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
+# - dummy MPI already in lib-path and has no external libraries
 if [ "$FOAM_MPI" != dummy ] && type _foamAddLib > /dev/null 2>&1
 then
     if [ -n "$FOAM_EXT_LIBBIN" ]    # External libraries (allowed to be unset)
diff --git a/etc/config.sh/settings b/etc/config.sh/settings
index f60e616ff1608553aa594edd426b4e7db5abe0ee..545e8a234f106208fa95f364a9b28ee5c8b44cd2 100644
--- a/etc/config.sh/settings
+++ b/etc/config.sh/settings
@@ -100,6 +100,13 @@ Linux)
 Darwin)     # Presumably x86_64
     : ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION  # Default to 64-bit
     WM_ARCH=darwin64
+    /bin/cat << INCOMPLETE 1>&2
+===============================================================================
+Operating system '$WM_ARCH' has incomplete support in this OpenFOAM release.
+For further assistance, please contact www.OpenFOAM.com
+===============================================================================
+INCOMPLETE
+    echo "Darwin support ($WM_ARCH) is incomplete" 1>&2
     ;;
 
 SunOS)
@@ -112,12 +119,12 @@ SunOS)
     ;;
 
 *)  # An unsupported operating system
-    /bin/cat << UNSUPPORTED_OS 1>&2
+    /bin/cat << UNSUPPORTED 1>&2
 ===============================================================================
-Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
+Operating system '$WM_ARCH' is unsupported by this OpenFOAM release.
 For further assistance, please contact www.OpenFOAM.com
 ===============================================================================
-UNSUPPORTED_OS
+UNSUPPORTED
     ;;
 esac
 
diff --git a/src/Allwmake b/src/Allwmake
index 259d52a55d024ecc284997d36d09286170c18090..faf50939444de6e8ce965ba32247898bf3182acd 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/src" 2>/dev/null || {
     exit 1
 }
 
-# Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake
index 83d082c99e52af1826b4824717e9ee61cf35fe35..ef725400a69908d09562d09c334eebfc92bc5ee6 100755
--- a/src/OSspecific/POSIX/Allwmake
+++ b/src/OSspecific/POSIX/Allwmake
@@ -1,22 +1,19 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-targetType=libo
+cd ${0%/*} || exit 1                        # Run from this directory
+targetType=libo                             # Preferred library type
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments $*
 
+#------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
 
-#
-# use <sys/inotify.h> if available (Linux)
-#
+# If <sys/inotify.h> is available (Linux)
 if [ -f /usr/include/sys/inotify.h ]
 then
     echo "    found <sys/inotify.h>  --  enabling inotify for file monitoring."
     export COMP_FLAGS="-DFOAM_USE_INOTIFY"
 fi
 
-# make (non-shared by default) object
+# Make object (non-shared by default)
 wmake $targetType
 
 #------------------------------------------------------------------------------
diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake
index e69310f341baf2ac1af08d5a74cd13564692da07..f7447abf1e2cc97db4d9cf250f5f5785513ed35f 100755
--- a/src/Pstream/Allwmake
+++ b/src/Pstream/Allwmake
@@ -1,9 +1,8 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
 
 # Define how to create an mpi-versioned library of $targetType
 # compile into qualified directory
@@ -35,5 +34,4 @@ case "$WM_MPLIB" in
     ;;
 esac
 
-
 #------------------------------------------------------------------------------
diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake
index dfe590d2a4999c5ff329f2865148b23de866ac6f..717ff9f150c4f5b591e590f5a62064803afcc87a 100755
--- a/src/TurbulenceModels/Allwmake
+++ b/src/TurbulenceModels/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType turbulenceModels
 wmake $targetType incompressible
 wmake $targetType compressible
diff --git a/src/conversion/Allwmake b/src/conversion/Allwmake
index 664d800a63afca48a8c76b0f9d4360d24267d8f9..e2fd470725b3ee4b9a1e096751e082686b93dcf6 100755
--- a/src/conversion/Allwmake
+++ b/src/conversion/Allwmake
@@ -1,10 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-targetType=libso
+cd ${0%/*} || exit 1                        # Run from this directory
+targetType=libso                            # Preferred library type
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType
 
 ccm/Allwmake
diff --git a/src/conversion/ccm/Allwmake b/src/conversion/ccm/Allwmake
index 768101d601e569b34a3b00098e4e1ecaef5de42c..0c358cc78110f85da67f6156644002c50a8ba930 100755
--- a/src/conversion/ccm/Allwmake
+++ b/src/conversion/ccm/Allwmake
@@ -1,39 +1,18 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Optional component: (eg, may depend on third-party libraries)
-
-# Parse arguments for compilation (at least for error catching)
+cd ${0%/*} || exit 1                         # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+. $WM_PROJECT_DIR/wmake/scripts/have_ccmio
 
-warning="==> skip optional libccm adapter"
-
-if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
-then
-    . $settings
-else
-    echo "$warning (no config.sh/ccmio settings)"
-    exit
-fi
+#------------------------------------------------------------------------------
+# Optional
+# - may depend on third-party libraries
 
+warning="==> skip optional libccm adapter"
 
-# Link with static libccmio only (possibly fewer issues)
-if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-  -a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
+# Link with static libccmio only (fewer issues)
+if have_ccmio
 then
-    # The libccmio uses int32_t.
-    # The OpenFOAM adapter thus requires additional work for 64-bit labels.
-    # The OpenFOAM adapter was originally only designed for 'double'
-
-    if [ "$WM_LABEL_SIZE" = 64 ]
-    then
-        echo "$warning (not designed for 64-bit labels)"
-    elif [ "$WM_PRECISION_OPTION" = SP ]
-    then
-        echo "$warning (not designed for single precision)"
-    else
-        wmake libso || echo "$warning (build issues detected)"
-    fi
+    wmake libso || echo "$warning (build issues detected)"
 else
     echo $warning
 fi
diff --git a/src/conversion/ccm/Make/options b/src/conversion/ccm/Make/options
index 3272da3576e6873a7df424ad1570e472552df73f..17c07c6824d555e6fd167343d834a775fc111605 100644
--- a/src/conversion/ccm/Make/options
+++ b/src/conversion/ccm/Make/options
@@ -6,9 +6,9 @@ EXE_INC = \
     -I$(LIB_SRC)/fileFormats/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/conversion/lnInclude \
-    -I$(CCMIO_ARCH_PATH)/include
+    -I$(CCMIO_INC_DIR)
 
 LIB_LIBS = \
     -lfiniteVolume \
     -lconversion \
-    -L$(CCMIO_ARCH_PATH)/lib -lccmio
+    -L$(CCMIO_LIB_DIR) -lccmio
diff --git a/src/dummyThirdParty/Allwmake b/src/dummyThirdParty/Allwmake
index a1628e356fbfd99ca5942bd05ce496b349a5f652..5a5be522c73af777fd551ed024fe1051ce84cbc2 100755
--- a/src/dummyThirdParty/Allwmake
+++ b/src/dummyThirdParty/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType scotchDecomp
 wmake $targetType ptscotchDecomp
 wmake $targetType metisDecomp
diff --git a/src/functionObjects/Allwmake b/src/functionObjects/Allwmake
index 073a57e3f5b06a60136b976379a54ceb65b6709e..df7176d7ef9448411533752549a0528d773d4483 100755
--- a/src/functionObjects/Allwmake
+++ b/src/functionObjects/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType field
 wmake $targetType forces
 wmake $targetType lagrangian
diff --git a/src/functionObjects/graphics/Allwmake b/src/functionObjects/graphics/Allwmake
index e665220999edde3a8e190426d5eb7330ad83d069..ab6a4e7c8918b988cafeff013a4f0d0ddc85a7f1 100755
--- a/src/functionObjects/graphics/Allwmake
+++ b/src/functionObjects/graphics/Allwmake
@@ -1,5 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                        # Run from this directory
+
+#------------------------------------------------------------------------------
 
 runTimePostProcessing/Allwmake
 
diff --git a/src/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/functionObjects/graphics/runTimePostProcessing/Allwmake
index 5d1376aa351117e191633518b1a048acf9be0f99..a0321c849b1df5ccc63f8fbb3b1f0a98900a6f21 100755
--- a/src/functionObjects/graphics/runTimePostProcessing/Allwmake
+++ b/src/functionObjects/graphics/runTimePostProcessing/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                             # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions   # The CMake functions
+cd ${0%/*} || exit 1                            # Run from this directory
+. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions  # The CMake functions
 
 # -----------------------------------------------------------------------------
 
diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake
index 09f2dcf3c15a6f4011050349778dc4c1385ffa9c..f2f26b42af72eca0ea4efda3446923f1663cb2eb 100755
--- a/src/fvAgglomerationMethods/Allwmake
+++ b/src/fvAgglomerationMethods/Allwmake
@@ -1,86 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                         # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+. $WM_PROJECT_DIR/wmake/scripts/have_mgridgen
 
-: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH}  # Extra safety
-export FOAM_EXT_LIBBIN
-
-# Test for mgridgen.
-# - return 0 and export MGRIDGEN_ARCH_PATH on success
-hasMgridGen()
-{
-    local warning="==> skip mgridgen"
-
-    unset MGRIDGEN_ARCH_PATH MGRIDGEN_VERSION
-    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) || {
-        # ignore silently# echo "$warning (no config.sh/mgridgen settings)"
-        return 1
-    }
-
-    . $settings
-    if [ -z "$MGRIDGEN_ARCH_PATH" -o "${MGRIDGEN_ARCH_PATH##*-}" = none ]
-    then
-        # ignore silently# echo "$warning (not available)"
-        return 1
-    fi
-
-    # Header
-    local header=$MGRIDGEN_ARCH_PATH/include/mgridgen.h
-    [ -f "$header" ] || {
-        # ignore silently# echo "$warning (no header)"
-        return 2  # file not found
-    }
-
-    # Library
-    [ -r $FOAM_EXT_LIBBIN/libMGridGen.so ] || \
-    [ -r $MGRIDGEN_ARCH_PATH/lib/libmgrid.a ] || \
-    [ -r $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a ] || \
-    [ "${MGRIDGEN_ARCH_PATH##*-}" = system ] || {
-        # ignore silently# echo "$warning (missing library)"
-        return 2
-    }
-
-    # Ensure consistent sizes with OpenFOAM and mgridgen header
-    # Extract typedef for idxtype, realtype
-    local label=$(sed -ne \
-        's/^.*typedef *\([^ ]*\) *idxtype.*/\1/ip' \
-        "$header")
-    local scalar=$(sed -ne \
-        's/^.*typedef *\([^ ]*\) *realtype.*/\1/ip' \
-        "$header")
-
-    : ${label:=unknown}
-    : ${scalar:=unknown}
-
-    case "$WM_LABEL_SIZE:$label" in
-    (32:int32_t | 32:int | 64:int64_t | 64:long)
-        export MGRIDGEN_ARCH_PATH
-        ;;
-
-    *)
-        echo "$warning (label='$WM_LABEL_SIZE', mgridgen.h has '$label')"
-        return 1
-        ;;
-    esac
-    case "$WM_PRECISION_OPTION:$scalar" in
-    (SP:float | DP:double)
-        export MGRIDGEN_ARCH_PATH
-        ;;
-
-    *)
-        echo "$warning (scalar='$WM_PRECISION_OPTION', mgridgen.h has '$scalar')"
-        return 1
-        ;;
-    esac
-
-    # OK
-    echo "mgridgen (label=$label, scalar=$scalar) - $MGRIDGEN_ARCH_PATH"
+#------------------------------------------------------------------------------
 
-}
+: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH}  # Extra safety?
+export FOAM_EXT_LIBBIN
 
-if hasMgridGen
+if have_mgridgen
 then
     wmake $targetType MGridGenGamgAgglomeration
 fi
diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
index 8f7b5aedc667eefc34f16377b49df3fd4463b0ed..7fd6b0ae76695ae3b2c5f2897ef5be4f24f2ad4b 100644
--- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
+++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
@@ -1,9 +1,6 @@
 EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
-    -I$(MGRIDGEN_ARCH_PATH)/include
+    -I$(MGRIDGEN_INC_DIR)
 
 LIB_LIBS = \
-    -L$(FOAM_EXT_LIBBIN) \
-    -L$(MGRIDGEN_ARCH_PATH)/lib \
-    -L$(MGRIDGEN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -lmgrid
+    -L$(MGRIDGEN_LIB_DIR) -lmgrid
diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake
index a70ae861ba0e324ddd00fb67616613dd6c236699..0f58db93952c4da6efc20ef8504b42f364953482 100755
--- a/src/lagrangian/Allwmake
+++ b/src/lagrangian/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType distributionModels
 wmake $targetType basic
 wmake $targetType solidParticle
diff --git a/src/lagrangian/molecularDynamics/Allwmake b/src/lagrangian/molecularDynamics/Allwmake
index c1221b264c932267017fe7a4801039e5f037e354..ce45c96d26ac6c392a332aa2107649fd7280c646 100755
--- a/src/lagrangian/molecularDynamics/Allwmake
+++ b/src/lagrangian/molecularDynamics/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType potential
 wmake $targetType molecularMeasurements
 wmake $targetType molecule
diff --git a/src/mesh/Allwmake b/src/mesh/Allwmake
index 52ef361a9fdeb96ee0f9668141597d213eae0930..f9d7193a10ffd7b57bf6bf2f1ae36244a3c8f9d4 100755
--- a/src/mesh/Allwmake
+++ b/src/mesh/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType snappyHexMesh
 wmake $targetType blockMesh
 wmake $targetType extrudeModel
diff --git a/src/parallel/Allwmake b/src/parallel/Allwmake
index a588a2b796e3eb73dee0040745caa319b84d11a5..15aba58375dac703487abeffeb05ca25e22214e4 100755
--- a/src/parallel/Allwmake
+++ b/src/parallel/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 decompose/Allwmake $targetType $*
 reconstruct/Allwmake $targetType $*
 wmake $targetType distributed
diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake
index f3711333487103d6732d1f8f6b22a5864ee12645..b745c6a503293b54dae3fb0a5c4018d81565743c 100755
--- a/src/parallel/decompose/Allwmake
+++ b/src/parallel/decompose/Allwmake
@@ -1,220 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                         # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+. $WM_PROJECT_DIR/wmake/scripts/have_kahip
+. $WM_PROJECT_DIR/wmake/scripts/have_metis
+. $WM_PROJECT_DIR/wmake/scripts/have_scotch
 
-: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH}  # Extra safety
-export FOAM_EXT_LIBBIN
-
-# Check for the existence of any of the files
-# On success, echoes the file found and returns 0, otherwise returns 2
-findFirstFile()
-{
-    local file
-    for file
-    do
-        if [ -f "$file" -a -r "$file" ]
-        then
-            echo "$file"
-            return 0
-        fi
-    done
-
-    return 2
-}
-
-
-# Test for kahip.
-# - return 0 and export KAHIP_ARCH_PATH on success
-hasKahip()
-{
-    local warning="==> skip kahip"
-    local header label settings
-
-    unset KAHIP_ARCH_PATH KAHIP_VERSION
-    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) || {
-        echo "$warning (no config.sh/kahip settings)"
-        return 1
-    }
-
-    . $settings
-    if [ -z "$KAHIP_ARCH_PATH" -o "${KAHIP_ARCH_PATH##*-}" = none ]
-    then
-        echo "$warning (not available)"
-        return 1
-    fi
-
-    # Header
-    header=$(findFirstFile \
-        $KAHIP_ARCH_PATH/include/kaHIP_interface.h \
-        /usr/include/kaHIP_interface.h \
-    ) || {
-        echo "$warning (no header)"
-        return 2  # file not found
-    }
-
-    # Library
-    [ "${KAHIP_ARCH_PATH##*-}" = system ] || \
-    findFirstFile \
-        $FOAM_EXT_LIBBIN/libkahip.so \
-        $KAHIP_ARCH_PATH/lib/libkahip.a  \
-        $KAHIP_ARCH_PATH/lib/libkahip.so \
-        $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
-        $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.so \
-    > /dev/null || {
-        echo "$warning (missing library)"
-        return 2
-    }
-
-    # kahip itself is 32-bit int, but our interface itself handles some
-    # 64-bit conversion (mesh size).
-
-    export KAHIP_ARCH_PATH
-    echo "kahip (label=32) - $KAHIP_ARCH_PATH"
-}
-
-
-# Test for metis.
-# - return 0 and export METIS_ARCH_PATH on success
-hasMetis()
-{
-    local warning="==> skip metis"
-    local header label settings
-
-    unset METIS_ARCH_PATH METIS_VERSION
-    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
-        echo "$warning (no config.sh/metis settings)"
-        return 1
-    }
-
-    . $settings
-    if [ -z "$METIS_ARCH_PATH" -o "${METIS_ARCH_PATH##*-}" = none ]
-    then
-        echo "$warning (not available)"
-        return 1
-    fi
-
-    # Header
-    header=$(findFirstFile \
-        $METIS_ARCH_PATH/include/metis.h \
-        /usr/include/metis.h \
-    ) || {
-        echo "$warning (no header)"
-        return 2  # file not found
-    }
-
-    # Library
-    [ "${METIS_ARCH_PATH##*-}" = system ] || \
-    findFirstFile \
-        $FOAM_EXT_LIBBIN/libmetis.so \
-        $METIS_ARCH_PATH/lib/libmetis.a \
-        $METIS_ARCH_PATH/lib/libmetis.so \
-        $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
-        $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so \
-    > /dev/null || {
-        echo "$warning (missing library)"
-        return 2
-    }
-
-    # Ensure consistent sizes between OpenFOAM and metis header
-    # Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
-    label=$(sed -ne 's/^.*#define  *IDXTYPEWIDTH  *\([1-9][0-9]\).*/\1/p' $header)
-    : ${label:=unknown}
-
-    if [ "$WM_LABEL_SIZE" = "$label" ]
-    then
-        echo "Metis (label=$label) - $METIS_ARCH_PATH"
-        export METIS_ARCH_PATH
-    else
-        echo "$warning (label=$WM_LABEL_SIZE, metis.h has '$label')"
-        return 1
-    fi
-}
-
-
-# Test for scotch.
-# - return 0 and export SCOTCH_ARCH_PATH, SCOTCH_VERSION on success
-hasScotch()
-{
-    local warning="==> skip scotch"
-    local header label settings
-
-    unset SCOTCH_ARCH_PATH SCOTCH_VERSION
-    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
-        echo "$warning (no config.sh/scotch settings)"
-        return 1
-    }
-
-    . $settings
-    if [ -z "$SCOTCH_ARCH_PATH" -o "${SCOTCH_ARCH_PATH##*-}" = none ]
-    then
-        echo "$warning (not available)"
-        return 1
-    fi
-
-    # Header
-    header=$(findFirstFile \
-        $SCOTCH_ARCH_PATH/include/scotch.h \
-        /usr/include/scotch/scotch.h \
-        /usr/include/scotch.h
-    ) || {
-        echo "$warning (no header)"
-        return 2  # file not found
-    }
-
-    # Library
-    [ "${SCOTCH_ARCH_PATH##*-}" = system ] || \
-    findFirstFile \
-        $FOAM_EXT_LIBBIN/libscotch.so \
-        $SCOTCH_ARCH_PATH/lib/libscotch.a \
-        $SCOTCH_ARCH_PATH/lib/libscotch.so \
-        $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.a \
-        $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so \
-    > /dev/null || {
-        echo "$warning (missing library)"
-        return 2
-    }
-
-    # Ensure consistent sizes between OpenFOAM and scotch header
-    # extract 'typedef int64_t SCOTCH_Num' or equivalent
-    label=$(sed -ne \
-        's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
-        "$header")
-
-    : ${label:=unknown}
-
-    # No SCOTCH_VERSION set? Try to obtain from header
-    # extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
-    [ -n "$SCOTCH_VERSION" ] || \
-    SCOTCH_VERSION=$(
-        eval $(
-            sed -ne \
-            's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
-            "$header"
-        )
-
-        set -- $VERSION $RELEASE $PATCHLEVEL
-        IFS="."
-        [ "$#" -gt 0 ] && echo "scotch-$*"
-    )
-
-    # Failsafe value
-    : ${SCOTCH_VERSION:=scotch}
-
-    case "$WM_LABEL_SIZE:$label" in
-    (32:int32_t | 32:int | 64:int64_t | 64:long)
-        echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
-        export SCOTCH_ARCH_PATH SCOTCH_VERSION
-        ;;
-
-    *)
-        echo "$warning (label='$WM_LABEL_SIZE', scotch.h has '$label')"
-        return 1
-        ;;
-    esac
-}
+#------------------------------------------------------------------------------
 
+: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH}  # Extra safety?
+export FOAM_EXT_LIBBIN
 
 #
 # Define how to create an mpi-versioned library of $targetType
@@ -244,7 +38,7 @@ wmakeMpiLib()
 
 wmakeLnInclude -u decompositionMethods
 
-if hasScotch
+if have_scotch
 then
     wmake $targetType scotchDecomp
     if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
@@ -253,12 +47,12 @@ then
     fi
 fi
 
-if hasMetis
+if have_metis
 then
     wmake $targetType metisDecomp
 fi
 
-if hasKahip
+if have_kahip
 then
     wmake $targetType kahipDecomp
 fi
diff --git a/src/parallel/decompose/kahipDecomp/Make/options b/src/parallel/decompose/kahipDecomp/Make/options
index fcd1c5d268a78ceb44ffc5090876d9dc47b52581..98706a61656b405511250f01b55f07d23c51cf79 100644
--- a/src/parallel/decompose/kahipDecomp/Make/options
+++ b/src/parallel/decompose/kahipDecomp/Make/options
@@ -1,15 +1,10 @@
 EXE_INC = \
-    -I$(KAHIP_ARCH_PATH)/include \
+    -I$(KAHIP_INC_DIR) \
     -I../decompositionMethods/lnInclude
 
 /*
- * The $(KAHIP_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
- * to support central, non-thirdparty installations.
- *
- * KaHIP is often compiled with openmp, but may be missing the
- * link dependency for openmp.
+ * KaHIP is usually compiled with openmp, but may be missing the
+ * openmp link dependency.
  */
 LIB_LIBS = \
-    -L$(KAHIP_ARCH_PATH)/lib \
-    -L$(KAHIP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -L$(FOAM_EXT_LIBBIN) $(LINK_OPENMP) -lkahip
+    -L$(KAHIP_LIB_DIR) $(LINK_OPENMP) -lkahip
diff --git a/src/parallel/decompose/metisDecomp/Make/options b/src/parallel/decompose/metisDecomp/Make/options
index a832e26823f731868fbc1044b18d1c7694068735..c44099aa7ee9f7bedcc190b39e008ab178afec44 100644
--- a/src/parallel/decompose/metisDecomp/Make/options
+++ b/src/parallel/decompose/metisDecomp/Make/options
@@ -1,14 +1,6 @@
 EXE_INC = \
-    /* -DFULLDEBUG -g -O0 */ \
-    -I$(METIS_ARCH_PATH)/include \
+    -I$(METIS_INC_DIR) \
     -I../decompositionMethods/lnInclude
 
-/*
- * The $(METIS_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
- * to support central, non-thirdparty installations
- */
 LIB_LIBS = \
-    -L$(METIS_ARCH_PATH)/lib \
-    -L$(METIS_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -L$(FOAM_EXT_LIBBIN) \
-    -lmetis
+    -L$(METIS_LIB_DIR) -lmetis
diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
index 51ae4a6662c6b8511af08b1d29ec0a51961b88d0..72c681656641cb76f35515d6f49326244c29f02b 100644
--- a/src/parallel/decompose/ptscotchDecomp/Make/options
+++ b/src/parallel/decompose/ptscotchDecomp/Make/options
@@ -3,21 +3,16 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
 
 EXE_INC = \
     $(PFLAGS) $(PINC) \
+    -I../decompositionMethods/lnInclude \
     -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
-    -I$(SCOTCH_ARCH_PATH)/include \
-    -I/usr/include/scotch \
-    -I../decompositionMethods/lnInclude
+    -I$(SCOTCH_INC_DIR)
 
 /*
  * The '-lscotch' is a slight hack:
  * ptscotch 6 requires scotch linked in, but does not declare the dependency
- *
- * The $(SCOTCH_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
- * to support central, non-thirdparty installations
  */
 LIB_LIBS = \
-    -L$(SCOTCH_ARCH_PATH)/lib \
-    -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
+    -L$(SCOTCH_LIB_DIR) \
     -L$(FOAM_EXT_LIBBIN) \
     -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \
     -lptscotch \
diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options
index 1ca71f6a6838c717694e731b6e7d6990e0d4b087..ebf3fa21b439dfefba0f3a5ba56039285b333a21 100644
--- a/src/parallel/decompose/scotchDecomp/Make/options
+++ b/src/parallel/decompose/scotchDecomp/Make/options
@@ -7,18 +7,8 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
 
 EXE_INC = \
     $(PFLAGS) $(PINC) \
-    -I$(SCOTCH_ARCH_PATH)/include \
-    -I/usr/include/scotch \
+    -I$(SCOTCH_INC_DIR) \
     -I../decompositionMethods/lnInclude
 
-/*
- * The $(SCOTCH_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
- * to support central, non-thirdparty installations
- */
 LIB_LIBS = \
-    -L$(SCOTCH_ARCH_PATH)/lib \
-    -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -L$(FOAM_EXT_LIBBIN) \
-    -lscotch \
-    -lscotcherrexit \
-    -lrt
+    -L$(SCOTCH_LIB_DIR) -lscotch -lscotcherrexit -lrt
diff --git a/src/parallel/reconstruct/Allwmake b/src/parallel/reconstruct/Allwmake
index d9ebb6fc90087aa8ecfb8e391df365a69cfc638b..d5089a9c4628306cd34566472d860979c81ab880 100755
--- a/src/parallel/reconstruct/Allwmake
+++ b/src/parallel/reconstruct/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType reconstruct
 
 #------------------------------------------------------------------------------
diff --git a/src/randomProcesses/Allwmake b/src/randomProcesses/Allwmake
index db8daca130efff3a981442589eb973530c6901e0..c81ffedf7817dc95192fe7649ba032bf6e7488c9 100755
--- a/src/randomProcesses/Allwmake
+++ b/src/randomProcesses/Allwmake
@@ -1,14 +1,13 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-targetType=libso
+cd ${0%/*} || exit 1                        # Run from this directory
+targetType=libso                            # Preferred library type
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+
+#------------------------------------------------------------------------------
 
-if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
-   [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
+if have_fftw
 then
-    # If it fails, we want to know.
     wmake $targetType
 else
     echo "==> skip randomProcesses library (no FFTW)"
diff --git a/src/randomProcesses/Make/options b/src/randomProcesses/Make/options
index 233247dccd568389de98af7e15c0f20939bc698d..6bb57027c0b7fc5d4202ceb3373cd6f907befef5 100644
--- a/src/randomProcesses/Make/options
+++ b/src/randomProcesses/Make/options
@@ -1,12 +1,10 @@
 EXE_INC = \
-    -I$(FFTW_ARCH_PATH)/include \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/sampling/lnInclude \
-    -I$(LIB_SRC)/surfMesh/lnInclude
+    -I$(LIB_SRC)/surfMesh/lnInclude \
+    -I$(FFTW_INC_DIR)
 
 LIB_LIBS = \
-    -L$(FFTW_ARCH_PATH)/lib \
-    -L$(FFTW_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -lfftw3 \
+    -L$(FFTW_LIB_DIR) -lfftw3 \
     -lfiniteVolume \
     -lsampling
diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake
index 1f2348ee2c43d5f36a2984689ebda670ddc70db9..d29ed140c7c515cfa2d932b6d6b334f3788d4c88 100755
--- a/src/regionModels/Allwmake
+++ b/src/regionModels/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType regionModel
 wmake $targetType pyrolysisModels
 wmake $targetType surfaceFilmModels
diff --git a/src/renumber/Allwmake b/src/renumber/Allwmake
index aef86c64506332e9dad1664c59ee51fd755d689c..c8122c5a8862b9d36716fe18a0b4818454f49394 100755
--- a/src/renumber/Allwmake
+++ b/src/renumber/Allwmake
@@ -1,29 +1,25 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-targetType=libso
+cd ${0%/*} || exit 1                        # Run from this directory
+targetType=libso                            # Preferred library type
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+. $WM_PROJECT_DIR/wmake/scripts/have_boost
+. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
 
-# Optional: get ZOLTAN_ARCH_PATH
-if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
-then
-    . $settings
-fi
+#------------------------------------------------------------------------------
 
 wmake $targetType renumberMethods
 
 warning="==> skip SloanRenumber"
-if [ -f "$BOOST_ARCH_PATH/include/boost/version.hpp" ] || \
-   [ "${BOOST_ARCH_PATH##*-}" = system -a -f /usr/include/boost/version.hpp ]
+if have_boost
 then
     wmake $targetType SloanRenumber || echo "$warning (build issues detected)"
 else
     echo "$warning (no boost)"
 fi
 
+
 warning="==> skip zoltanRenumber"
-if [ -d "$ZOLTAN_ARCH_PATH" ]
+if have_zoltan
 then
     wmake $targetType zoltanRenumber || echo "$warning (build issues detected)"
 else
diff --git a/src/renumber/SloanRenumber/Make/options b/src/renumber/SloanRenumber/Make/options
index b76ce9a4bcfacb383cd1616d3c5ccab637f317b1..23dc9dd623f5e4bcc44ea852b39050c2517d8aaa 100644
--- a/src/renumber/SloanRenumber/Make/options
+++ b/src/renumber/SloanRenumber/Make/options
@@ -1,14 +1,12 @@
 EXE_INC = \
     ${c++LESSWARN} \
-    -I$(BOOST_ARCH_PATH)/include \
+    -I$(BOOST_INC_DIR) \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
     -I$(LIB_SRC)/renumber/renumberMethods/lnInclude
 
 LIB_LIBS = \
-    -L$(BOOST_ARCH_PATH)/lib \
-    -L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -lboost_system \
+    -L$(BOOST_LIB_DIR) -lboost_system \
     -lmeshTools \
     -ldecompositionMethods \
     -lrenumberMethods
diff --git a/src/renumber/zoltanRenumber/Make/options b/src/renumber/zoltanRenumber/Make/options
index e92e24e0962594c631ec0a7fa1533d0ee676a155..79dc4f2bc899c9fe6d9fa890fb3e03075bd7a11f 100644
--- a/src/renumber/zoltanRenumber/Make/options
+++ b/src/renumber/zoltanRenumber/Make/options
@@ -2,15 +2,12 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
 sinclude $(RULES)/mplib$(WM_MPLIB)
 
 EXE_INC = \
-    /* -DFULLDEBUG -g -O0 */ \
     $(PFLAGS) $(PINC) \
     ${c++LESSWARN} \
     -I$(LIB_SRC)/renumber/renumberMethods/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
-    -I$(ZOLTAN_ARCH_PATH)/include
+    -I$(ZOLTAN_INC_DIR)
 
 LIB_LIBS = \
-    -L$(ZOLTAN_ARCH_PATH)/lib \
-    -L$(ZOLTAN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-    -lzoltan \
+    -L$(ZOLTAN_LIB_DIR) -lzoltan \
     -lmeshTools
diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake
index 2d59e0aae5ae0312e77cdc0e0cde2d0b26184024..520a2d0af2b27eac36b235ac14ec09db2c689150 100755
--- a/src/thermophysicalModels/Allwmake
+++ b/src/thermophysicalModels/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType specie
 wmake $targetType solidSpecie
 wmake $targetType thermophysicalProperties
diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake
index b533c83c310910626d17fab1363f2cb82564527e..4790540e340032cc82bbd7304925d8ace24981f1 100755
--- a/src/transportModels/Allwmake
+++ b/src/transportModels/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
+cd ${0%/*} || exit 1                        # Run from this directory
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
+#------------------------------------------------------------------------------
+
 wmake $targetType twoPhaseMixture
 wmake $targetType interfaceProperties
 wmake $targetType twoPhaseProperties
diff --git a/wmake/scripts/have_boost b/wmake/scripts/have_boost
new file mode 100644
index 0000000000000000000000000000000000000000..c1cd39dbc173a21523382fa2713f1bcb666ed920
--- /dev/null
+++ b/wmake/scripts/have_boost
@@ -0,0 +1,127 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_boost
+#
+# Description
+#     Detection/setup of Boost
+#
+# Requires
+#     BOOST_ARCH_PATH
+#
+# Functions provided
+#     have_boost, no_boost, echo_boost
+#
+# Variables set on success
+#     HAVE_BOOST
+#     BOOST_ARCH_PATH
+#     BOOST_INC_DIR
+#     BOOST_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_boost()
+{
+    unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR
+    return 0
+}
+
+
+# Report
+echo_boost()
+{
+    echo "boost=${HAVE_BOOST:-false}"
+    echo "root=$BOOST_ARCH_PATH"
+    echo "include=$BOOST_INC_DIR"
+    echo "library=$BOOST_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
+have_boost()
+{
+    local header library static label settings warn
+    # warn="==> skip boost"
+
+    # Basic setup/checks
+    if isNone "$BOOST_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="boost/version.hpp"
+    library="libboost_system$extLibso"
+
+
+    if hasAbsdir "$BOOST_ARCH_PATH"
+    then
+        header=$(findFirstFile $BOOST_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $BOOST_ARCH_PATH/lib/$library \
+            $BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$BOOST_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    header="${header%/*}"     # Strip one-level (include/boost/...)
+
+    export HAVE_BOOST=true
+    export BOOST_ARCH_PATH
+    export BOOST_INC_DIR="${header%/*}"     # Basename
+    export BOOST_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_boost
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_boost
+    echo_boost
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_ccmio b/wmake/scripts/have_ccmio
new file mode 100644
index 0000000000000000000000000000000000000000..a957415b6f71d06d8f0950e6000c690aa1a217e1
--- /dev/null
+++ b/wmake/scripts/have_ccmio
@@ -0,0 +1,145 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_ccmio
+#
+# Description
+#     Detection/setup of ccmio
+#
+# Requires
+#     config.sh/ccmio
+#
+# Functions provided
+#     have_ccmio, no_ccmio, echo_ccmio
+#
+# Variables set on success
+#     HAVE_CCMIO
+#     CCMIO_ARCH_PATH
+#     CCMIO_INC_DIR
+#     CCMIO_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_ccmio()
+{
+    unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
+    return 0
+}
+
+# Report
+echo_ccmio()
+{
+    echo "ccmio=${HAVE_CCMIO:-false}"
+    echo "root=$CCMIO_ARCH_PATH"
+    echo "include=$CCMIO_INC_DIR"
+    echo "library=$CCMIO_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
+have_ccmio()
+{
+    local header library static label settings warn good
+    warn="==> skip ccmio"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) || {
+        [ -n "$warn" ] && echo "$warn (no config.sh/ccmio settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$CCMIO_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names.
+    # Link with static libccmio only (fewer issues)
+    #
+    header="libccmio/ccmio.h"
+    static="libccmio$extLiba"
+
+
+    if hasAbsdir "$CCMIO_ARCH_PATH"
+    then
+        header=$(findFirstFile $CCMIO_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $CCMIO_ARCH_PATH/lib/$static \
+            $CCMIO_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    header="${header%/*}"     # Strip one-level (include/libccmio/...)
+
+    # The libccmio uses int32_t.
+    # The OpenFOAM adapter thus requires additional work for 64-bit labels.
+    # The OpenFOAM adapter was originally only designed for 'double'
+
+    if [ "$WM_LABEL_SIZE" = 32 ]
+    then
+        if [ "$WM_PRECISION_OPTION" = DP ]
+        then
+            good=true
+        else
+            [ -n "$warn" ] && echo "$warn (double precision only)"
+            no_ccmio
+            return 1
+        fi
+    else
+        [ -n "$warn" ] && echo "$warn (32-bit labels only)"
+        no_ccmio
+        return 1
+    fi
+
+    export HAVE_CCMIO=true
+    export CCMIO_ARCH_PATH
+    export CCMIO_INC_DIR="${header%/*}"     # Basename
+    export CCMIO_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_ccmio
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_ccmio
+    echo_ccmio
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_cgal b/wmake/scripts/have_cgal
new file mode 100644
index 0000000000000000000000000000000000000000..9c14b0caec9bf22a6e0cbbd4a6c09948b366718d
--- /dev/null
+++ b/wmake/scripts/have_cgal
@@ -0,0 +1,127 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_cgal
+#
+# Description
+#     Detection/setup of CGAL
+#
+# Requires
+#     CGAL_ARCH_PATH
+#
+# Functions provided
+#     have_cgal, no_cgal, echo_cgal
+#
+# Variables set on success
+#     HAVE_CGAL
+#     CGAL_ARCH_PATH
+#     CGAL_INC_DIR
+#     CGAL_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_cgal()
+{
+    unset HAVE_CGAL CGAL_INC_DIR CGAL_LIB_DIR
+    return 0
+}
+
+
+# Reset variables
+echo_cgal()
+{
+    echo "cgal=${HAVE_CGAL:-false}"
+    echo "root=$CGAL_ARCH_PATH"
+    echo "include=$CGAL_INC_DIR"
+    echo "library=$CGAL_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR
+have_cgal()
+{
+    local header library static label settings warn
+    # warn="==> skip cgal"
+
+    # Basic setup/checks
+    if isNone "$CGAL_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="CGAL/version.h"
+    library="libCGAL$extLibso"
+
+
+    if hasAbsdir "$CGAL_ARCH_PATH"
+    then
+        header=$(findFirstFile $CGAL_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $CGAL_ARCH_PATH/lib/$library \
+            $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$CGAL_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    header="${header%/*}"     # Strip one-level (include/CGAL/...)
+
+    export HAVE_CGAL=true
+    export CGAL_ARCH_PATH
+    export CGAL_INC_DIR="${header%/*}"     # Basename
+    export CGAL_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_cgal
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_cgal
+    echo_cgal
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_fftw b/wmake/scripts/have_fftw
new file mode 100644
index 0000000000000000000000000000000000000000..d3e87c5daba21c3abf479ed76a5b092973050178
--- /dev/null
+++ b/wmake/scripts/have_fftw
@@ -0,0 +1,125 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_fftw
+#
+# Description
+#     Detection/setup of FFTW
+#
+# Requires
+#     FFTW_ARCH_PATH
+#
+# Functions provided
+#     have_fftw, no_fftw, echo_fftw
+#
+# Variables set on success
+#     HAVE_FFTW
+#     FFTW_ARCH_PATH
+#     FFTW_INC_DIR
+#     FFTW_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_fftw()
+{
+    unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR
+    return 0
+}
+
+
+# Report
+echo_fftw()
+{
+    echo "fftw=${HAVE_FFTW:-false}"
+    echo "root=$FFTW_ARCH_PATH"
+    echo "include=$FFTW_INC_DIR"
+    echo "library=$FFTW_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR
+have_fftw()
+{
+    local header library static label settings warn
+    # warn="==> skip fftw"
+
+    # Basic setup/checks
+    if isNone "$FFTW_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="fftw3.h"
+    library="libfftw3$extLibso"
+
+
+    if hasAbsdir "$FFTW_ARCH_PATH"
+    then
+        header=$(findFirstFile $FFTW_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $FFTW_ARCH_PATH/lib/$library \
+            $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$FFTW_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    export HAVE_FFTW=true
+    export FFTW_ARCH_PATH
+    export FFTW_INC_DIR="${header%/*}"     # Basename
+    export FFTW_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_fftw
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_fftw
+    echo_fftw
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_kahip b/wmake/scripts/have_kahip
new file mode 100644
index 0000000000000000000000000000000000000000..84e8cbde35c72c8782502dbd054b1ac418519b0c
--- /dev/null
+++ b/wmake/scripts/have_kahip
@@ -0,0 +1,138 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_kahip
+#
+# Description
+#     Detection/setup of KAHIP
+#
+# Requires
+#     config.sh/kahip
+#
+# Functions provided
+#     have_kahip, no_kahip, echo_kahip
+#
+# Variables set on success
+#     HAVE_KAHIP
+#     KAHIP_ARCH_PATH
+#     KAHIP_INC_DIR
+#     KAHIP_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_kahip()
+{
+    unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
+    unset KAHIP_VERSION
+    return 0
+}
+
+
+# Report
+echo_kahip()
+{
+    echo "kahip=${HAVE_KAHIP:-false}"
+    echo "root=$KAHIP_ARCH_PATH"
+    echo "include=$KAHIP_INC_DIR"
+    echo "library=$KAHIP_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
+have_kahip()
+{
+    local header library static label settings warn
+    warn="==> skip kahip"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) || {
+        [ -n "$warn" ] && echo "$warn (no config.sh/kahip settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$KAHIP_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="kaHIP_interface.h"
+    library="libkahip$extLibso"
+    static="libkahip$extLiba"
+
+    if hasAbsdir "$KAHIP_ARCH_PATH"
+    then
+        header=$(findFirstFile $KAHIP_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $METIS_ARCH_PATH/lib/$static \
+            $METIS_ARCH_PATH/lib/$library \
+            $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+            $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$KAHIP_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+
+    # kahip itself is 32-bit int, but our interface itself handles some
+    # 64-bit conversion (mesh size).
+
+    echo "kahip (label=32) - $KAHIP_ARCH_PATH"
+    export HAVE_KAHIP=true
+    export KAHIP_ARCH_PATH
+    export KAHIP_INC_DIR="${header%/*}"     # Basename
+    export KAHIP_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_kahip
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_kahip
+    echo_kahip
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_metis b/wmake/scripts/have_metis
new file mode 100644
index 0000000000000000000000000000000000000000..ec5b185c04186b4cba73a0b91e1ba4295154bc83
--- /dev/null
+++ b/wmake/scripts/have_metis
@@ -0,0 +1,151 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_metis
+#
+# Description
+#     Detection/setup of metis
+#
+# Requires
+#     config.sh/metis
+#
+# Functions provided
+#     have_metis, no_metis, echo_metis
+#
+# Variables set on success
+#     HAVE_METIS
+#     METIS_ARCH_PATH
+#     METIS_INC_DIR
+#     METIS_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_metis()
+{
+    unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
+    unset METIS_VERSION
+    return 0
+}
+
+
+# Report
+echo_metis()
+{
+    echo "metis=${HAVE_METIS:-false}"
+    echo "root=$METIS_ARCH_PATH"
+    echo "include=$METIS_INC_DIR"
+    echo "library=$METIS_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
+have_metis()
+{
+    local header library static label settings warn
+    warn="==> skip metis"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
+        [ -n "$warn" ] && echo "$warn (no config.sh/metis settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$METIS_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="metis.h"
+    library="libmetis$extLibso"
+    static="libmetis$extLiba"
+
+
+    if hasAbsdir "$METIS_ARCH_PATH"
+    then
+        header=$(findFirstFile $METIS_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $METIS_ARCH_PATH/lib/$static \
+            $METIS_ARCH_PATH/lib/$library \
+            $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+            $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$METIS_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+
+    # Ensure consistent sizes between OpenFOAM and metis header
+    # Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
+    label=$(sed -ne 's/^.*#define  *IDXTYPEWIDTH  *\([1-9][0-9]\).*/\1/p' $header)
+    : ${label:=unknown}
+
+    if [ "$WM_LABEL_SIZE" = "$label" ]
+    then
+        echo "Metis (label=$label) - $METIS_ARCH_PATH"
+        export HAVE_METIS=true
+        export METIS_ARCH_PATH
+        export METIS_INC_DIR="${header%/*}"     # Basename
+        export METIS_LIB_DIR="${library%/*}"    # Basename
+    else
+        if [ -n "$warn" ]
+        then
+            echo "$warn (label=$WM_LABEL_SIZE, metis.h has '$label')"
+        fi
+        no_metis
+        return 1
+    fi
+}
+
+
+# Force reset of old variables
+no_metis
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_metis
+    echo_metis
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_mgridgen b/wmake/scripts/have_mgridgen
new file mode 100644
index 0000000000000000000000000000000000000000..3c232c43fb5829443016be135fe11fb96c506fa5
--- /dev/null
+++ b/wmake/scripts/have_mgridgen
@@ -0,0 +1,177 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_mgridgen
+#
+# Description
+#     Detection/setup of mgridgen
+#
+# Requires
+#     config.sh/mgridgen
+#
+# Functions provided
+#     have_mgridgen, no_mgridgen, echo_mgridgen
+#
+# Variables set on success
+#     HAVE_MGRIDGEN
+#     MGRIDGEN_ARCH_PATH
+#     MGRIDGEN_INC_DIR
+#     MGRIDGEN_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_mgridgen()
+{
+    unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
+    unset MGRIDGEN_VERSION
+    return 0
+}
+
+
+# Report
+echo_mgridgen()
+{
+    echo "mgridgen=${HAVE_MGRIDGEN:-false}"
+    echo "root=$MGRIDGEN_ARCH_PATH"
+    echo "include=$MGRIDGEN_INC_DIR"
+    echo "library=$MGRIDGEN_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
+have_mgridgen()
+{
+    local header library static label scalar settings warn good
+    warn="==> skip mgridgen"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) || {
+        #silent# [ -n "$warn" ] && echo "$warn (no config.sh/mgridgen settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$MGRIDGEN_ARCH_PATH"
+    then
+        #silent# [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="mgridgen.h"
+    library="libMGridGen$extLibso"
+    static="libmgrid$extLiba"
+
+
+    if hasAbsdir "$MGRIDGEN_ARCH_PATH"
+    then
+        header=$(findFirstFile $MGRIDGEN_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $MGRIDGEN_ARCH_PATH/lib/$static \
+            $MGRIDGEN_ARCH_PATH/lib/$library \
+            $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+            $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$MGRIDGEN_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        #silent# [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        #silent# [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+
+    # Ensure consistent sizes with OpenFOAM and mgridgen header
+    # Extract typedef for idxtype, realtype
+    label=$(sed -ne \
+        's/^.*typedef *\([^ ]*\) *idxtype.*/\1/ip' \
+        "$header")
+    scalar=$(sed -ne \
+        's/^.*typedef *\([^ ]*\) *realtype.*/\1/ip' \
+        "$header")
+
+    : ${label:=unknown}
+    : ${scalar:=unknown}
+
+
+    case "$WM_LABEL_SIZE:$label" in
+    (32:int32_t | 32:int | 64:int64_t | 64:long)
+        good=true
+        ;;
+
+    *)
+        if [ -n "$warn" ]
+        then
+            echo "$warn (label='$WM_LABEL_SIZE', mgridgen.h has '$label')"
+        fi
+        return 1
+        ;;
+    esac
+    case "$WM_PRECISION_OPTION:$scalar" in
+    (SP:float | DP:double)
+        good=true
+        ;;
+
+    *)
+        if [ -n "$warn" ]
+        then
+            echo "$warn (scalar='$WM_PRECISION_OPTION', mgridgen.h has '$scalar')"
+        fi
+        return 1
+        ;;
+    esac
+
+    # OK
+    echo "mgridgen (label=$label, scalar=$scalar) - $MGRIDGEN_ARCH_PATH"
+    export HAVE_MGRIDGEN=true
+    export MGRIDGEN_ARCH_PATH MGRIDGEN_VERSION
+    export MGRIDGEN_INC_DIR="${header%/*}"     # Basename
+    export MGRIDGEN_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_mgridgen
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_mgridgen
+    echo_mgridgen
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_readline b/wmake/scripts/have_readline
new file mode 100644
index 0000000000000000000000000000000000000000..db85cdf0e8320d90c3b8da42403d9df061f97290
--- /dev/null
+++ b/wmake/scripts/have_readline
@@ -0,0 +1,101 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_readline
+#
+# Description
+#     Detection/setup of readline
+#
+# Requires
+#     None
+#
+# Functions provided
+#     have_readline, no_readline, echo_readline
+#
+# Variables set on success
+#     HAVE_LIBREADLINE - as per GNU autoconf
+#     READLINE_INC_DIR
+#     READLINE_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_readline()
+{
+    unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
+    return 0
+}
+
+
+# Report
+echo_readline()
+{
+    echo "readline=${HAVE_LIBREADLINE:-false}"
+    echo "include=$READLINE_INC_DIR"
+    echo "library=$READLINE_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
+have_readline()
+{
+    local header library static settings warn
+    # warn="==> skip readline"
+
+
+    # Header/library names
+    header="readline/readline.h"
+    library="libreadline$extLibso"
+
+    # System only?
+    header=$(findFirstFile /usr/include/$header)
+
+    library=$(findFirstFile \
+        /usr/lib/$library \
+        /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+    )
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    header="${header%/*}"     # Strip one-level (include/readline/...)
+
+    export HAVE_LIBREADLINE=true
+    export READLINE_INC_DIR="${header%/*}"     # Basename
+    export READLINE_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_readline
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_readline
+    echo_readline
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_scotch b/wmake/scripts/have_scotch
new file mode 100644
index 0000000000000000000000000000000000000000..2ad72ec4c6d9f034864868a0ad3e7650cb4b88be
--- /dev/null
+++ b/wmake/scripts/have_scotch
@@ -0,0 +1,174 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_scotch
+#
+# Description
+#     Detection/setup of scotch
+#
+# Requires
+#     config.sh/scotch
+#
+# Functions provided
+#     have_scotch, no_scotch, echo_scotch
+#
+# Variables set on success
+#     HAVE_SCOTCH
+#     SCOTCH_ARCH_PATH
+#     SCOTCH_INC_DIR
+#     SCOTCH_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_scotch()
+{
+    unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
+    unset SCOTCH_VERSION
+    return 0
+}
+
+
+# Report
+echo_scotch()
+{
+    echo "scotch=${HAVE_SCOTCH:-false}"
+    echo "root=$SCOTCH_ARCH_PATH"
+    echo "include=$SCOTCH_INC_DIR"
+    echo "library=$SCOTCH_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR
+have_scotch()
+{
+    local header library static label settings warn
+    warn="==> skip scotch"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
+        [ -n "$warn" ] && echo "$warn (no config.sh/scotch settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$SCOTCH_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="scotch.h"
+    library="libscotch$extLibso"
+    static="libscotch$extLiba"
+
+
+    if hasAbsdir "$SCOTCH_ARCH_PATH"
+    then
+        header=$(findFirstFile $SCOTCH_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $SCOTCH_ARCH_PATH/lib/$static \
+            $SCOTCH_ARCH_PATH/lib/$library \
+            $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+            $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$SCOTCH_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header /usr/include/scotch/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+
+    # Ensure consistent sizes between OpenFOAM and scotch header
+    # extract 'typedef int64_t SCOTCH_Num' or equivalent
+    label=$(sed -ne \
+        's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
+        "$header")
+    : ${label:=unknown} # Failsafe value
+
+
+    # No SCOTCH_VERSION set? Try to obtain from header
+    # extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
+    [ -n "$SCOTCH_VERSION" ] || \
+    SCOTCH_VERSION=$(
+        eval $(
+            sed -ne \
+            's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
+            "$header"
+        )
+
+        set -- $VERSION $RELEASE $PATCHLEVEL
+        IFS="."
+        [ "$#" -gt 0 ] && echo "scotch-$*"
+    )
+    : ${SCOTCH_VERSION:=scotch} # Failsafe value
+
+
+    case "$WM_LABEL_SIZE:$label" in
+    (32:int32_t | 32:int | 64:int64_t | 64:long)
+        echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
+        export HAVE_SCOTCH=true
+        export SCOTCH_ARCH_PATH SCOTCH_VERSION
+        export SCOTCH_INC_DIR="${header%/*}"     # Basename
+        export SCOTCH_LIB_DIR="${library%/*}"    # Basename
+        ;;
+
+    *)
+        if [ -n "$warn" ]
+        then
+            echo "$warn (label='$WM_LABEL_SIZE', scotch.h has '$label')"
+        fi
+        no_scotch
+        return 1
+        ;;
+    esac
+}
+
+
+# Force reset of old variables
+no_scotch
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_scotch
+    echo_scotch
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/have_zoltan b/wmake/scripts/have_zoltan
new file mode 100644
index 0000000000000000000000000000000000000000..bd02ac54a4ea02fe360d4d521037bd2500a3e3cb
--- /dev/null
+++ b/wmake/scripts/have_zoltan
@@ -0,0 +1,133 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     have_zoltan
+#
+# Description
+#     Detection/setup of zoltan
+#
+# Requires
+#     config.sh/zoltan
+#
+# Functions provided
+#     have_zoltan, no_zoltan, echo_zoltan
+#
+# Variables set on success
+#     HAVE_ZOLTAN
+#     ZOLTAN_ARCH_PATH
+#     ZOLTAN_INC_DIR
+#     ZOLTAN_LIB_DIR
+#
+#------------------------------------------------------------------------------
+. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+
+#------------------------------------------------------------------------------
+
+# Reset variables
+no_zoltan()
+{
+    unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR
+    return 0
+}
+
+
+# Report
+echo_zoltan()
+{
+    echo "zoltan=${HAVE_ZOLTAN:-false}"
+    echo "root=$ZOLTAN_ARCH_PATH"
+    echo "include=$ZOLTAN_INC_DIR"
+    echo "library=$ZOLTAN_LIB_DIR"
+}
+
+
+# On success, return 0 and export variables
+# -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR
+have_zoltan()
+{
+    local header library static label settings warn
+    # warn="==> skip zoltan"
+
+    # Basic setup/checks
+    settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) || {
+        [ -n "$warn" ] && echo "$warn (no config.sh/zoltan settings)"
+        return 1
+    }
+    . $settings
+    if isNone "$ZOLTAN_ARCH_PATH"
+    then
+        [ -n "$warn" ] && echo "$warn (not available)"
+        return 1
+    fi
+
+
+    # Header/library names
+    header="zoltan.h"
+    library="libzoltan$extLibso"
+    static="libzoltan$extLiba"
+
+
+    if hasAbsdir "$ZOLTAN_ARCH_PATH"
+    then
+        header=$(findFirstFile $ZOLTAN_ARCH_PATH/include/$header)
+
+        # FOAM_EXT_LIBBIN is allowed to be unset
+        library=$(findFirstFile \
+            $FOAM_EXT_LIBBIN/$library \
+            $ZOLTAN_ARCH_PATH/lib/$static \
+            $ZOLTAN_ARCH_PATH/lib/$library \
+            $ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+            $ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    elif isSystem "$ZOLTAN_ARCH_PATH"
+    then
+        header=$(findFirstFile /usr/include/$header)
+
+        library=$(findFirstFile \
+            /usr/lib/$library \
+            /usr/lib$WM_COMPILER_LIB_ARCH/$library \
+        )
+    else
+        unset header library
+    fi
+
+
+    # Header found?
+    [ -n "$header" ] || {
+        [ -n "$warn" ] && echo "$warn (no header)"
+        return 2
+    }
+
+    # Library found?
+    [ -n "$library" ] || {
+        [ -n "$warn" ] && echo "$warn (missing library)"
+        return 2
+    }
+
+    export HAVE_ZOLTAN=true
+    export ZOLTAN_ARCH_PATH
+    export ZOLTAN_INC_DIR="${header%/*}"     # Basename
+    export ZOLTAN_LIB_DIR="${library%/*}"    # Basename
+}
+
+
+# Force reset of old variables
+no_zoltan
+
+# Testing
+if [ "$1" = "-test" ]
+then
+    have_zoltan
+    echo_zoltan
+fi
+
+#------------------------------------------------------------------------------
diff --git a/wmake/scripts/sysFunctions b/wmake/scripts/sysFunctions
new file mode 100644
index 0000000000000000000000000000000000000000..9b3630c749d0b87fac92c55f4bfb5b19c8d701b8
--- /dev/null
+++ b/wmake/scripts/sysFunctions
@@ -0,0 +1,110 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM, licensed under GNU General Public License
+#     <http://www.gnu.org/licenses/>.
+#
+# Script
+#     sysFunctions
+#
+# Description
+#     General system helper functions
+#
+# Functions provided
+#     isDarwin
+#     isNone
+#     isSystem
+#     isAbsdir, hasAbsdir
+#     findFirstFile
+#
+# Variables provided
+#     extLiba
+#     extLibso
+#
+#------------------------------------------------------------------------------
+
+if [ -z "$WMAKE_SCRIPTS_SYSFUNCTIONS" ]
+then
+    # Load once, but do not rely on this variable elsewhere
+    WMAKE_SCRIPTS_SYSFUNCTIONS=loaded
+
+    # Static library extension. Default=.a
+    extLiba=".a"
+
+    # Shared library extension. Default=.so
+    case "$(uname -s 2>/dev/null)" in
+    Darwin)
+        extLibso=".dylib"
+        ;;
+    *)
+        extLibso=".so"
+        ;;
+    esac
+
+
+    # True if OS is Darwin.
+    # Uses libso extension to cache the value
+    # (instead of calling 'uname -s' each time)
+    isDarwin()
+    {
+        test "$extLibso" = ".dylib"
+    }
+
+
+    # True if '$1' begins with '/'
+    isAbsdir()
+    {
+        test "$1" = "/${1#/}"
+    }
+
+
+    # True if '$1' begins with '/' and also exists as a directory
+    hasAbsdir()
+    {
+        test "$1" = "/${1#/}" -a -d "$1"
+    }
+
+
+    # True if '$1' is an empty string or matches "*-none".
+    # Eg,
+    #    if isNone "$KAHIP_ARCH_PATH" ...
+    isNone()
+    {
+        test -z "$1" -o "${1##*-}" = none
+    }
+
+
+    # True if '$1' matches "*-system"
+    # Eg,
+    #    if isSystem "$BOOST_ARCH_PATH"
+    isSystem()
+    {
+        test "${1##*-}" = system
+    }
+
+
+    # Check for the existence of any of the files
+    # On success, echoes the file found and returns 0, otherwise returns 2
+    findFirstFile()
+    {
+        local file
+        for file
+        do
+            if [ -f "$file" -a -r "$file" ]
+            then
+                echo "$file"
+                return 0
+            fi
+        done
+        return 2
+    }
+
+fi
+
+
+#------------------------------------------------------------------------------