基本上,我想制作一个仅支持 C/C++ 的轻型 GCC。这可以轻松完成还是需要手动修改源代码?
最佳答案
这在 Installing GCC 中有介绍和 Configuration
--enable-languages=lang1,lang2,...
Specify that only a particular subset of compilers and their runtime libraries should be built. For a list of valid values for langN you can issue the following command in the gcc directory of your GCC source tree:grep language= */config-lang.in
Currently, you can use any of the following: all, ada, c, c++, fortran, go, java, objc, obj-c++. Building the Ada compiler has special requirements, see below. If you do not pass this flag, or specify the option all, then all default languages available in the gcc sub-tree will be configured. Ada, Go and Objective-C++ are not default languages; the rest are.
因此,对于您的情况,使用:
../gcc/configure --enable-languages=c,c++
应该足够了,当然除了其他需要的选项。
另见 Building
Please note, that re-defining LANGUAGES when calling `make' does not work anymore!
关于c++ - 如何使用语言支持等进行 "light"构建的 GCC 修剪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14728652/