[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure host and target

From: Yoshinori K. Okuji
Subject: Re: configure host and target
Date: Wed, 31 May 2006 03:02:20 +0200
User-agent: KMail/1.8.2

I describe the new build system a bit here. Maybe this should be written in 
somewhere else (such as INSTALL) as well...

GRUB uses "target" and "host". "build" is not explicitly used. A target 
represents a native environment where GRUB runs. In reality, the target type 

- the cpu type

- the executable format (for now, must be ELF)

The vendor and the operating system in a target type does not really matter, 
except for the choice of programs and supported executable formats, because 
you should specify a platform (such as firmware) by --with-platform to 

A host type specifies an environment where utilities are executed. Unless you 
are cross-compiling GRUB, you do not have to care very much.

The usage of compiler flags is the following:

- CC, CFLAGS, CPPFLAGS, ASFLAGS and LDFLAGS are used for the host type.

- If you need to specify non-standard locations for header files or libraries, 
you should specify CPPFLAGS or LDFLAGS.

- If you cross-compile GRUB, you can set CC explicitly, but optionally.

- You do not need to struggle with CFLAGS or ASFLAGS. This is required only if 
you intend to debug GRUB, or you want to optimize GRUB differently for an 
unknown reason.

are used for the target type.

- You might need to specify TARGET_CC explicitly, if you cross-compile GRUB.

- You should not touch other TARGET_* variables, unless you understand what 
you are doing.

Besides these flags, GRUB uses target-specific flags (here, "target" means a 
Makefile target, but not a target type in autoconf). This allows us to apply 
flags specific to each object. This design is based on automake, since the 
makefile generator in GRUB was influenced by automake significantly.

For example, when compiling normal.mod, normal_mod_CFLAGS, normal_mod_LDFLAGS, 
etc. are applied as well as TARGET_CFLAGS, TARGET_LDFLAGS, etc. This part is 
important only for developers, as the user is not supposed to tweak these 
target-specific flags manually.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]