From mboxrd@z Thu Jan 1 00:00:00 1970 From: TJ Subject: [PATCH] Fix userspace kernel/Makefile header-sync target build failures Date: Thu, 04 Sep 2008 01:20:44 +0100 Message-ID: <1220487645.12107.13.camel@hephaestion> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit To: kvm Return-path: Received: from tjworld.net ([67.18.187.6]:57858 "EHLO tjworld.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751760AbYIDAUs (ORCPT ); Wed, 3 Sep 2008 20:20:48 -0400 Received: from [10.254.252.6] (hephaestion.lan.tjworld.net [10.254.252.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tjworld.net (Postfix) with ESMTP id 29ED618169 for ; Thu, 4 Sep 2008 01:20:47 +0100 (BST) Sender: kvm-owner@vger.kernel.org List-ID: This patch fixes problems using the kernel/Makefile header-sync target. 1. If unifdef modifies a header file it returns 1, which caused make to exit, thinking it was an error. 2. Allow rsync to de-reference symbolic links when syncing the include headers. This supports both distro-specific header aliases (e.g. Ubuntu) and developer working-directory structures. It allows, for example: ./configure --prefix=/usr --with-patched-kernel make LINUX=../../kvm to build in userspace repository using headers from sibling directory containing the kvm repository: dev/kvm/.git dev/userspace/.git Signed-off-by: TJ --- kernel/Makefile | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 3f5f6da..b10259e 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -23,7 +23,7 @@ _hack = mv $1 $1.orig && \ | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig unifdef = mv $1 $1.orig && \ - unifdef -DCONFIG_$(ARCH_CONFIG) $1.orig > $1; \ + unifdef -DCONFIG_$(ARCH_CONFIG) $1.orig > $1 && true; \ [ $$? -le 1 ] && rm $1.orig hack = $(call _hack,$T/$(strip $1)) @@ -52,15 +52,15 @@ T = $(subst -sync,,$@)-tmp header-sync: rm -rf $T - rsync -R \ + rsync -LR \ "$(LINUX)"/./include/linux/kvm*.h \ "$(LINUX)"/./include/asm-*/kvm*.h \ $T/ - -rsync -R \ + -rsync -LR \ "$(LINUX)"/arch/$(ARCH_DIR)/include/asm/./kvm*.h \ $T/include/asm-$(ARCH_DIR)/ - set -e && for i in $(find $T -name '*.h'); do \ + set -e && for i in $$(find $T -name '*.h'); do \ $(call unifdef,$$i); done $(call hack, include/linux/kvm.h) set -e && for i in $$(find $T -type f -printf '%P '); \ @@ -69,12 +69,12 @@ header-sync: source-sync: rm -rf $T - rsync --exclude='*.mod.c' -R \ + rsync --exclude='*.mod.c' -LR \ "$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[cSh] \ "$(LINUX)"/virt/kvm/./*.[cSh] \ $T/ - set -e && for i in $(find $T -name '*.c'); do \ + set -e && for i in $$(find $T -name '*.c'); do \ $(call unifdef,$$i); done for i in $(hack-files); \ -- 1.5.4.3