summaryrefslogtreecommitdiffstats
path: root/rules/tcl.make
blob: d965d7e9720fda861ab014c8b0806ac408afaa80 (plain)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# -*-makefile-*-
#
# Copyright (C) 2009 by Juergen Beisert
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_TCL) += tcl

#
# Paths and names
#
TCL_MAJOR	:= 8
TCL_MINOR	:= 5
TCL_PL		:= 15
TCL_VERSION	:= $(TCL_MAJOR).$(TCL_MINOR).$(TCL_PL)
TCL_MD5		:= f3df162f92c69b254079c4d0af7a690f
TCL		:= tcl$(TCL_VERSION)
TCL_SUFFIX	:= -src.tar.gz
TCL_URL		:= $(call ptx/mirror, SF, tcl/$(TCL)$(TCL_SUFFIX))
TCL_SOURCE	:= $(SRCDIR)/$(TCL)$(TCL_SUFFIX)
TCL_DIR		:= $(BUILDDIR)/$(TCL)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

# select one of the available kernel versions

TCL_KERNEL_VERSION := $(if $(KERNEL_HEADER_VERSION),$(KERNEL_HEADER_VERSION),$(KERNEL_VERSION))

ifdef PTXCONF_TCL
ifeq ($(TCL_KERNEL_VERSION),)
 $(warning ######################### ERROR ###########################)
 $(warning # Linux kernel version required in order to make TCL work #)
 $(warning #   Define a platform kernel or the kernel headers        #)
 $(warning ###########################################################)
 $(error )
endif
endif

TCL_ENV 	:= \
	$(CROSS_ENV) \
	tcl_cv_sys_version=Linux-$(TCL_KERNEL_VERSION) \
	tcl_cv_strstr_unbroken=yes \
	tcl_cv_strtoul_unbroken=yes \
	tcl_cv_strtod_unbroken=yes \
	tcl_cv_strtod_buggy=no \
	tcl_cv_stack_grows_up=no

# unresolved issues yet:
#  checking for timezone data... /usr/share/zoneinfo <-- it uses host's one
#

#
# autoconf
#
TCL_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	--$(call ptx/endis, PTXCONF_TCL_THREADS)-threads \
	--enable-shared \
	--disable-64bit \
	--disable-64bit-vis \
	--disable-rpath \
	--disable-corefoundation \
	--enable-load \
	--enable-symbols \
	--enable-dll-unloading \
	--disable-dtrace \
	--disable-framework \
	--with-encoding=iso8859-15 \
	--$(call ptx/wwo, PTXCONF_TCL_TZDATA)-tzdata

# TODO: Provide the correct encoding for the target
# --with-encoding=<valid encode from 'usr/lib/tcl8.5/encoding'>
# Note: TCL uses iso8859-1 until otherwise specified

TCL_SUBDIR := unix

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

$(STATEDIR)/tcl.install:
	@$(call targetinfo)
	@$(call install, TCL)
	@mkdir -p $(TCL_PKGDIR)/usr/share/tcl-tests
	@cd $(TCL_DIR)/tests && \
		install -m 644 * $(TCL_PKGDIR)/usr/share/tcl-tests/
	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/tcl.targetinstall:
	@$(call targetinfo)

	@$(call install_init, tcl)
	@$(call install_fixup, tcl,PRIORITY,optional)
	@$(call install_fixup, tcl,SECTION,base)
	@$(call install_fixup, tcl,AUTHOR,"Juergen Beisert <juergen@kreuzholzen.de")
	@$(call install_fixup, tcl,DESCRIPTION,"TCL byte code engine")

	@$(call install_copy, tcl, 0, 0, 0755, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR))
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/tclIndex)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/package.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/init.tcl)

	@$(call install_copy, tcl, 0, 0, 0755, -, \
		/usr/bin/tclsh$(TCL_MAJOR).$(TCL_MINOR))

	# a simplified link is very useful
	@$(call install_link, tcl, \
		tclsh$(TCL_MAJOR).$(TCL_MINOR), /usr/bin/tclsh)

	@$(call install_copy, tcl, 0, 0, 0644, -, /usr/lib/libtcl8.5.so)

ifdef PTXCONF_TCL_TESTING
	@$(call install_copy, tcl, 0, 0, 0755, /usr/lib/tcl$(TCL_MAJOR))
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR)/$(TCL_MAJOR).$(TCL_MINOR)/tcltest-2.3.5.tm)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR)/$(TCL_MAJOR).$(TCL_MINOR)/msgcat-1.5.2.tm)

	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/tm.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/parray.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/clock.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/auto.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/history.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/safe.tcl)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/word.tcl)

# avoid a subdirectory hell. Install them where also the other scripts are
	@$(call install_copy, tcl, 0, 0, 0644, \
		$(TCL_PKGDIR)/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/opt0.4/optparse.tcl, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/optparse.tcl)

	@$(call install_copy, tcl, 0, 0, 0644, \
		$(TCL_PKGDIR)/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/opt0.4/pkgIndex.tcl, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/pkgIndex.tcl)
endif

ifdef PTXCONF_TCL_ENCODING
	@$(call install_copy, tcl, 0, 0, 0755, \
		/usr/lib/tcl$(TCL_MAJOR).$(TCL_MINOR)/encoding)
ifndef PTXCONF_TCL_TESTING
# install some popular code pages
# FIXME: Are these the most common ones? Add more if not
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/iso8859-1.enc)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/iso8859-15.enc)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/cp437.enc)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/cp850.enc)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/ascii.enc)
	@$(call install_copy, tcl, 0, 0, 0644, -, \
		/usr/lib/tcl8.5/encoding/big5.enc)
else
# install all code pages
	@cd $(TCL_PKGDIR)/usr/lib/tcl8.5/encoding; \
	for file in * ; do \
		$(call install_copy, tcl, 0, 0, 0644, -, \
			/usr/lib/tcl8.5/encoding/$$file); \
	done
# copy all tests to the target
	@$(call install_copy, tcl, 0, 0, 0755, /usr/share/tcl-tests)
	@cd $(TCL_PKGDIR)/usr/share/tcl-tests && \
	for file in * ; do \
		$(call install_copy, tcl, 0, 0, 644, -, \
			/usr/share/tcl-tests/$$file); \
	done

# unresolved tests:
# Test file error: EscapeToUtfProc: invalid sub table

endif
endif

	@$(call install_finish, tcl)

	@$(call touch)

# vim: syntax=make