Diff

Differences From Artifact [b9b3d01220]:

To Artifact [3c49d360c7]:


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
#! /bin/bash

if [ ! -x "./platform" ]; then
	echo 'ERROR: Platform script not found: ./platform' >&2

	exit 1
fi

CLEANONLY=0
DISTCLEAN=0
if [ "$1" = "clean" ]; then

	CLEANONLY=1
fi
if [ "$1" = "distclean" ]; then

	CLEANONLY=1
	DISTCLEAN=1
fi
export CLEANONLY DISTCLEAN




# Determine path to "tclConfig.sh"
rm -rf tcl/build

if [ "${DISTCLEAN}" = "1" ]; then
	rm -rf tcl
fi

if [ "${CLEANONLY}" = "0" ]; then
	TCLVERS="8.4.19"
	TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}"



	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 -


		cd "${TCLPRIVATE}/unix" || exit 1


		./configure --enable-shared

		${MAKE:-make}
















	) > "tcl/build/build.log" 2>&1



	if [ -d "${TCLPRIVATE}" -a -f "${TCLPRIVATE}/unix/tclConfig.sh" ]; then




		TCLCONFIGDIR="${TCLPRIVATE}/unix"
	else
		unset TCLPRIVATE

		TCLCONFIGDIR=$(
			(
				echo "${LD_LIBRARY_PATH}" | tr ':' "\n"
				cat /etc/ld.so.conf 2>/dev/null
				crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n"
			) | grep '^/' | while read chklibdir; do
				if [ -f "${chklibdir}/tclConfig.sh" ]; then
					echo "${chklibdir}"
					break
				fi
			done
		)
		if [ -z "${TCLCONFIGDIR}" ]; then
			TCLCONFIGDIR="/usr/lib"
		fi

		TCLPRIVATE="${TCLCONFIGDIR}/../include/tcl-private"
	fi

	ADDFLAGS="-I${TCLPRIVATE} -I${TCLPRIVATE}/generic -I${TCLPRIVATE}/unix"
	CFLAGS="${ADDFLAGS} ${CFLAGS}"
	CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}"

	unset TCLVERS
	unset ADDFLAGS

	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
fi

# Determine platform
PLATFORM="$(./platform)"
export PLATFORM












>



>





>
>
>


>







>
>














>
|

>
|

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
|
>
>
>
>
|



















|


|





>







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
117
118
119
#! /bin/bash

if [ ! -x "./platform" ]; then
	echo 'ERROR: Platform script not found: ./platform' >&2

	exit 1
fi

CLEANONLY=0
DISTCLEAN=0
if [ "$1" = "clean" ]; then
	shift
	CLEANONLY=1
fi
if [ "$1" = "distclean" ]; then
	shift
	CLEANONLY=1
	DISTCLEAN=1
fi
export CLEANONLY DISTCLEAN

CONFIGUREEXTRA="$@"
export CONFIGUREEXTRA

# Determine path to "tclConfig.sh"
rm -rf tcl/build
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)"
	export TCLVERS TCLPRIVATE PROJROOTDIR

	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}

			${MAKE:-make} || continue

			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
				echo 'puts "$::tcl_platform(os)"' | ./tclsh*.exe > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null
			else
				echo 'puts "$::tcl_platform(os)"' | ./tclsh > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null
			fi
			echo "${dir}" > "${PROJROOTDIR}/platform.magic.platform"
			pwd > "${PROJROOTDIR}/platform.magic.dir"

			break
		done
	) > "tcl/build/build.log" 2>&1 || (
		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 "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then
		TCLCONFIGDIR="${TCLBUILDDIR}"
	else
		unset TCLPRIVATE

		TCLCONFIGDIR=$(
			(
				echo "${LD_LIBRARY_PATH}" | tr ':' "\n"
				cat /etc/ld.so.conf 2>/dev/null
				crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n"
			) | grep '^/' | while read chklibdir; do
				if [ -f "${chklibdir}/tclConfig.sh" ]; then
					echo "${chklibdir}"
					break
				fi
			done
		)
		if [ -z "${TCLCONFIGDIR}" ]; then
			TCLCONFIGDIR="/usr/lib"
		fi

		TCLPRIVATE="$(dirname "${TCLCONFIGDIR}")/include/tcl-private"
	fi

	ADDFLAGS="-I${TCLPRIVATE} -I${TCLPRIVATE}/generic -I${TCLBUILDDIR}"
	CFLAGS="${ADDFLAGS} ${CFLAGS}"
	CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}"

	unset TCLVERS
	unset ADDFLAGS
	unset TCLBUILDDIR
	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
fi

# Determine platform
PLATFORM="$(./platform)"
export PLATFORM