Skip to content

Commit 9a0185b

Browse files
Make an earlier check that we can build CollectUnsupported
Also does PATH mangling to avoid picking up the GNAT g++ binary...
1 parent e723eb6 commit 9a0185b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

experiments/list_unsupported.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fi
2727
echo >&2 "Project to build: $1"
2828
path="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
2929
include_path=""
30-
DIR=`dirname "$0"`
3130
file_name=$(basename "$1")
3231

3332
for foldername in $(find ${path} -type d -name "*" | LC_ALL=posix sort ); do
@@ -88,7 +87,22 @@ else
8887
exit 9
8988
fi
9089
fi
90+
91+
# Can we build the support tool?
92+
# Problem: GNAT 2016 helpfully installs a g++ binary alongside gnat... except
93+
# it's way out of date so invoking g++ via PATH looking will pickup that gnat g++
94+
# compiler, rather than the default system compiler... Instead we need to
95+
# temporarily drop the GNAT tools off the path while we build the tool.
96+
saved_path="$PATH"
97+
export PATH=$(echo ${PATH} | tr ':' '\n' | grep -v "${ADA_HOME}" | paste -s -d : - )
98+
experiment_dir=`dirname "$0"`
99+
gplusplus=`command -v g++`
100+
if ! ${gplusplus} --std=c++14 "${experiment_dir}/collect_unsupported.cpp" -o CollectUnsupported ; then
101+
echo >&2 "Failed to compile support tool 'CollectUnsupported' using ${gplusplus}"
102+
echo >&2 "You need a version of g++ on the PATH that supports C++14"
103+
exit 8
91104
fi
105+
export PATH="${saved_path}"
92106

93107
# Enumerate all the sub directories of ADA_INCLUDE_PATH
94108
for include_folder in `echo "$ADA_INCLUDE_PATH" | tr ':' ' '` ; do
@@ -153,7 +167,6 @@ sed '/^\[/ d' < "$file_name".txt | \
153167
> "$file_name"_redacted.txt
154168

155169
# Collate and summarise unsupported features
156-
g++ --std=c++14 "$DIR"/collect_unsupported.cpp -o CollectUnsupported
157170
LC_ALL=posix ./CollectUnsupported "$file_name".txt
158171

159172
# Collate and summarize compile errors from builds that did not generate

0 commit comments

Comments
 (0)