Check-in [2a6f69ee57]
Overview
SHA1:2a6f69ee57e3f7b2de7924dee48457f60408e4d6
Date: 2014-04-27 04:17:16
User: rkeene
Comment:Started work on adding TclTCC package
Timelines: family | ancestors | descendants | both | tcc
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-04-27
05:52
[2a3d2138b6] More work towards getting a usable TclTCC (user: rkeene, tags: tcc)
04:17
[2a6f69ee57] Started work on adding TclTCC package (user: rkeene, tags: tcc)
04:13
[1a5bbc4282] Work towards upgrading zlib -- untested on most platforms (user: rkeene, tags: trunk)
Changes

Added .fossil-settings/crnl-glob version [8f8dd7e7df].



>
1
tcc/patches/all/tcltcc-0.4-fixloading.diff

Added .fossil-settings/ignore-glob version [1a05efe8ce].



























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
build/test/kits
build/test/kits/*
itcl/build
itcl/build/*
itcl/build.log
itcl/inst
itcl/inst/*
itcl/out
itcl/out/*
itcl/src
itcl/src/*
kitsh/build
kitsh/build/*
kitsh/build.log
kitsh/buildsrc/kitsh-0.0/Makefile
kitsh/buildsrc/kitsh-0.0/autom4te.cache
kitsh/buildsrc/kitsh-0.0/autom4te.cache/*
kitsh/buildsrc/kitsh-0.0/boot.tcl.h
kitsh/buildsrc/kitsh-0.0/config.h
kitsh/buildsrc/kitsh-0.0/config.h.in
kitsh/buildsrc/kitsh-0.0/config.log
kitsh/buildsrc/kitsh-0.0/config.status
kitsh/buildsrc/kitsh-0.0/configure
kitsh/buildsrc/kitsh-0.0/kit
kitsh/buildsrc/kitsh-0.0/zipvfs.tcl.h
kitsh/inst
kitsh/inst/*
kitsh/out
kitsh/out/*
mk4tcl/build
mk4tcl/build/*
mk4tcl/build.log
mk4tcl/inst
mk4tcl/inst/*
mk4tcl/out
mk4tcl/out/*
mk4tcl/src
mk4tcl/src/*
tcl/build
tcl/build/*
tcl/build.log
tcl/inst
tcl/inst/*
tcl/out
tcl/out/*
tcl/src
tcl/src/*
tclkit-*
tclkit-*/*
tclvfs/build
tclvfs/build/*
tclvfs/build.log
tclvfs/inst
tclvfs/inst/*
tclvfs/out
tclvfs/out/*
tclvfs/src
tclvfs/src/*
thread/build
thread/build/*
thread/build.log
thread/inst
thread/inst/*
thread/out
thread/out/*
thread/src
thread/src/*
tk/build
tk/build/*
tk/build.log
tk/inst
tk/inst/*
tk/out
tk/out/*
tk/src
tk/src/*
zlib/build
zlib/build/*
zlib/build.log
zlib/inst
zlib/inst/*
zlib/out
zlib/out/*
zlib/src
zlib/src/*
tcc/build
tcc/build/*
tcc/build.log
tcc/inst
tcc/inst/*
tcc/out
tcc/out/*
tcc/src
tcc/src/*
kitdll/buildsrc/kitdll-0.0/starpack.vfs
kitdll/buildsrc/kitdll-0.0/starpack.vfs/*
kitdll/buildsrc/kitdll-0.0/test
kitdll/buildsrc/kitdll-0.0/configure
kitdll/buildsrc/kitdll-0.0/libtcl*.so
kitdll/buildsrc/kitdll-0.0/Makefile
kitdll/buildsrc/kitdll-0.0/*.o
kitdll/buildsrc/kitdll-0.0/config.log
kitdll/buildsrc/kitdll-0.0/config.status
kitdll/buildsrc/kitdll-0.0/vfs_kitdll_data_tcl.c
kitdll/buildsrc/kitdll-0.0/vfs_kitdll.tcl.h
kitdll/build/kitdll-*
kitdll/build/kitdll-*/*
kitdll/build.log
libtclkit-*.*

Modified kitcreator from [e140ad3217] to [3d5aec022e].

23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
if [ -f 'build/pre.sh' ]; then
	if ! find 'kitsh/buildsrc/' -name configure -type f 2>/dev/null | grep configure >/dev/null; then
		echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2
	fi
fi

# Define the list of all packages, for cleaning purposes
KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx"

# Always rebuild kitsh
rm -f "kitsh/.success"
for pkg in ${KITCREATOR_ALLPKGS}; do
	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
		rm -f "${pkg}/build.log" "${pkg}/.success"
		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"








|
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if [ -f 'build/pre.sh' ]; then
	if ! find 'kitsh/buildsrc/' -name configure -type f 2>/dev/null | grep configure >/dev/null; then
		echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2
	fi
fi

# Define the list of all packages, for cleaning purposes
KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc"

# Always rebuild kitsh
rm -f "kitsh/.success"
for pkg in ${KITCREATOR_ALLPKGS}; do
	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
		rm -f "${pkg}/build.log" "${pkg}/.success"
		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"

Added tcc/build.sh version [09ccdfc66e].









































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#! /usr/bin/env bash

if [ ! -f 'build.sh' ]; then
	echo 'ERROR: This script must be run from the directory it is in' >&2

	exit 1
fi
if [ -z "${TCLVERS}" ]; then
	echo 'ERROR: The TCLVERS environment variable is not set' >&2

	exit 1
fi

TCLTCCVERS="0.4"
SRC="src/tcltcc-${TCLTCCVERS}.zip"
SRCURL="https://tcltcc.googlecode.com/files/tcltcc${TCLTCCVERS}.zip"
BUILDDIR="$(pwd)/build/tcltcc-0.4"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
PATCHDIR="$(pwd)/patches"
export TCLTCCVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR

# Set configure options for this sub-project
LDFLAGS="${KC_TCLTCC_LDFLAGS}"
CFLAGS="${KC_TCLTCC_CFLAGS}"
CPPFLAGS="${KC_TCLTCC_CPPFLAGS}"
LIBS="${KC_TCLTCC_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS

rm -rf 'build' 'out' 'inst'
mkdir 'build' 'out' 'inst' || exit 1

TCL_VERSION="unknown"
if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
        source "${TCLCONFIGDIR}/tclConfig.sh"
fi
export TCL_VERSION

if [ ! -f "${SRC}" ]; then
	mkdir 'src' >/dev/null 2>/dev/null

	if [ ! -d 'buildsrc' ]; then
		rm -f "${SRC}.tmp"
		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
		mv "${SRC}.tmp" "${SRC}"
	fi
fi

(
	cd 'build' || exit 1

	if [ ! -d '../buildsrc' ]; then
		mkdir "${BUILDDIR}" || exit 1
		(
			cd "${BUILDDIR}" || exit 1
			unzip "../../${SRC}"
		)
	else    
		cp -rp ../buildsrc/* './'
	fi

	# Apply required patches
	cd "${BUILDDIR}" || exit 1
	for patch in "${PATCHDIR}/all"/tcltcc-${TCLTCCVERS}-*.diff "${PATCHDIR}/${TCL_VERSION}"/tcltcc-${TCLTCCVERS}-*.diff; do
		if [ ! -f "${patch}" ]; then
			continue
		fi

		echo "Applying: ${patch}"
		${PATCH:-patch} -p1 < "${patch}"
	done

	cd "${BUILDDIR}" || exit 1

	# Try to build as a shared object if requested
	if [ "${STATICTCLTCC}" = "0" ]; then
		tryopts="--enable-shared --disable-shared"
	elif [ "${STATICTCLTCC}" = "-1" ]; then
		tryopts="--enable-shared"
	else
		tryopts="--disable-shared"
	fi

	SAVE_CFLAGS="${CFLAGS}"
	for tryopt in $tryopts __fail__; do
		# Clean up, if needed
		make distclean >/dev/null 2>/dev/null
		rm -rf "${INSTDIR}"
		mkdir "${INSTDIR}"

		if [ "${tryopt}" = "__fail__" ]; then
			exit 1
		fi

		if [ "${tryopt}" == "--enable-shared" ]; then
			isshared="1"
		else
			isshared="0"
		fi

		# If build a static TclX for KitDLL, ensure that we use PIC
		# so that it can be linked into the shared object
		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
			CFLAGS="${SAVE_CFLAGS} -fPIC"
		else
			CFLAGS="${SAVE_CFLAGS}"
		fi
		export CFLAGS

		if [ "${isshared}" = '0' ]; then
			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
		else
			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
		fi
		cat configure.new > configure
		rm -f configure.new
		chmod +x configure

		(
			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}

			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" AR=\"${AR:-ar}\" RANLIB=\"${RANLIB:-ranlib}\""
			${MAKE:-make} tcllibdir="${INSTDIR}/lib" AR="${AR:-ar}" RANLIB="${RANLIB:-ranlib}" || exit 1

			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" AR=\"${AR:-ar}\" RANLIB=\"${RANLIB:-ranlib}\" install"
			${MAKE:-make} tcllibdir="${INSTDIR}/lib" AR="${AR:-ar}" RANLIB="${RANLIB:-ranlib}" install || exit 1
		) || continue

		break
	done

	# Install files needed by installation
	pkgDir="${INSTDIR}/lib/tcc${TCLTCCVERS}"
	pkgIndex="${pkgDir}/pkgIndex.tcl"

	mkdir -p "${pkgDir}"

	cp tcc.tcl "${pkgDir}"
	cp pkgIndex.tcl "${pkgDir}"

	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --

	exit 0
) || exit 1

exit 0

Added tcc/patches/all/tcltcc-0.4-fixloading.diff version [59d3bfe7e9].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- tcltcc-0.4.orig/tcc.tcl	2007-11-07 10:04:42.000000000 -0600
+++ tcltcc-0.4/tcc.tcl	2014-04-26 23:06:24.272645002 -0500
@@ -9,10 +9,15 @@
    variable commands
 
    set dir [file dirname [info script]]
-   switch -exact -- $::tcl_platform(platform) {
-	   windows { load $dir/tcc02.dll tcc }
-	   unix { load $dir/libtcc0.2.so tcc }
-	   default {error "unsupport platform"}
+   if {[info command ::tcc] == ""} {
+      catch { load {} tcc }
+   }
+   if {[info command ::tcc] == ""} {
+       switch -exact -- $::tcl_platform(platform) {
+	       windows { load $dir/tcc04.dll tcc }
+	       unix { load $dir/libtcc0.4.so tcc }
+	       default {error "unsupport platform"}
+       }
    }
    set libs $dir/lib
    set includes $dir/include