Patchwork [v3,28/29] configure: ensure directory exists when creating symlink

login
register
mail settings
Submitter Paolo Bonzini
Date June 7, 2012, 7:40 a.m.
Message ID <1339054814-20939-29-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/163511/
State New
Headers show

Comments

Paolo Bonzini - June 7, 2012, 7:40 a.m.
From: Anthony Liguori <aliguori@us.ibm.com>

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 configure |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Andreas Färber - June 12, 2012, 6:44 p.m.
Am 07.06.2012 09:40, schrieb Paolo Bonzini:
> From: Anthony Liguori <aliguori@us.ibm.com>
> 
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
>  configure |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index cd5e8b3..cbcbcb1 100755
> --- a/configure
> +++ b/configure
[...]
>  # use included Linux headers
>  if test "$linux" = "yes" ; then
> -  mkdir -p linux-headers
>    case "$cpu" in
>    i386|x86_64)
>      symlink "$source_path/linux-headers/asm-x86" linux-headers/asm

This change broke the out-of-tree build on Linux platforms where no
headers are being symlinked, such as Linux/arm:

Makefile.target adds -I../linux-headers irrespective of the
architecture, leading to a file or directory not found error.

If no one beats me to it, I'll send a patch reverting this line tomorrow.

Andreas

Patch

diff --git a/configure b/configure
index cd5e8b3..cbcbcb1 100755
--- a/configure
+++ b/configure
@@ -42,6 +42,7 @@  compile_prog() {
 # symbolically link $1 to $2.  Portable version of "ln -sf".
 symlink() {
   rm -rf "$2"
+  mkdir -p "$(dirname "$2")"
   ln -s "$1" "$2"
 }
 
@@ -3454,14 +3455,12 @@  if test -f ${config_host_ld}~ ; then
 fi
 
 for d in libdis libdis-user; do
-    mkdir -p $d
     symlink "$source_path/Makefile.dis" "$d/Makefile"
     echo > $d/config.mak
 done
 
 # use included Linux headers
 if test "$linux" = "yes" ; then
-  mkdir -p linux-headers
   case "$cpu" in
   i386|x86_64)
     symlink "$source_path/linux-headers/asm-x86" linux-headers/asm