Skip to content

Commit 91417fd

Browse files
committed
mingw
1 parent 3d1903e commit 91417fd

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

selfcheck.sh

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

3-
set -x
4-
53
output=$(./simplecpp simplecpp.cpp -e -f 2>&1)
64
ec=$?
75
errors=$(echo "$output" | grep -v 'Header not found: <')
@@ -20,28 +18,20 @@ cxx_type=$($CXX --version | head -1 | cut -d' ' -f1)
2018
if [ "$cxx_type" = "Ubuntu" ]; then
2119
cxx_type=$($CXX --version | head -1 | cut -d' ' -f2)
2220
fi
23-
# TODO: get built-in include paths from compiler
24-
# $CXX -x c++ -v -c - < /dev/null
25-
# ...
26-
# include <...> search starts here:
27-
# /usr/include/c++/14
28-
# /usr/include/x86_64-linux-gnu/c++/14
29-
# /usr/include/c++/14/backward
30-
# /usr/lib/gcc/x86_64-linux-gnu/14/include
31-
# /usr/local/include
32-
# /usr/include/x86_64-linux-gnu
33-
# /usr/include
34-
# End of search list.
35-
#
21+
3622
if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then
3723
gcc_ver=$($CXX -dumpversion)
3824
gcc_target=$($CXX -v 2>&1 | grep Target: | cut -d' ' -f2)
25+
# TODO: get built-in include paths from compiler
26+
$CXX -x c++ -v -c - < /dev/null
27+
3928
defs=
4029
defs="$defs -D__GNUC__"
4130
defs="$defs -D__STDC__"
4231
defs="$defs -D__STDC_HOSTED__"
4332
defs="$defs -D__CHAR_BIT__=8"
4433
defs="$defs -D__x86_64__"
34+
defs="$defs -D__INTPTR_TYPE__=long int" # MSYS
4535
defs="$defs -D__has_builtin(x)=(1)"
4636
defs="$defs -D__has_cpp_attribute(x)=(1)"
4737
defs="$defs -D__has_attribute(x)=(1)"
@@ -81,6 +71,9 @@ elif [ "$cxx_type" = "clang" ]; then
8171
clang_ver=$($CXX -dumpversion)
8272
clang_ver=${clang_ver%%.*}
8373
clang_target=$($CXX -v 2>&1 | grep Target: | cut -d' ' -f2)
74+
# TODO: get built-in include paths from compiler
75+
$CXX -x c++ -v -c - < /dev/null
76+
8477
defs=
8578
defs="$defs -D__BYTE_ORDER__"
8679
defs="$defs -D__linux__"
@@ -115,6 +108,7 @@ elif [ "$cxx_type" = "clang" ]; then
115108
elif [ "$cxx_type" = "Apple" ]; then
116109
appleclang_ver=$($CXX -dumpversion)
117110
appleclang_ver=${appleclang_ver%%.*}
111+
# TODO: get include paths from compiler
118112
xcode_path="/Applications/Xcode_16.4.app"
119113
if [ ! -d "$xcode_path" ]; then
120114
xcode_path="/Applications/Xcode_15.2.app"

0 commit comments

Comments
 (0)