1# To the extent possible under law, the author(s) have dedicated all
2# copyright and related and neighboring rights to this software to the
3# public domain worldwide. This software is distributed without any warranty.
4# You should have received a copy of the CC0 Public Domain Dedication along
5# with this software.
6# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
7
8export ORIG_PATH=$PATH
9
10make_winpath()
11{
12    P=$1
13    if [ "$IN_CYGWIN" = "true" ]; then
14        cygpath -d "$P"
15    else
16        (cd "$P" && /bin/cmd //C "for %i in (".") do @echo %~fsi")
17    fi
18}
19
20make_upath()
21{
22    P=$1
23    if [ "$IN_CYGWIN" = "true" ]; then
24        cygpath "$P"
25    else
26        echo "$P" | /bin/sed 's,^\([a-zA-Z]\):\\,/\L\1/,;s,\\,/,g'
27    fi
28}
29
30# Some common paths
31if [ -x /usr/bin/msys-?.0.dll ]; then
32  # Without this the path conversion won't work
33  COMSPEC='C:\Windows\System32\cmd.exe'
34  MSYSTEM=MINGW32  # Comment out this line if in MSYS2
35  export MSYSTEM COMSPEC
36  # For MSYS2: Change /mingw/bin to the msys bin dir on the line below
37  PATH=/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem
38  C_DRV=/c
39  IN_CYGWIN=false
40else
41  PATH=/ldisk/overrides:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/windows/system32:/cygdrive/c/windows:/cygdrive/c/windows/system32/Wbem
42  C_DRV=/cygdrive/c
43  IN_CYGWIN=true
44fi
45
46obe_otp_gcc_vsn_map="
47    .*=>default
48"
49obe_otp_64_gcc_vsn_map="
50    .*=>default
51"
52# Program Files
53PRG_FLS64=$C_DRV/Program\ Files
54PRG_FLS32=$C_DRV/Program\ Files\ \(x86\)
55
56# Visual Studio
57VISUAL_STUDIO_ROOT=$PRG_FLS32/Microsoft\ Visual\ Studio\ 12.0
58WIN_VISUAL_STUDIO_ROOT="C:\\Program Files (x86)\\Microsoft Visual Studio 12.0"
59
60# SDK
61SDK=$PRG_FLS32/Windows\ Kits/8.1
62WIN_SDK="C:\\Program Files (x86)\\Windows Kits\\8.1"
63
64# NSIS
65NSIS_BIN=$PRG_FLS32/NSIS
66
67# Java
68JAVA_BIN=$PRG_FLS64/Java/jdk1.8.0_151/bin
69
70## The PATH variable should be Cygwin'ish
71VCPATH=$VISUAL_STUDIO_ROOT/VC/bin/amd64:$VISUAL_STUDIO_ROOT/VC/vcpackages:$VISUAL_STUDIO_ROOT/Common7/IDE:$VISUAL_STUDIO_ROOT/Common7/Tools:$SDK/bin/x86
72
73## Microsoft SDK libs
74LIBPATH=$WIN_VISUAL_STUDIO_ROOT\\VC\\lib\\amd64
75
76LIB=$WIN_VISUAL_STUDIO_ROOT\\VC\\lib\\amd64\;$WIN_SDK\\lib\\winv6.3\\um\\x64
77
78INCLUDE=$WIN_VISUAL_STUDIO_ROOT\\VC\\include\;$WIN_SDK\\include\\shared\;$WIN_SDK\\include\\um\;$WIN_SDK\\include\\winrt\;$WIN_SDK\\include\\um\\gl
79
80# Put nsis, c compiler and java in path
81export PATH=$VCPATH:$PATH:$JAVA_BIN:$NSIS_BIN:$ORIG_PATH
82
83# Make sure LIB and INCLUDE is available for others
84export LIBPATH LIB INCLUDE
85