All of lore.kernel.org
 help / color / mirror / Atom feed
* configure host and target
@ 2006-05-26 19:04 Yoshinori K. Okuji
  2006-05-29 17:57 ` Thomas Schwinge
  2006-05-31  1:02 ` Yoshinori K. Okuji
  0 siblings, 2 replies; 5+ messages in thread
From: Yoshinori K. Okuji @ 2006-05-26 19:04 UTC (permalink / raw)
  To: The development of GRUB 2

According to a suggestion by an autoconf developer, I think we should change 
the build system in this way:

- Use "host" to represent an environment in which utilities (tools) run. This 
is a natural interpretation of the meaning of "host" in autoconf.

- Use "target" to represent a native environment in which the grub kernel and 
modules run. This is not very natural, but a bit easier to understand.

- Use CPPFLAGS, CFLAGS, LDFLAGS, etc. for the "host". This is more intuitive.

- Use TARGET_CPPFLAGS, TARGET_CFLAGS, etc. for the "target". Usually, the user 
does not need to tweak these flags manually, so they are not necessary to be 
very intuitive.

If there is no objection, I will work on this issue very soon.

Okuji



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configure host and target
  2006-05-26 19:04 configure host and target Yoshinori K. Okuji
@ 2006-05-29 17:57 ` Thomas Schwinge
  2006-05-31  1:02 ` Yoshinori K. Okuji
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Schwinge @ 2006-05-29 17:57 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, May 26, 2006 at 09:04:55PM +0200, Yoshinori K. Okuji wrote:
> According to a suggestion by an autoconf developer, I think we should change 
> the build system in this way:
> 
> [...]
> 
> If there is no objection, I will work on this issue very soon.

To give some feedback: I support this idea.


Regards,
 Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configure host and target
  2006-05-26 19:04 configure host and target Yoshinori K. Okuji
  2006-05-29 17:57 ` Thomas Schwinge
@ 2006-05-31  1:02 ` Yoshinori K. Okuji
  2006-05-31  8:59   ` Tomáš Ebenlendr
  1 sibling, 1 reply; 5+ messages in thread
From: Yoshinori K. Okuji @ 2006-05-31  1:02 UTC (permalink / raw)
  To: The development of GRUB 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 
affects:

- 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 
configure.

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.

- TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS 
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.

Okuji



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configure host and target
  2006-05-31  1:02 ` Yoshinori K. Okuji
@ 2006-05-31  8:59   ` Tomáš Ebenlendr
  2006-06-01 15:43     ` Yoshinori K. Okuji
  0 siblings, 1 reply; 5+ messages in thread
From: Tomáš Ebenlendr @ 2006-05-31  8:59 UTC (permalink / raw)
  To: The development of GRUB 2

So if I understand it correctly:
  Grub & modules (i.e., everything that is run w/o OS) is target.
  Grub-emu (i.e., everythhing that is run in some OS) is host.
  We don't have "make-tools" in c-code nor asm. (This is host in
some projects:
    tools that are first compiled and then used while compiling another
    parts)


On 31 Květen 2006, 3:02, Yoshinori K. Okuji napsal(a):
> 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
> affects:
>
> - 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
> configure.
>
> 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.
>
> - TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS, TARGET_ASFLAGS and
> TARGET_LDFLAGS
> 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.
>
> Okuji
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>


-- 
                                            Tomas 'Ebi' Ebenlendr
                                            http://get.to/ebik




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configure host and target
  2006-05-31  8:59   ` Tomáš Ebenlendr
@ 2006-06-01 15:43     ` Yoshinori K. Okuji
  0 siblings, 0 replies; 5+ messages in thread
From: Yoshinori K. Okuji @ 2006-06-01 15:43 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 31 May 2006 10:59, Tomáš Ebenlendr wrote:
> So if I understand it correctly:
>   Grub & modules (i.e., everything that is run w/o OS) is target.

Yes.

>   Grub-emu (i.e., everythhing that is run in some OS) is host.

Not really. grub-emu is a debugging tool, so, strictly speaking, it would be 
better to compile grub-emu with the build type...

>   We don't have "make-tools" in c-code nor asm. (This is host in
> some projects:
>     tools that are first compiled and then used while compiling another
>     parts)

They should use a build type instead of a host type, if any. GRUB does not 
have such a program any longer, as I have rewritten genmoddep with awk. IMO, 
it is not required in most cases to write this kind of programs in C these 
days, because scripting languages are good enough to assist build processes.

Okuji



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-01 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 19:04 configure host and target Yoshinori K. Okuji
2006-05-29 17:57 ` Thomas Schwinge
2006-05-31  1:02 ` Yoshinori K. Okuji
2006-05-31  8:59   ` Tomáš Ebenlendr
2006-06-01 15:43     ` Yoshinori K. Okuji

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.