forked from sillsdev/FieldWorks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
environ
116 lines (101 loc) · 3.95 KB
/
environ
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Environment settings for running FieldWorks
#
# Source this file in a shell and then run "mono FieldWorks.exe -app {Te,Flex}"
# Possible values for RUNMODE:
# - INSTALLED: when running an installed package
# - PACKAGING: while building the package
BASE=$(pwd)
COM=$(dirname "${BASE}")/libcom/COM
ARCH=$(uname -m)
[ -z "$BUILD" ] && BUILD=Debug
[ -z "$MONO_PREFIX" ] && MONO_PREFIX=/opt/mono4-sil
[ -z "$MONO_SILPKGDIR" ] && MONO_SILPKGDIR=/opt/mono4-sil
# Dependency locations
# search for xulrunner and geckofx, select the best, and add its location to LD_LIBRARY_PATH
. ./environ-xulrunner
GDK_SHARP=/usr/lib/cli/gdk-sharp-2.0/
ENC_CONVERTERS=/usr/lib/fieldworks
MONO_RUNTIME=v4.0.30319
MONO_DEBUG=explicit-null-checks
MONO_ENV_OPTIONS="-O=-gshared"
# Directory settings
if [ "$RUNMODE" != "INSTALLED" ]
then
PATH="${BASE}/Output_${ARCH}/${BUILD}:\
/usr/lib/fieldworks/icu-bin:\
${COM}/build${ARCH}/bin:\
${PATH}"
LD_LIBRARY_PATH="${BASE}/Output_${ARCH}/${BUILD}:\
/usr/lib/fieldworks/lib:\
${COM}/build${ARCH}/lib:\
${LD_LIBRARY_PATH}"
fi
# ensure we scan the default pkg-config directories (to pick up Geckofx for compiling)
[ -z "$PKG_CONFIG_PATH" ] && PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
# Add packaged mono items to paths
PATH="${MONO_SILPKGDIR}/bin:${PATH}"
LD_LIBRARY_PATH="${MONO_SILPKGDIR}/lib:${ENC_CONVERTERS}:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="${MONO_SILPKGDIR}/lib/pkgconfig:/usr/lib/fieldworks/lib/pkgconfig:${PKG_CONFIG_PATH}"
MONO_GAC_PREFIX="${MONO_SILPKGDIR}:${ENC_CONVERTERS}:/usr:${MONO_PREFIX}"
if [ "$RUNMODE" != "PACKAGING" ]
then
# Make locally-built software (eg mono) visible
PATH="${MONO_PREFIX}/bin:${PATH}"
LD_LIBRARY_PATH="${MONO_PREFIX}/lib:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="${MONO_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
MONO_GAC_PREFIX="${MONO_PREFIX}:${MONO_GAC_PREFIX}"
fi
if [ "$RUNMODE" = "INSTALLED" ]
then
COMPONENTS_MAP_PATH="${BASE}"
FW_ROOT="${BASE}/../../share/fieldworks"
FW_ROOTDATA="${HOME}/.config/fieldworks"
FW_ROOTCODE="${BASE}/../../share/fieldworks"
ICU_DATA="${HOME}/.config/fieldworks/Icu54"
PATH="${BASE}/icu-bin:${PATH}"
LD_LIBRARY_PATH="${BASE}:${BASE}/lib:${LD_LIBRARY_PATH}"
MONO_REGISTRY_PATH="${HOME}/.config/fieldworks/registry"
else
COMPONENTS_MAP_PATH="${BASE}/Output_${ARCH}/${BUILD}"
FW_ROOT="${BASE}/DistFiles"
FW_ROOTDATA="${BASE}/DistFiles"
FW_ROOTCODE="${BASE}/DistFiles"
ICU_DATA="${BASE}/DistFiles/Icu54"
MONO_REGISTRY_PATH="${BASE}/Output_${ARCH}/registry"
fi
if [ "$RUNMODE" != "PACKAGING" -a "$RUNMODE" != "INSTALLED" ]
then
FW_CommonAppData=${BASE}/Output_${ARCH}/VarLibFieldworks
[ ! -d $FW_CommonAppData ] && mkdir -p $FW_CommonAppData
[ -d /var/lib/fieldworks/registry ] && cp -r /var/lib/fieldworks/registry $FW_CommonAppData
MONO_PATH="${BASE}/DistFiles:${BASE}/Output_${ARCH}/${BUILD}"
fi
MONO_PATH="${MONO_PATH}:${GDK_SHARP}:${ENC_CONVERTERS}:${GECKOFX}"
MONO_TRACE_LISTENER="Console.Out"
#MONO_IOMAP=case
MONO_MWF_SCALING=disable
# if debugging Fieldworks for performance unset DEBUG_ENABLE_PTR_VALIDATION env var.
#DEBUG_ENABLE_PTR_VALIDATION=1
# If the standard installation directory for FLExBridge exists, and the environment
# variable is not yet set, set the environment variable for finding FLExBridge.
# (Setting the LocalMachine registry value at installation doesn't work for Linux.)
if [ -z "$FLEXBRIDGEDIR" -a -d "/usr/lib/flexbridge" ]
then
FLEXBRIDGEDIR="/usr/lib/flexbridge"
fi
export \
PATH LD_LIBRARY_PATH PKG_CONFIG_PATH LD_PRELOAD \
COMPONENTS_MAP_PATH \
FW_ROOT FW_ROOTCODE FW_ROOTDATA \
ICU_DATA \
FLEXBRIDGEDIR \
MONO_PATH MONO_REGISTRY_PATH \
MONO_PREFIX MONO_GAC_PREFIX \
MONO_RUNTIME MONO_DEBUG MONO_ENV_OPTIONS \
MONO_TRACE_LISTENER MONO_IOMAP MONO_MWF_SCALING FW_CommonAppData
#DEBUG_ENABLE_PTR_VALIDATION
# prevent Gecko from printing scary message about "double free or corruption" on shutdown
# (See FWNX-1216.) Tom Hindle suggested this hack as a stopgap.
MALLOC_CHECK_=0; export MALLOC_CHECK_
#sets keyboard input method to none
unset XMODIFIERS