mac os 源码编译gcc10

../configure --build=x86_64-apple-darwin18 --prefix=/usr/local/Cellar/gcc/10.0.0 --libdir=/usr/local/Cellar/gcc/10.0.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++ --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.0.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

创建build后使用上面配置

这个配置来源brew install gcc9.3 

 

vim ~/.bash_profile   设置环境变量

export PATH="/usr/local/Cellar/gcc/10.0.0/bin:$PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Cellar/gcc/10.0.0/lib/gcc/10

 

你可能感兴趣的:(c++)