Patchwork [v3,07/24] system: [linux] Use absolute include path for linux-headers

login
register
mail settings
Submitter Lluís Vilanova
Date April 21, 2013, 7:12 p.m.
Message ID <20130421191209.8947.17224.stgit@fimbulvetr.bsc.es>
Download mbox | patch
Permalink /patch/238237/
State New
Headers show

Comments

Lluís Vilanova - April 21, 2013, 7:12 p.m.
Lets the include directive work regardless of the current directory.

This is needed for code compiled in directories deeper than one level from the
build root.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile.target |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Paolo Bonzini - April 26, 2013, 3:17 p.m.
Il 21/04/2013 21:12, Lluís Vilanova ha scritto:
> Lets the include directive work regardless of the current directory.
> 
> This is needed for code compiled in directories deeper than one level from the
> build root.
> 
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
>  Makefile.target |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile.target b/Makefile.target
> index f382559..2f9675a 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -7,7 +7,7 @@ include $(SRC_PATH)/rules.mak
>  
>  $(call set-vpath, $(SRC_PATH))
>  ifdef CONFIG_LINUX
> -QEMU_CFLAGS += -I../linux-headers
> +QEMU_CFLAGS += -I$(BUILD_DIR)/linux-headers
>  endif
>  QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H

I am not sure why this is needed.  The .. here is the path from
foo-softmmu/ to the build root.  QEMU's build system is only one-level
recursive, something like foo-softmmu/hw/virtio/virtio.c is compiled
from foo-softmmu/ (whose Makefile is Makefile.target) and thus the path
needs to be relative from foo-softmmu/.  It need not be relative to
foo-softmmu/hw/virtio.

Paolo

Patch

diff --git a/Makefile.target b/Makefile.target
index f382559..2f9675a 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -7,7 +7,7 @@  include $(SRC_PATH)/rules.mak
 
 $(call set-vpath, $(SRC_PATH))
 ifdef CONFIG_LINUX
-QEMU_CFLAGS += -I../linux-headers
+QEMU_CFLAGS += -I$(BUILD_DIR)/linux-headers
 endif
 QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H