From f45434375df941edeeefd1e3f2f1094bd97dcd96 Mon Sep 17 00:00:00 2001
From: Robert Izzard <r.izzard@surrey.ac.uk>
Date: Mon, 9 Dec 2019 15:39:30 +0000
Subject: [PATCH] fix issue with sh and bash confusion

---
 meson.build               | 4 ++--
 meson/directory_exists.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 6c092bf20..d7654aee5 100644
--- a/meson.build
+++ b/meson.build
@@ -508,7 +508,8 @@ _include_search_paths = [
     '/usr/local/include',
 ] 
 foreach idir : _include_search_paths
-    if run_command('sh','-c','meson/directory_exists.sh',idir).returncode() == 0
+    _ret = run_command('sh','-c','meson/directory_exists.sh',idir).returncode()
+    if _ret == 0
         inc_arg = idir
         _Inc_arg = '-I' + idir
         if not found and compiler.has_header('gsl/gsl_blas.h',
@@ -521,7 +522,6 @@ endforeach
 
 incdirs += [ my_incdirs ]
 
-
 ############################################################
 # features which are converted into preprocessor flags (-D)
 #
diff --git a/meson/directory_exists.sh b/meson/directory_exists.sh
index 43fe49a4c..1e046fc79 100755
--- a/meson/directory_exists.sh
+++ b/meson/directory_exists.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
 
 # return 0 if directory exists, 1 otherwise
-if [[ -d "$1" ]]; then
+if [ -d "$1" ]; then
     exit 0;
 else
     exit 1;
-- 
GitLab