Skip to contentSkip to conversation

New build system for GRUB

DISCUSSION BVK Chaitanya 1 participant 2 messages Mar 31, 2010 – Jun 8, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

New automake based build system for GRUB is now available in branches/automake branch. Build system now has new dependency on GNU Automake and GNU Autogen. Autogen is used to convert a modules.def definitions file into an automake makefile (modules.am) which is included by Makefile.am

This modules.def definitions file is specially tailored to meet the needs of GRUB requirements. For example GRUB requirements includes,

1. Some module FOO should be built only on, say i386-pc, i386-qemu, i386-coreboot, but not on others.

This can be specified in modules.def file as,

module = {
name = FOO;
source = foo.c;
i386-pc;
i386-qemu;
i386-coreboot;
};

There are tags for each platform, and we can have tags for groups of platforms, like i386 to mean i386-*, x86 to mean i386-* and x86_64-*, etc.

2. Some module BAR should be built with files efi/xyz.c efi/bar.c when built for x86 efi platforms, ieee1275/bar.c for sparc-ieee275, and bar.c for the rest of platforms.

This can be specified in modules.def file as,

module = {
name = BAR;
source = bar.c;

  x86-efi = efi/bar.c;
  x86-efi = efi/xyz.c;

  sparc-ieee1275 = ieee1275/bar.c;

common;
};

Notice that tags can be used not just to enable the module for a platform, but also to list the source files too, if necessary. For platforms that are enabled without explicit sources (in the example, common tag enables all platforms), sources listed under "source" name will be used.

Note that we can have multiple source files embedded in quotes on single line.

3. Different flags are for different builds.

This is achieved as:

module = {
name = BAZ;
source = baz.c;

  cppflags = -Iincludedir;

i386_cppflags = -Ii386_includes;
};

I believe this is self explanatory.

Though I started for above goals in mind, I ended up extending it for other GRUB components also (i.e, .img files, scripts, programs, libraries, test scripts and test programs, man pages). Please go through modules.am and grub-core/modules.am files for the examples.

This GNU Autogen definitions is processed with a template file, Makefile.tpl generated by gentpl.rb script. Let me know your comments.

thanks,

Signature · 1 line
bvk.chaitanya

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

It seems my mail couldn't be delivered due to patch size. Please look at branches/bvk/automake for this patch.

Quoted 16 lines · BVK Chaitanya

Hi

Attached is the patch for autogen+automake based build system for GRUB.  It is building successfully on freebsd, cygwin and netbsd platforms, but I did not test it for booting yet.  If you have time, please test it for booting on respective platforms and let me know your comments.

Its been pushed into branches/bvk/automake too.

thanks,
--
bvk.chaitanya

Signature · 1 line
bvk.chaitanya