grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] framework for building modules externally


From: Robert Millan
Subject: Re: [PATCH] framework for building modules externally
Date: Sat, 1 Nov 2008 20:02:04 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Nov 01, 2008 at 01:32:29PM +0100, Robert Millan wrote:
> 
> Hi,
> 
> Attached patch makes it possible to build modules externally, by:
> 
>   - Installing headers in system include dir.
> 
>   - Exporting two ABI tags (a build-time macro and a run-time variable)
>     for run-time comparison.
> 
>   - Exporting a makefile with COMMON_*FLAGS variables.

Looks like I missed some important details.  The headers and some macros are
not enough, as we need to reproduce part of the build system to build a module
externally.  This new patch provides the following:

  In pkgdata:   genmodsrc.sh genmk.rb
  In pkglib:    config.h grub_script.tab.h build_env.mk
  In includedir:        header files

How to use:

cat > Makefile.in << EOF
srcdir = /usr/share/grub
builddir = /usr/lib/grub/i386-pc
include $(builddir)/build_env.mk

pkglib_MODULES += mymod.mod
mymod_mod_SOURCES = mymod.c
mymod_mod_CFLAGS = $(COMMON_CFLAGS)
mymod_mod_LDFLAGS = $(COMMON_LDFLAGS)
EOF
ruby /usr/share/grub/genmk.rb < Makefile.in > Makefile
make

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

Attachment: external_modules.diff
Description: Text Data


reply via email to

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