Re: [PATCH] kconfig CROSS_COMPILE option

From: Pavel Machek
Date: Mon Sep 07 2009 - 09:09:22 EST


Hi!

> This adds CROSS_COMPILE as a kconfig string so you can store it in .config.
> Then you can use plain "make" in the configured kernel build directory to
> do the right cross compilation without setting the command-line or
> environment variable every time.
>
> With this, you can set up different build directories for different kernel
> configurations, whether native or cross-builds, and then use the simple:
> make -C /build/dir M=module-source-dir
> idiom to build modules for any given target kernel, indicating which one
> by nothing but the build directory chosen.
>
> I tried a version that defaults the string with env="CROSS_COMPILE" so that
> in a "make oldconfig" with CROSS_COMPILE in the environment you can just
> hit return to store the way you're building it. But the kconfig prompt for
> strings doesn't give you any way to say you want an empty string instead of
> the default, so I punted that.

Yes that would be very nice. Editing Makefile every time I
crosscomppile for arm sucks.

But... do we need an option for subarch, too? And will Kconfig system
handle that?
Pavel

> # Alternatively CROSS_COMPILE can be set in the environment.
> +# A third alternative is to store a setting in .config so that plain
> +# "make" in the configured kernel build directory always uses that.
> # Default value for CROSS_COMPILE is not to prefix executables
> # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
> export KBUILD_BUILDHOST := $(SUBARCH)
> ARCH ?= $(SUBARCH)
> -CROSS_COMPILE ?=
> +CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
>
> # Architecture as present in compile.h
> UTS_MACHINE := $(ARCH)
> diff --git a/init/Kconfig b/init/Kconfig
> index 3f7e609..452080d 100644

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/