From c88200172e0de06df30d4466f6c9de43a318b7ac Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 23 Feb 2010 12:32:57 +0100 Subject: [PATCH] Bug #51414: Arguments with embedded spaces are not correctly handled by configure wrapper. The bug was that ./configure was passing paramers to subscripts as $@, and to handle embedded spaces it needs to be quoted as "$@". This resulting into a bug when ./configure was called e.g with CFLAGS='-m64 -Xstrconst'.. Additionally, fixed cmake/configure.pl did not handle environment variables passed on the command line. this is fixed in this push --- BUILD/choose_configure.sh | 4 ++-- cmake/configure.pl | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/BUILD/choose_configure.sh b/BUILD/choose_configure.sh index 71243ea09b6..476b8b51657 100644 --- a/BUILD/choose_configure.sh +++ b/BUILD/choose_configure.sh @@ -7,8 +7,8 @@ cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no perl --version >/dev/null 2>&1 || HAVE_CMAKE=no if test "$HAVE_CMAKE" = "no" then - sh ./configure.am $@ + sh ./configure.am "$@" else - perl ./cmake/configure.pl $@ + perl ./cmake/configure.pl "$@" fi diff --git a/cmake/configure.pl b/cmake/configure.pl index 5886a554789..50225a0ef5e 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -72,10 +72,21 @@ check_compiler("CXX", "CXXFLAGS"); foreach my $option (@ARGV) { - if (substr ($option, 0, 2) == "--") + if (substr ($option, 0, 2) eq "--") { $option = substr($option, 2); } + else + { + # This must be environment variable + my @v = split('=', $option); + my $name = shift(@v); + if(@v) + { + $ENV{$name} = join('=', @v); + } + next; + } if($option =~ /srcdir/) { $srcdir = substr($option,7);