diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-03-13 13:33:51 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-03-13 13:33:51 -0800 |
commit | c563006a8ef69517b03c85f46020a9aefed98cda (patch) | |
tree | 88fbb9f73989010aa78d3198b908f756a58a2d64 | |
parent | 26c8cd2c73f838159e4d786756a34c814782f7fc (diff) | |
download | klibc-c563006a8ef69517b03c85f46020a9aefed98cda.tar.gz |
[klibc] Handle KLIBCKERNEL{SRC,OBJ} without final slashklibc-1.5.16
Don't require that KLIBCKERNEL{SRC,OBJ} end in a slash. On the other
hand, this means that those strings need to exist and be non-empty,
i.e. "." is okay, but not "".
Furthermore, default KLIBCKERNELOBJ to KLIBCKERNELSRC instead of
"linux".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | scripts/Kbuild.klibc | 10 | ||||
-rw-r--r-- | usr/include/Kbuild | 4 | ||||
-rw-r--r-- | usr/klibc/arch/ppc/MCONFIG | 2 | ||||
-rw-r--r-- | usr/klibc/arch/ppc64/MCONFIG | 2 | ||||
-rw-r--r-- | usr/klibc/arch/x86_64/MCONFIG | 2 |
6 files changed, 13 insertions, 11 deletions
diff --git a/Makefile b/Makefile index 83c5338655007..563618c7b1d58 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ export KLIBCSRC := usr/klibc export VERSION := $(shell cat $(srctree)/$(KLIBCSRC)/version) export KLIBCINC := usr/include export KLIBCOBJ := usr/klibc -export KLIBCKERNELSRC := linux/ -export KLIBCKERNELOBJ := linux/ +export KLIBCKERNELSRC ?= linux +export KLIBCKERNELOBJ ?= $(KLIBCKERNELSRC) export VPATH := $(srctree) diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index 32d49fa78b710..21e521f9e2487 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -76,7 +76,7 @@ KLIBCLDFLAGS := KLIBCCFLAGS := # Defaults for arch to override -KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)arch/$(KLIBCARCH)/include +KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/$(KLIBCARCH)/include # Arch specific definitions for klibc include $(srctree)/$(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG @@ -105,9 +105,11 @@ KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ -I$(KLIBCOBJ)/../include \ -I$(KLIBCINC) # kernel include paths -KLIBCKERNELSRC ?= $(srctree)/ -KLIBCCPPFLAGS += -I$(KLIBCKERNELSRC)include \ - $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)include2 -I$(KLIBCKERNELOBJ)include -I$(srctree)/include) \ +KLIBCKERNELSRC ?= $(srctree) +KLIBCKERNELOBJ ?= $(objtree) +KLIBCCPPFLAGS += -I$(KLIBCKERNELSRC)/include \ + $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)/include2 \ + -I$(KLIBCKERNELOBJ)/include -I$(srctree)/include) \ $(KLIBCARCHINCFLAGS) # klibc definitions diff --git a/usr/include/Kbuild b/usr/include/Kbuild index 3f20026a2b3e1..00327244c727f 100644 --- a/usr/include/Kbuild +++ b/usr/include/Kbuild @@ -2,10 +2,10 @@ always := asm $(obj)/asm: @echo ' SYMLINK $@ -> include/asm-$(KLIBCASMARCH)' - $(Q)if [ '$(KLIBCKERNELSRC).' -ef '$(obj)/../..' ]; then \ + $(Q)if [ '$(KLIBCKERNELSRC)/.' -ef '$(obj)/../..' ]; then \ ln -fsn ../../include/asm-$(KLIBCASMARCH) $@; \ else \ - ln -fsn $(KLIBCKERNELSRC)./include/asm-$(KLIBCASMARCH) $@; \ + ln -fsn $(KLIBCKERNELSRC)/include/asm-$(KLIBCASMARCH) $@; \ fi clean-files := asm diff --git a/usr/klibc/arch/ppc/MCONFIG b/usr/klibc/arch/ppc/MCONFIG index 5530f401b84c3..6630df7be4cab 100644 --- a/usr/klibc/arch/ppc/MCONFIG +++ b/usr/klibc/arch/ppc/MCONFIG @@ -23,7 +23,7 @@ KLIBCBITSIZE = 32 KLIBCSHAREDFLAGS = -Ttext 0x0f800200 # The kernel so far has both asm-ppc* and asm-powerpc. -KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)arch/powerpc/include +KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/powerpc/include # The asm include files live in asm-powerpc KLIBCASMARCH = powerpc diff --git a/usr/klibc/arch/ppc64/MCONFIG b/usr/klibc/arch/ppc64/MCONFIG index 32e02816247f2..cb666147f948b 100644 --- a/usr/klibc/arch/ppc64/MCONFIG +++ b/usr/klibc/arch/ppc64/MCONFIG @@ -20,7 +20,7 @@ KLIBCLDFLAGS = -m elf64ppc KLIBCSHAREDFLAGS = -Ttext 0x0f000200 # The kernel so far has both asm-ppc* and asm-powerpc. -KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)arch/powerpc/include +KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/powerpc/include # The asm include files live in asm-powerpc KLIBCASMARCH = powerpc diff --git a/usr/klibc/arch/x86_64/MCONFIG b/usr/klibc/arch/x86_64/MCONFIG index ff58a184a916b..7d5eea776ca7e 100644 --- a/usr/klibc/arch/x86_64/MCONFIG +++ b/usr/klibc/arch/x86_64/MCONFIG @@ -36,7 +36,7 @@ KLIBCLDFLAGS = -m elf_x86_64 KLIBCSHAREDFLAGS = -Ttext 0x00200200 -z max-page-size=0x100000 # Asm includes for x86_64 are in the merged x86 tree -KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)arch/x86/include +KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/x86/include # Additional asm- directories needed during installation ASMARCH = asm-i386 |