-
Notifications
You must be signed in to change notification settings - Fork 159
/
cmnvars.sh
executable file
·53 lines (48 loc) · 1.75 KB
/
cmnvars.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# *****************************************************************
# cmnvars.sh - common environment variables
# *****************************************************************
# NOTE: All scripts to set the environment must call this script at
# the end.
# Set the version numbers
export OWBLDVER=20
export OWBLDVERSTR=2.0
export OWBLDVERTOOL=1300
# Subdirectory to be used for building OW build tools
if [ -z "$OWOBJDIR" ]; then export OWOBJDIR=binbuild; fi
# Set environment variables
# Set up default path information variable
if [ -z "$OWDEFPATH" ]; then
export OWDEFPATH="$PATH":
if [ -n "$INCLUDE" ]; then export OWDEFINCLUDE=$INCLUDE; fi
if [ -n "$WATCOM" ]; then export OWDEFWATCOM=$WATCOM; fi
fi
export PATH="$OWROOT/build/$OWOBJDIR:$OWROOT/build:$OWDEFPATH"
if [ -n "$OWDEFINCLUDE" ]; then export INCLUDE=$OWDEFINCLUDE; fi
if [ -n "$OWDEFWATCOM" ]; then export WATCOM=$OWDEFWATCOM; fi
# Set the toolchain version to OWTOOLSVER variable
export OWTOOLSVER=0
if [ "$OWTOOLS" = "WATCOM" ]; then
echo export OWTOOLSVER=__WATCOMC__>getversi.gc
wcc386 -p getversi.gc >getversi.sh
elif [ "$OWTOOLS" = "CLANG" ]; then
echo export OWTOOLSVER=__clang_major__>getversi.gc
if [ ! -z "$OWCLANG" ]; then
$OWCLANG -x c -E getversi.gc -o getversi.sh
else
clang -x c -E getversi.gc -o getversi.sh
fi
elif [ "$OWTOOLS" = "GCC" ]; then
echo export OWTOOLSVER=__GNUC__>getversi.gc
gcc -x c -E getversi.gc -o getversi.sh
elif [ "$OWTOOLS" = "VISUALC" ]; then
CC=cl
CXX=cl
echo export OWTOOLSVER=_MSC_VER>getversi.gc
cl -nologo -EP getversi.gc>getversi.bat
fi
if [ -f ./getversi.sh ]; then
. ./getversi.sh
rm getversi.*
fi
echo "Open Watcom build environment (${OWTOOLS} version=${OWTOOLSVER})"