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

标签 c++ gcc build

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

相关文章:

c++ - 是否有使用运算符<<打印元组和对的合法方法?

c - '-c' 选项在 GCC 中有什么作用?

c++ - 构建 C++ 项目的正确方法是什么?使/IDE/ Ant ...?

regex - 将目录内容打印到文件的 ant 任务

c++ - unordered_map 和虚拟模板

c++ - 证明两点法有效(对和)

c++ - 难以理解c++多态性

C: 未定义的楼层引用

c++ - 从程序集中访问类方法

jenkins - 为 12 因子应用程序存储配置的过程是什么?