|
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>
|
|
From: Trent Piepho <xyzzy@speakeasy.org>
Since v4l-dvb now uses the kernel's config system, it needs certain kernel
binaries like qconf, mconf, and lxdialog to run the config targets. The
kernel's Makefile is not kind enough to give us a target to just build these
programs. What this patch does is introduce a new makefile,
Makefile.kernel, which includes the kernel's top-level Makefile. Then adds
some new "v4l-*" targets which just build the kernel config programs.
The main v4l Makefile is patched to add the necessary kernel conf programs
as dependencies to their respective config targets. Rules to build the
kernel conf programs are added which invoke a sub-make with the new
Makefile.kernel. These rules are only invoked when the kernel conf programs
needed don't yet exist. If they already exist, no write access to the
kernel source tree is needed.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
|