c++ - 如何使用语言支持等进行 "light"构建的 GCC 修剪?

基本上,我想制作一个仅支持 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/

相关文章:

visual-studio-2010 - 错误 MSB6006 : "cmd.exe" exited

java - ANT_HOME 设置不正确或 ant 无法定位

visual-studio-2010 - Visual Studio 未知生成错误。完全限定名称必须

xcode - "Run Script"在构建阶段需要什么权限?

plugins - 如何将作业放入 Jenkins 的 Throttle Concurrent Bu

testing - Maven:在生命周期中跳过测试编译?

javascript - 与 webpack/browserify 捆绑时如何排除代码路径?

java - Maven 构建编译错误 : Failed to execute goal org.

c++ - 如何使用 MinGW 构建 Boost 1.55?

git - 如何动态选择要在 Jenkins 构建中使用的 git 分支