Skip to content

Commit 90043cb

Browse files
committed
openbsd: probe CFG_GCC egcc
if default CFG_GCC is too old, probe also egcc (which is gcc from ports). set CC/CXX too, in order to pass them to LLVM
1 parent e3fd444 commit 90043cb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

configure

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,25 @@ then
885885
CFG_DISABLE_JEMALLOC=1
886886
fi
887887

888+
# default gcc version under OpenBSD maybe too old, try using egcc, which is a
889+
# gcc version from ports
890+
if [ $CFG_OSTYPE = unknown-openbsd ]
891+
then
892+
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
893+
step_msg "older GCC found, try with egcc instead"
894+
895+
# probe again but using egcc
896+
probe CFG_GCC egcc
897+
898+
# and use egcc/eg++ for CC/CXX too if it was found
899+
# (but user setting has priority)
900+
if [ -n "$CFG_GCC" ]; then
901+
CC="${CC:-egcc}"
902+
CXX="${CXX:-eg++}"
903+
fi
904+
fi
905+
fi
906+
888907
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
889908
# system, so if we find that gcc is clang, we should just use clang directly.
890909
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]

0 commit comments

Comments
 (0)