Commit d80e2246 authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Don't fail if include/asm symlink exists

From: Andreas Gruenbacher <agruen@suse.de>

We're having the following situation: There are user-space applications
that include kernel headers directly. With a completely unconfigured
/usr/src/linux tree, including most headers fails because essential
files are not there:

	include/asm
	include/linux/autoconf.h
	include/linux/version.h

So we create these files. On the other hand, we want to use
/usr/src/linux as read-only source for building kernels or additional
modules. Now when building a kernel with a separate output directory
(O=), there is a check in the main makefile for the include/asm symlink.
There is no real need for this check: if we ensure that
$(objdir)/include/asm is always created as the patch does,
$(srctree)/include/asm becomes irrelevant.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent c5f75eca
...@@ -767,7 +767,7 @@ $(vmlinux-dirs): prepare-all scripts ...@@ -767,7 +767,7 @@ $(vmlinux-dirs): prepare-all scripts
prepare2: prepare2:
ifneq ($(KBUILD_SRC),) ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel' @echo ' Using $(srctree) as source for kernel'
$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ $(Q)if [ -f $(srctree)/.config ]; then \
echo " $(srctree) is not clean, please run 'make mrproper'";\ echo " $(srctree) is not clean, please run 'make mrproper'";\
echo " in the '$(srctree)' directory.";\ echo " in the '$(srctree)' directory.";\
/bin/false; \ /bin/false; \
...@@ -779,7 +779,8 @@ endif ...@@ -779,7 +779,8 @@ endif
# prepare1 creates a makefile if using a separate output directory # prepare1 creates a makefile if using a separate output directory
prepare1: prepare2 outputmakefile prepare1: prepare2 outputmakefile
prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER prepare0: prepare1 include/linux/version.h $(objtree)/include/asm \
include/config/MARKER
ifneq ($(KBUILD_MODULES),) ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR) $(Q)rm -rf $(MODVERDIR)
$(Q)mkdir -p $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR)
...@@ -818,7 +819,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) ...@@ -818,7 +819,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
# hard to detect, but I suppose "make mrproper" is a good idea # hard to detect, but I suppose "make mrproper" is a good idea
# before switching between archs anyway. # before switching between archs anyway.
include/asm: $(objtree)/include/asm:
@echo ' SYMLINK $@ -> include/asm-$(ARCH)' @echo ' SYMLINK $@ -> include/asm-$(ARCH)'
$(Q)if [ ! -d include ]; then mkdir -p include; fi; $(Q)if [ ! -d include ]; then mkdir -p include; fi;
@ln -fsn asm-$(ARCH) $@ @ln -fsn asm-$(ARCH) $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment