Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a "light" build of GCC with language supports etc. pruned?

Tags:

Basically I would like to make a light build of GCC with only C/C++ support. Can this be done easily or does it require manual tinkering with source?

like image 874
manabreak Avatar asked Feb 06 '13 12:02

manabreak


People also ask

What languages are supported by GCC?

GCC stands for “GNU Compiler Collection”. GCC is an integrated distribution of compilers for several major programming languages. These languages currently include C, C++, Objective-C, Objective-C++, Fortran, Ada, D, and Go. The abbreviation GCC has multiple meanings in common use.

Is GCC written in assembly?

Note however, that GCC was always written in C. It just was compiled with other compilers.

Is GCC a IDE?

NetBeans, Eclipse, Microsoft Visual Studio and Code Blocks are some examples for IDEs. GNU GCC is an example for a compiler.


1 Answers

This is covered in Installing GCC and 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.

So, for your case using:

../gcc/configure --enable-languages=c,c++ 

should be sufficient, besides other needed options, of course.

See also Building

Please note, that re-defining LANGUAGES when calling `make' does not work anymore!

like image 121
Olaf Dietsche Avatar answered Sep 23 '22 03:09

Olaf Dietsche