From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Becker Date: Thu, 27 Sep 2007 15:33:36 -0700 Subject: [Cluster-devel] Re: Fix for configure and kernel trees In-Reply-To: <20070927223021.GC25233@tasint.org> References: <20070927223021.GC25233@tasint.org> Message-ID: <20070927223336.GD25233@tasint.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Sep 27, 2007 at 03:30:21PM -0700, Joel Becker wrote: > configure: Backticks don't work in strings. Use POSIX::uname(). > > The strings that use backticks to get `uname -r` don't work as expected. > Let's use POSIX::uname() directly and let perl do the work. [Resend, the first patch had a debug printf left in it] Index: configure =================================================================== RCS file: /cvs/cluster/cluster/configure,v retrieving revision 1.34 diff -u -u -r1.34 configure --- configure 24 Sep 2007 14:43:13 -0000 1.34 +++ configure 27 Sep 2007 22:32:16 -0000 @@ -14,6 +14,7 @@ ############################################################################### use Getopt::Long; +use POSIX qw(uname); print "\nConfiguring Makefiles for your system...\n"; @@ -228,22 +229,24 @@ if (!$prefix) { $prefix="/usr"; } + +my @un = POSIX::uname(); if (!$kernel_build) { - if (-d "/lib/modules/`uname -r`/build") { - $kernel_build="/lib/modules/`uname -r`/build"; + if (-d "/lib/modules/$un[2]/build") { + $kernel_build="/lib/modules/$un[2]/build"; } else { $kernel_build="/usr/src/linux"; } } if (!$kernel_src) { - if (-d "/lib/modules/`uname -r`/source") { - $kernel_src="/lib/modules/`uname -r`/source"; + if (-d "/lib/modules/$un[2]/source") { + $kernel_src="/lib/modules/$un[2]/source"; } else { $kernel_src=$kernel_build; } } if (!$module_dir) { - $module_dir="/lib/modules/`uname -r`/kernel"; + $module_dir="/lib/modules/$un[2]/kernel"; } if (!$gfskincdir) { $gfskincdir="${pwd}/gfs-kernel/src/gfs"; -- Life's Little Instruction Book #267 "Lie on your back and look at the stars." Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127