xref: /5.5.2/tlm/win32/environment.bat (revision 99fe2a18)
1@echo off
2
3if defined tools_version goto tools_set
4if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0" (
5  set tools_version=14.0
6) else (
7  set tools_version=12.0
8)
9
10:tools_set
11echo Using tools from: C:\Program Files (x86)\Microsoft Visual Studio %tools_version%
12if not defined source_root goto default_source_root
13
14:target_arch
15if not defined target_arch goto default_target_arch
16
17:setup_arch
18if /i "%target_arch%" == "amd64" goto setup_amd64
19if /i "%target_arch%" == "x86" goto setup_x86
20
21echo Unknown architecture: %target_arch%. Must be amd64 or x86
22set ERRORLEVEL=1
23goto eof
24
25:default_source_root
26set source_root=%CD%
27echo source_root not set. It was automatically set to the current directory %source_root%.
28goto target_arch
29
30:default_target_arch
31set target_arch=amd64
32echo target_arch is not set. It was automatically set to %target_arch%.
33goto setup_arch
34
35:setup_x86
36echo Setting up Visual Studio environment for x86
37call "C:\Program Files (x86)\Microsoft Visual Studio %tools_version%\VC\vcvarsall.bat" x86
38goto setup_environment
39
40:setup_amd64
41echo Setting up Visual Studio environment for amd64
42call "C:\Program Files (x86)\Microsoft Visual Studio %tools_version%\VC\vcvarsall.bat" amd64
43goto setup_environment
44
45:setup_environment
46rem Unfortunately we need to have all of the directories
47rem we build dll's in in the path in order to run make
48rem test in a module..
49
50echo Setting compile environment for building Couchbase server
51set OBJDIR=\build
52set MODULEPATH=%SOURCE_ROOT%%OBJDIR%\platform
53set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\platform\extmeta
54set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\platform\cbcompress
55set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\platform\cbsocket
56set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\phosphor
57
58set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\memcached
59set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\couchstore
60set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\sigar\build-src
61set PATH=%MODULEPATH%;%PATH%;%SOURCE_ROOT%\install\bin
62set OBJDIR=
63SET MODULEPATH=
64cd %SOURCE_ROOT%
65if "%target_arch%" == "amd64" set PATH=%PATH%;%SOURCE_ROOT%\install\x86\bin
66goto eof
67
68:missing_root
69echo source_root should be set in the source root
70set ERRORLEVEL=1
71goto eof
72
73:missing_target_arch
74echo target_arch must be set in environment to x86 or amd64
75set ERRORLEVEL=1
76goto eof
77
78:eof
79