From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18035 invoked by alias); 25 Apr 2008 07:05:50 -0000 Received: (qmail 18003 invoked by uid 9702); 25 Apr 2008 07:05:49 -0000 Date: Fri, 25 Apr 2008 07:05:00 -0000 Message-ID: <20080425070549.17988.qmail@sourceware.org> From: fabbione@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, STABLE2, updated. cluster-2.03.01-14-g523acee X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: c58f0a46f6b06b0cf0b09dad2c3114fe5742a489 X-Git-Newrev: 523acee2a3aa7340acc04a28e43164f090b615df Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00185.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=523acee2a3aa7340acc04a28e43164f090b615df The branch, STABLE2 has been updated via 523acee2a3aa7340acc04a28e43164f090b615df (commit) from c58f0a46f6b06b0cf0b09dad2c3114fe5742a489 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 523acee2a3aa7340acc04a28e43164f090b615df Author: Fabio M. Di Nitto Date: Fri Apr 25 09:01:14 2008 +0200 [BUILD] Fix kernel check for good Use the top level Makefile of the source tree rather than random includes that keeps changing. Signed-off-by: Fabio M. Di Nitto ----------------------------------------------------------------------- Summary of changes: configure | 55 +++++++++++++++++-------------------------------------- 1 files changed, 17 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 2501059..9160e10 100755 --- a/configure +++ b/configure @@ -236,64 +236,43 @@ if ($help || !$err) { } sub kernel_version { - my $autoconf_path = shift; + my $makefile_path = shift; my $required_version = shift; - my $build_version = 0; - my $build_patchlevel = 0; - my $build_sublevel = 0; print "\nChecking kernel:\n"; # add autoconf to the path - $autoconf_path .= '/include/linux/autoconf.h'; + $makefile_path .= '/Makefile'; my @version = split /\./, $required_version; - my $current_version = 0; - if ( -f $autoconf_path ) { - # open the autoconf.h to feth VERSION, PATCHLEVEL and SUBLEVEL, if needed I can add EXTRAVERSION too - open AUTOCONF, '<', $autoconf_path; - while () { - if ($_ =~ /CONFIG_KERNELVERSION/) { - $current_version = $_; - # we don't need to check any thing else in this file so we are stopping the read - last; - } + if ( -f $makefile_path ) { + # open the toplevel Makefile to feth VERSION, PATCHLEVEL and SUBLEVEL + open MAKEFILE, '<', $makefile_path; + while () { + $build_version = $1 if /^VERSION = (\d+)/; + $build_patchlevel = $1 if /^PATCHLEVEL = (\d+)/; + $build_sublevel = $1 if /^SUBLEVEL = (\d+)/; + last if (defined $build_version && defined $build_patchlevel && defined $build_sublevel); } - close AUTOCONF; - # Warn and continue if CONFIG_KERNELVERSION was not found - if (!$current_version) { + close MAKEFILE; + # Warn and continue if kernel version was not found + if (!$build_version || !$build_patchlevel || !$build_sublevel) { print " WARNING: Could not determine kernel version.\n"; + print " Build might fail!\n"; return 1; } - # leaving only the numbers from the lines - # this is faster then split and doesn't alocate useless arrays - $current_version =~ s/.*"(.*)"\n/$1/; - # parse the kernel version into the variables - if ($current_version =~ /\-/) { - my @line = split /\-/, $current_version; - my @ver = split /\./, $line[0]; - $build_version = $ver[0]; - $build_patchlevel = $ver[1]; - $build_sublevel = $ver[2]; - } else { - my @kernel = split /\./, $current_version; - $build_version = $kernel[0]; - $build_patchlevel = $kernel[1]; - $build_sublevel = $kernel[2]; - } # checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel - # if needed I can add also EXTRAVERSION to the check if ($build_version >= $version[0] && $build_patchlevel >= $version[1] && $build_sublevel >= $version[2]) { print " Current kernel version appears to be OK\n"; return 1; } else { - print " Current kernel version: ",$current_version,"\n Minimum kernel version: ",$required_version,"\n"; + print " Current kernel version: ",$build_version, "." , $build_patchlevel, ".", $build_sublevel, "\n Minimum kernel version: ",$required_version,"\n"; print " FAILED!\n"; return 0; } } else { - print " Unable to find ($autoconf_path)!\n"; + print " Unable to find ($makefile_path)!\n"; print " Make sure that:\n - the above path is correct\n"; print " - your kernel is properly configured and prepared.\n"; print " - kernel_build and kernel_src options to configure are set properly.\n"; @@ -385,7 +364,7 @@ if (!$kernel_src) { $kernel_src=$kernel_build; } } -if (not $disable_kernel_check and !kernel_version($kernel_build,$required_kernelversion)) { +if (not $disable_kernel_check and !kernel_version($kernel_src,$required_kernelversion)) { exit 1; } if (!$module_dir) { hooks/post-receive -- Cluster Project