Windows batch file to setup dev environment
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/7511243e Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/7511243e Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/7511243e Branch: refs/heads/master Commit: 7511243e5de1c7fb34c0da4dad8f669e3686e179 Parents: ab39208 Author: Nick Wellnhofer <[email protected]> Authored: Sun Jul 20 17:00:51 2014 +0200 Committer: Marvin Humphrey <[email protected]> Committed: Sun Jul 20 19:54:49 2014 +0100 ---------------------------------------------------------------------- devel/bin/setup_env.bat | 71 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7511243e/devel/bin/setup_env.bat ---------------------------------------------------------------------- diff --git a/devel/bin/setup_env.bat b/devel/bin/setup_env.bat new file mode 100644 index 0000000..8357073 --- /dev/null +++ b/devel/bin/setup_env.bat @@ -0,0 +1,71 @@ +@echo off + +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +setlocal EnableExtensions EnableDelayedExpansion + +set base_dir=%~dp0\..\.. +call :normalize "%base_dir%" +set base_dir=%retval% +set runtime_dir=%base_dir%\runtime +set compiler_dir=%base_dir%\compiler + +call :add_to_path "%PATH%" "%compiler_dir%\c" +set PATH=%retval% +call :add_to_path "%PATH%" "%runtime_dir%\c" +set PATH=%retval% +call :add_to_path "%INCLUDE%" "%runtime_dir%\perl\xs" +set INCLUDE=%retval% +call :add_to_path "%LIB%" "%runtime_dir%\c" +set LIB=%retval% +call :add_to_path "%CLOWNFISH_INCLUDE%" "%runtime_dir%\core" +set CLOWNFISH_INCLUDE=%retval% +call :add_to_path "%PERL5LIB%" "%compiler_dir%\perl\blib\arch" +set PERL5LIB=%retval% +call :add_to_path "%PERL5LIB%" "%compiler_dir%\perl\blib\lib" +set PERL5LIB=%retval% +call :add_to_path "%PERL5LIB%" "%runtime_dir%\perl\blib\arch" +set PERL5LIB=%retval% +call :add_to_path "%PERL5LIB%" "%runtime_dir%\perl\blib\lib" +set PERL5LIB=%retval% + +endlocal & ( + set "PATH=%PATH%" + set "INCLUDE=%INCLUDE%" + set "LIB=%LIB%" + set "CLOWNFISH_INCLUDE=%CLOWNFISH_INCLUDE%" + set "PERL5LIB=%PERL5LIB%" +) + +exit /b + +:normalize +set retval=%~f1 +goto :eof + +:add_to_path +set _path=%~1 +set _dir=%~2 +if "%_path%" == "" ( + set "retval=%_dir%" + goto :eof +) +if "!_path:%_dir%=!" == "%_path%" ( + set "retval=%_path%;%_dir%" + goto :eof +) +set retval=%_path% +goto :eof
