CFG_DISABLE_JEMALLOC=1
fi
+# default gcc version under OpenBSD maybe too old, try using egcc, which is a
+# gcc version from ports
+if [ $CFG_OSTYPE = unknown-openbsd ]
+then
+ if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
+ step_msg "older GCC found, try with egcc instead"
+
+ # probe again but using egcc
+ probe CFG_GCC egcc
+
+ # and use egcc/eg++ for CC/CXX too if it was found
+ # (but user setting has priority)
+ if [ -n "$CFG_GCC" ]; then
+ CC="${CC:-egcc}"
+ CXX="${CXX:-eg++}"
+ fi
+ fi
+
+ step_msg "on OpenBSD, disabling jemalloc"
+ CFG_DISABLE_JEMALLOC=1
+fi
+
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
# system, so if we find that gcc is clang, we should just use clang directly.
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
LLVM_VERSION=$($LLVM_CONFIG --version)
case $LLVM_VERSION in
- (3.[5-7]*)
+ (3.[5-8]*)
msg "found ok version of LLVM: $LLVM_VERSION"
;;
(*)
esac
else
case $CFG_CLANG_VERSION in
- (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*)
+ (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8*)
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
;;
(*)
envopt CFLAGS
envopt CXXFLAGS
+# stdc++ name in use
+# used to manage non-standard name (on OpenBSD for example)
+program_transform_name=$($CFG_CC -v 2>&1 | sed -n "s/.*--program-transform-name='\([^']*\)'.*/\1/p")
+CFG_STDCPP_NAME=$(echo "stdc++" | sed "${program_transform_name}")
+putvar CFG_STDCPP_NAME
+
# a little post-processing of various config values
CFG_PREFIX=${CFG_PREFIX%/}
CFG_MANDIR=${CFG_MANDIR%/}
#
# Consequently here we try to detect when that happens and print an
# error if it does.
- if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/'
+ if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/' > /dev/null
then
- err "python is silently translating windows paths to MSYS paths \
- and the build will fail if this python is used.\n\n \
- Either an official python install must be used or an \
- alternative python package in MinGW must be used."
+ err "
+
+python is silently translating windows paths to MSYS paths \
+and the build will fail if this python is used.
+
+Either an official python install must be used or an \
+alternative python package in MinGW must be used.
+
+If you are building under msys2 try installing the mingw-w64-x86_64-python2 \
+package instead of python2:
+
+$ pacman -R python2 && pacman -S mingw-w64-x86_64-python2
+"
fi
# MSVC requires cmake because that's how we're going to build LLVM
probe_need CFG_CMAKE cmake
+ # There are three builds of cmake on windows: MSVC, MinGW and Cygwin
+ # The Cygwin build does not have generators for Visual Studio, so
+ # detect that here and error.
+ if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null
+ then
+ err "
+
+cmake does not support Visual Studio generators.
+
+This is likely due to it being an msys/cygwin build of cmake, \
+rather than the required windows version, built using MinGW \
+or Visual Studio.
+
+If you are building under msys2 try installing the mingw-w64-x86_64-cmake \
+package instead of cmake:
+
+$ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
+"
+ fi
+
# Use the REG program to figure out where VS is installed
# We need to figure out where cl.exe and link.exe are, so we do some
# munging and some probing here. We also look for the default
# INCLUDE and LIB variables for MSVC so we can set those in the
# build system as well.
- install=$(reg QUERY \
+ install=$(cmd //c reg QUERY \
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
-v InstallDir)
if [ -z "$install" ]; then
- install=$(reg QUERY \
+ install=$(cmd //c reg QUERY \
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
-v InstallDir)
fi
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""
vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
- include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
+ include_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !INCLUDE!)
need_ok "failed to learn about MSVC's INCLUDE"
- lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%")
+ lib_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !LIB!)
need_ok "failed to learn about MSVC's LIB"
eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\""