Skip to content

Commit b9803c6

Browse files
committed
mingw
1 parent 910b9b4 commit b9803c6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

selfcheck.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
set -x
4+
35
output=$(./simplecpp simplecpp.cpp -e -f 2>&1)
46
ec=$?
57
errors=$(echo "$output" | grep -v 'Header not found: <')
@@ -21,7 +23,7 @@ fi
2123
# TODO: how to get built-in include paths from compiler?
2224
if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then
2325
gcc_ver=$($CXX -dumpversion)
24-
gcc_target=$(gcc -v 2>&1 | grep Target: | cut -d' ' -f2)
26+
gcc_target=$($CXX -v 2>&1 | grep Target: | cut -d' ' -f2)
2527
defs=
2628
defs="$defs -D__GNUC__"
2729
defs="$defs -D__STDC__"
@@ -35,6 +37,7 @@ if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then
3537
find /usr/include -name cctype
3638
find /usr -name stddef.h
3739
find /usr/include -name stddef.h
40+
find /usr -name c++config.h
3841
# some required include paths might differ per distro
3942
inc=
4043
inc="$inc -I/usr/include"
@@ -60,6 +63,7 @@ if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then
6063
elif [ "$cxx_type" = "clang" ]; then
6164
clang_ver=$($CXX -dumpversion)
6265
clang_ver=${clang_ver%%.*}
66+
clang_target=$($CXX -v 2>&1 | grep Target: | cut -d' ' -f2)
6367
defs=
6468
defs="$defs -D__BYTE_ORDER__"
6569
defs="$defs -D__linux__"
@@ -88,8 +92,8 @@ elif [ "$cxx_type" = "clang" ]; then
8892
if [ -d "/usr/lib/clang/$clang_ver/include" ]; then # Manjaro, ubuntu
8993
inc="$inc -I/usr/lib/clang/$clang_ver/include"
9094
fi
91-
if [ -d "/usr/include/x86_64-linux-gnu" ]; then
92-
inc="$inc -I/usr/include/x86_64-linux-gnu"
95+
if [ -d "/usr/include/$clang_target" ]; then
96+
inc="$inc -I/usr/include/$clang_target"
9397
fi
9498
elif [ "$cxx_type" = "Apple" ]; then
9599
appleclang_ver=$($CXX -dumpversion)

0 commit comments

Comments
 (0)