Commit 6c534fd6 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Turn install.bat into a pure one line wrapper fort he perl script.

Build.bat and vcregress.bat got similar treatment years ago. I'm not sure
why install.bat wasn't treated at the same time, but it seems like a good
idea anyway.

The immediate problem with the old install.bat was that it had quoting
issues, and wouldn't work if the target directory's name contained spaces.
This fixes that problem.
parent 8e33fc17
@echo off @echo off
REM src/tools/msvc/install.bat REM src/tools/msvc/install.bat
REM all the logic for this now belongs in install.pl. This file really
if NOT "%1"=="" GOTO RUN_INSTALL REM only exists so you don't have to type "perl install.pl"
REM Resist any temptation to add any logic here.
echo Invalid command line options. @perl install.pl %*
echo Usage: "install.bat <path>"
echo.
REM exit fix for pre-2003 shell especially if used on buildfarm
if "%XP_EXIT_FIX%" == "yes" exit 1
exit /b 1
:RUN_INSTALL
SETLOCAL
IF NOT EXIST buildenv.pl goto nobuildenv
perl -e "require 'buildenv.pl'; while(($k,$v) = each %%ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat
CALL bldenv.bat
del bldenv.bat
:nobuildenv
perl install.pl "%1" %2
REM exit fix for pre-2003 shell especially if used on buildfarm
if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
exit /b %ERRORLEVEL%
...@@ -8,6 +8,19 @@ use warnings; ...@@ -8,6 +8,19 @@ use warnings;
use Install qw(Install); use Install qw(Install);
# buildenv.pl is for specifying the build environment settings
# it should contain lines like:
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
if (-e "src/tools/msvc/buildenv.pl")
{
require "src/tools/msvc/buildenv.pl";
}
elsif (-e "./buildenv.pl")
{
require "./buildenv.pl";
}
my $target = shift || Usage(); my $target = shift || Usage();
my $insttype = shift; my $insttype = shift;
Install($target, $insttype); Install($target, $insttype);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment