[Fix] nvm should respect CC/CXX env var
- Also set CC for Freebsd, not only CXX
- Also set CC=cc, CXX=c++ on Mac OS by default as upstream
Reference:
1bd871655a/configure (L16-L17)
parent
84575cf353
commit
45771499ee
21
nvm.sh
21
nvm.sh
|
@ -1853,15 +1853,24 @@ nvm_install_source() {
|
||||||
|
|
||||||
local make
|
local make
|
||||||
make='make'
|
make='make'
|
||||||
if [ "${NVM_OS}" = 'freebsd' ]; then
|
local MAKE_CXX
|
||||||
|
case "${NVM_OS}" in
|
||||||
|
'freebsd')
|
||||||
make='gmake'
|
make='gmake'
|
||||||
MAKE_CXX='CXX=c++'
|
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
|
||||||
elif [ "${NVM_OS}" = 'aix' ]; then
|
;;
|
||||||
|
'darwin')
|
||||||
|
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
|
||||||
|
;;
|
||||||
|
'aix')
|
||||||
make='gmake'
|
make='gmake'
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to nvm_clang_version 3.5; then
|
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to nvm_clang_version 3.5; then
|
||||||
nvm_echo "Clang v3.5+ detected! Use Clang as c/c++ compiler!"
|
if [ -z "${CC-}" ] || [ -z "${CXX-}" ] ; then
|
||||||
MAKE_CXX='CC=clang CXX=clang++'
|
nvm_echo "Clang v3.5+ detected! CC or CXX not specified, will use Clang as c/c++ compiler!"
|
||||||
|
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local tar_compression_flag
|
local tar_compression_flag
|
||||||
|
|
Loading…
Reference in New Issue