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);