简体   繁体   中英

how to install gcc on mac using command line?

I need to install the gcc suite on an OS/X box using the command line. As far as I can tell, the only way to do this is to install Xcode, which appears to only have a GUI install. Surely, this can be done.

You can install any package using command line with installer - the GUI is merely a convenience, you don't need to use it. For example

sudo install -pkg Xcode.mpkg -target /

You can also pick individual packages from the Xcode installation if you wish, for example Packages/llvm-gcc4.2.pkg contains just the compiler.

I believe you are looking for this:

http://solarianprogrammer.com/2011/09/20/compiling-gcc-4-6-1-on-mac-osx-lion/

Mind you this is compiling the latest from source.

您可以从以下网址下载预构建的二进制文件: https : //github.com/kennethreitz/osx-gcc-installer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM