diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-10-10 21:12:01 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-10-10 21:12:01 -0700 |
commit | f5d374cc9de6fb9662b36c3e9af48c6abb6be743 (patch) | |
tree | 7e5591ee90489b1cc0f7f0f966d878bcfc99e3b3 /v4l/scripts | |
parent | 30237df1702f85366f07cef0b1041255e296fd28 (diff) | |
download | mediapointer-dvb-s2-f5d374cc9de6fb9662b36c3e9af48c6abb6be743.tar.gz mediapointer-dvb-s2-f5d374cc9de6fb9662b36c3e9af48c6abb6be743.tar.bz2 |
build: Handle kernel output directories correctly
From: Trent Piepho <xyzzy@speakeasy.org>
Recent patches to try to handle kernel object file directories haven't been
doing it correctly. This patch reworks the way the kernel location(s) are
handled.
KDIR et al are removed and replaced with two variables, SRCDIR and OUTDIR.
SRCDIR is the location of:
The main kernel Makefile
The kernel headers
The kernel source (if present)
OUTDIR is the location of:
The kernel .config file
The kernel [qxm]conf binaries (if present)
The following kernel situations should be handled correctly:
1. A kernel installed from source. One can specify the version via "make
release VER=version". If VER is not specified, uname -r is used. This the
default if make is run on a clean tree. OUTDIR is /lib/modules/$(VER)/build
and SRCDIR is /lib/modules/$(VER)/source, which are both symlinks pointing to
the same location.
2. A kernel installed from source which was was built with the
"O=/output/directory" option to the kernel Makefile. The version is specified
the same was as above. OUTDIR and SRCDIR are the same as above, except in
this case they are symlinks to different directories. OUTDIR will be a link
the the directory used in the "O=" option and SRCDIR will be the source
location.
3. An installed binary kernel with only a kernel-headers package. The
version can be specified the same way as above. OUTDIR will be
/lib/modules/$(VER)/build and SRCDIR will be the same as OUTDIR, as no
'source' directory exists. The kernel source and Kconfig program are most
likely not present.
4. An un-installed kernel source tree, for a kernel that was built without
using the "O=/outdir/directory" option. The kernel does not need to be fully
built, only the "modules_prepare" target needs to be built. The location of
the tree is specified with "make release DIR=directory". Both SRCDIR and
OUTDIR will be $(DIR).
5. An un-installed kernel source tree, for a kernel that was built using the
"O=/output/directory" option. The location of the tree is specified using
"make release DIR=/output/directory". Note that DIR is not the directory with
the kernel source! It is set to the directory that was used with the O option
when the kernel was built. The Makefile in this directory has a link back to
the kernel source directory and the v4l-dvb build system will find this.
OUTDIR will be the '/output/directory' and SRCDIR will be the location of the
source that built it.
All all these situation the v4l-dvb tree should build correctly and all the
various scripts will work. In addition, if the binaries for the [qxm]conf
programs are present, "make menuconfig", etc. will work as well. If the
binaries are not present, but the source is, the Makefile will automatically
build the binaries when "make menuconfig", etc. is used. The source should
be present in all situation except (3), a kernel-headers only install.
Note that if the kernel output directory (usually the same as the kernel
source directory, except for (2) and (5)) is not writable, then building the
Kconfig programs automatically will not be possible.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 7cb258d86..e228d38b4 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -14,6 +14,7 @@ my %depmods = (); my ($version, $level, $sublevel, $kernver); my $kernel = shift; +my $kernsrc = shift; my $force_kconfig = shift; my $debug=0; @@ -542,7 +543,7 @@ disable_config('DVB_FE_CUSTOMISE'); disable_config('VIDEO_HELPER_CHIPS_AUTO'); # ACI needs some kernel includes that might not be there -disable_config('SOUND_ACI_MIXER') if (! -e "$kernel/sound/oss/sound_config.h"); +disable_config('SOUND_ACI_MIXER') if (! -e "$kernsrc/sound/oss/sound_config.h"); # Check dependencies my %newconfig = checkdeps(); @@ -595,7 +596,7 @@ if ($force_kconfig==1 || !-e '.config') { # Check for full kernel sources and print a warning sub kernelcheck() { - my $fullkernel="$kernel/fs/fcntl.c"; + my $fullkernel="$kernsrc/fs/fcntl.c"; if (! -e $fullkernel) { print <<"EOF2"; |