forked from open-watcom/open-watcom-v2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
cmnvars.sh
executable file
·53 lines (45 loc) · 1.71 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
# Subdirectory to be used for build binaries
export OWBINDIR=$OWROOT/build/$OWOBJDIR
# Subdirectory containing OW sources
export OWSRCDIR=$OWROOT/bld
# Subdirectory containing documentation sources
export OWDOCSDIR=$OWROOT/docs
# 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=$OWBINDIR:$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
clang -x c -E getversi.gc -o getversi.sh
elif [ "$OWTOOLS" = "GCC" ]; then
echo export OWTOOLSVER=__GNUC__>getversi.gc
gcc -x c -E getversi.gc -o getversi.sh
fi
if [ -f ./getversi.sh ]; then
. ./getversi.sh
rm getversi.*
fi
echo "Open Watcom build environment (${OWTOOLS} version=${OWTOOLSVER})"