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
|
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
|
-
+
+
-
+
-
+
+
|
fi
export CLEANONLY DISTCLEAN
CONFIGUREEXTRA="$@"
export CONFIGUREEXTRA
# Determine path to "tclConfig.sh"
rm -rf tcl/build
rm -rf tcl/build tcl/inst
rm -f platform.magic.*
if [ "${DISTCLEAN}" = "1" ]; then
rm -rf tcl
fi
if [ "${CLEANONLY}" = "0" ]; then
TCLVERS="8.4.19"
TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}"
PROJROOTDIR="$(pwd)"
TCLINSTDIR="$(pwd)/tcl/inst"
export TCLVERS TCLPRIVATE PROJROOTDIR
export TCLVERS TCLPRIVATE PROJROOTDIR TCLINSTDIR
mkdir tcl tcl/build >/dev/null 2>/dev/null
if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then
mkdir tcl/src >/dev/null 2>/dev/null
wget -o /dev/null -O "tcl/src/tcl${TCLVERS}.tar.gz" "http://prdownloads.sourceforge.net/tcl/tcl${TCLVERS}-src.tar.gz"
fi
echo "Building Tcl ${TCLVERS}"
(
mkdir tcl/build >/dev/null 2>/dev/null
cd tcl/build || exit 1
gzip -dc "../src/tcl${TCLVERS}.tar.gz" | tar -xf -
for dir in unix win macosx; do
cd "${TCLPRIVATE}/${dir}" || exit 1
echo " Executing: ./configure ${CONFIGUREEXTRA}"
./configure --disable-threads ${CONFIGUREEXTRA}
./configure --disable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}"
${MAKE:-make} || continue
${MAKE:-make} install || break
LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}"
LD_RUN_PATH=".:${LD_RUN_PATH}"
export LD_LIBRARY_PATH LD_RUN_PATH
file tclsh tclsh*.exe 2>/dev/null | grep -iv 'No such file' > "${PROJROOTDIR}/platform.magic.file"
if [ -f tclsh*.exe ]; then
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
+
+
-
+
|
echo 'Failed to build Tcl. See "./tcl/build/build.log"'
echo 'Proceeding with system Tcl. Building might fail.'
)
TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")"
export TCLBUILDDIR
if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then
TCLCONFIGDIR="${TCLINSTDIR}/lib"
if [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
TCLCONFIGDIR="${TCLBUILDDIR}"
else
unset TCLPRIVATE
TCLCONFIGDIR=$(
(
echo "${LD_LIBRARY_PATH}" | tr ':' "\n"
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
+
+
-
+
+
+
+
+
-
-
+
|
if [ -z "${TCLCONFIGDIR}" ]; then
TCLCONFIGDIR="/usr/lib"
fi
TCLPRIVATE="$(dirname "${TCLCONFIGDIR}")/include/tcl-private"
fi
ADDFLAGS=""
if [ -n "${TCLPRIVATE}" ]; then
ADDFLAGS="-I${TCLPRIVATE} -I${TCLPRIVATE}/generic -I${TCLBUILDDIR}"
ADDFLAGS="${ADDFLAGS} -I${TCLPRIVATE} -I${TCLPRIVATE}/generic"
fi
if [ -n "${TCLBUILDDIR}" ]; then
ADDFLAGS="${ADDFLAGS} -I${TCLBUILDDIR}"
fi
CFLAGS="${ADDFLAGS} ${CFLAGS}"
CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}"
unset TCLVERS
unset ADDFLAGS
unset TCLBUILDDIR
export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
export TCLBUILDDIR TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
fi
# Determine platform
if [ -z "${FORCE_PLATFORM}" ]; then
PLATFORM="$(./platform)"
export PLATFORM
else
|