View | Details | Raw Unified | Return to bug 109097 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/bsd.tcl.mk (-33 / +144 lines)
Lines 10-28 Link Here
10
Tcl_Include_MAINTAINER=	ports@FreeBSD.org
10
Tcl_Include_MAINTAINER=	ports@FreeBSD.org
11
11
12
# USE_TCL		- Depend on tcl to run. In case of incompatible APIs of
12
# USE_TCL		- Depend on tcl to run. In case of incompatible APIs of
13
#				  different TCL versions the version can be specified directly.
13
#				  different Tcl versions the version can be specified directly.
14
#				  If version is not specified (USE_TCL=yes) then the latest
14
#				  If version is not specified (USE_TCL=yes) then the latest
15
#				  version is used (8.4 currently).
15
#				  version is used (8.4 currently).
16
#				  Available values are: 85, 85-thread, 84, 84-thread, 83, 82,
16
#				  Available values are: 85+, 84+, 83+, 85, 84, 83, 82, 81 and 80.
17
#				  81 and 80.
17
# USE_TCL_BUILD		- Set to add build time dependency on tcl, requires USE_TCL.
18
# USE_TCL_BUILD	- Build time dependency on tcl. Same semantics as USE_TCL.
18
# TCL_NO_RUN_DEPENDS	- Set to disable runtime dependency on Tcl (requires USE_TCL_BUILD)
19
#
20
# USE_TCL_THREADS 	- If unset, non-threaded Tcl is required by default. If a threaded version 
21
#			  is installed, port uses the threaded version.
22
#			  If set, a threaded build of Tcl is always required.
23
# USE_TCL_NOTHREADS	- If set, a non-threaded Tcl is always required. 
24
#			  (overrides USE_TCL_THREADS if set)
25
# TCL_HAS_THREADS	- Detected by bsd.tcl.mk. If set, a threaded version of Tcl is already 
26
#			  installed or going to be installed.
19
#
27
#
20
# USE_TK		- Depend on tk to run. In case of incompatible APIs of different
28
# USE_TK		- Depend on tk to run. In case of incompatible APIs of different
21
#				  TK versions the version can be specified directly. If version
29
#				  TK versions the version can be specified directly. If version
22
#				  is not specified (USE_TK=yes) then the latest version is
30
#				  is not specified (USE_TK=yes) then the latest version is
23
#				  used (8.4 currently).
31
#				  used (8.4 currently).
24
#				  Available values are: 85, 84, 83, 82, 81 and 80.
32
#				  Available values are: 85+, 84+, 83+, 85, 84, 83, 82, 81 and 80.
25
# USE_TK_BUILD	- Build time dependency on tk. Same semantics as USE_TK.
33
# USE_TK_BUILD		- Set to add build time dependency on tk.
34
# TK_NO_RUN_DEPENDS	- Set to disable runtime dependency on Tk (requires USE_TK_BUILD)
26
##
35
##
27
# TCL_LIBDIR	- Path where tcl libraries can be found
36
# TCL_LIBDIR	- Path where tcl libraries can be found
28
#
37
#
Lines 47-107 Link Here
47
# 				  wish calls with wish${TK_VER} calls. Also note that
56
# 				  wish calls with wish${TK_VER} calls. Also note that
48
# 				  post-patch target is used.
57
# 				  post-patch target is used.
49
58
50
.if defined(USE_TCL) || defined(USE_TCL_BUILD)
59
# Backwards compatibility with old USE_TCL_BUILD
51
60
.if defined(USE_TCL_BUILD) && !defined(USE_TCL)
52
_TCL_VERSIONS=	85 85-thread 84 84-thread 83 82 81 80
61
USE_TCL=	${USE_TCL_BUILD}
62
USE_TCL_BUILD=	yes
63
TCL_NO_RUN_DEPENDS=	yes
64
.endif
53
65
66
# Tcl part
54
.if defined(USE_TCL)
67
.if defined(USE_TCL)
55
_RUN=		yes
56
.endif
57
68
58
.if defined(USE_TCL_BUILD)
69
_TCL_VERSIONS=			85 84 84 83 82 81 80
59
USE_TCL=	${USE_TCL_BUILD}
70
_TCL_THREADED_VERSIONS= 	85 84 81
60
_BUILD=		yes
71
_TCL_RANGE_VERSIONS= 		85+ 84+ 83+
61
.endif
72
73
# For specifying [85, 84, 83, ..]+
74
_TCL_83P=	83 84 85
75
_TCL_84P=	84 85
76
_TCL_85P=	85
77
78
# Support for obsolete 84-thread and 85-thread definitions
79
. if ${USE_TCL} == "84-thread" || ${USE_TCL} == "85-thread"
80
_USE_TCL=		${USE_TCL:S/-thread//}
81
USE_TCL=		${_USE_TCL}
82
USE_TCL_THREADS=	yes
83
. endif
62
84
63
.if ${USE_TCL} == "yes"
85
.if ${USE_TCL} == "yes"
64
USE_TCL=	84
86
USE_TCL=	84
65
.endif
87
.endif
66
88
67
TCL_VER:=	${USE_TCL:S/8/8./:S/-thread//}
89
.if defined(USE_TCL_BUILD)
90
. if defined(TCL_NO_RUN_DEPENDS)
91
_NORUN=		yes
92
. endif
93
_BUILD=		yes
94
.endif
68
95
69
# Special case
96
# Special case
70
.if ${USE_TCL} == "81"
97
.if ${USE_TCL} == "81"
71
USE_TCL=	tcl81-thread
98
USE_TCL_THREADS=	yes
99
.endif
100
101
# Check if a tcl build with threads is required
102
.if defined(USE_TCL_THREADS) && !defined(USE_TCL_NOTHREADS)
103
TCL_HAS_THREADS=	yes
104
_TCL_THREADED=		_THREADED
105
_TCL_THREADED_PORT=	-thread
106
_TCL_THREADED_IGNORE=	(with threads)
107
.endif
108
109
# Check for highest installed Tcl (if e.g. 83+ is specified)
110
_TCL_VER=	no
111
.for ver in ${_TCL_RANGE_VERSIONS}
112
. if ${USE_TCL} == "${ver}" && ${_TCL_VER} == "no"
113
_MATCHED_TCL_VER:=	${USE_TCL:S/+//}
114
.  for tcl in ${_TCL_${_MATCHED_TCL_VER}P}
115
.   if exists(${LOCALBASE}/include/tcl${tcl:S/8/8./}/tcl.h)
116
_TCL_VER=${tcl}
117
.   endif
118
.  endfor
119
. endif
120
.endfor
121
.if defined(_MATCHED_TCL_VER)
122
. if ${_TCL_VER} != "no"
123
USE_TCL=	${_TCL_VER}
124
. else
125
USE_TCL=	${_MATCHED_TCL_VER}
126
. endif
72
.endif
127
.endif
73
128
129
TCL_VER:=	${USE_TCL:S/8/8./}
130
131
# Check if correct Tcl version was specified
74
_FOUND=		no
132
_FOUND=		no
75
.for ver in ${_TCL_VERSIONS}
133
.for ver in ${_TCL${_TCL_THREADED}_VERSIONS}
76
. if ${USE_TCL} == "${ver}"
134
. if ${USE_TCL} == "${ver}"
77
_FOUND=		yes
135
_FOUND=		yes
78
.  if defined(_BUILD)
136
79
BUILD_DEPENDS+=	tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}
80
.  endif
81
.  if defined(_RUN)
82
RUN_DEPENDS+=	tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}
83
.  endif
84
TCL_INCLUDEDIR=	${LOCALBASE}/include/tcl${TCL_VER}
137
TCL_INCLUDEDIR=	${LOCALBASE}/include/tcl${TCL_VER}
85
TCL_LIBDIR=		${LOCALBASE}/lib/tcl${TCL_VER}
138
TCL_LIBDIR=		${LOCALBASE}/lib/tcl${TCL_VER}
86
TCLSH=			${LOCALBASE}/bin/tclsh${TCL_VER}
139
TCLSH=			${LOCALBASE}/bin/tclsh${TCL_VER}
140
141
# Check if a threaded or non-threaded Tcl is installed
142
.  if exists(${TCLSH})
143
_TCL_IS_THREADED!=  echo 'puts [array names tcl_platform -exact threaded]' | ${TCLSH} || return 0
144
.   if ${_TCL_IS_THREADED} != "threaded"
145
.    if defined(USE_TCL_THREADS)
146
IGNORE= Tcl ${TCL_VER} with threads required. The installed version does not support threads
147
.    endif
148
.   else
149
TCL_HAS_THREADS=	yes
150
.    if defined(USE_TCL_NOTHREADS)
151
IGNORE= Tcl ${TCL_VER} without threads required. The installed version uses threads
152
.    else
153
_TCL_THREADED_PORT=	-thread
154
.    endif
155
.   endif
156
.  endif
157
158
# Add dependencies
159
.  if defined(_BUILD)
160
BUILD_DEPENDS+=	tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}${_TCL_THREADED_PORT}
161
.  endif
162
.  if !defined(_NORUN)
163
RUN_DEPENDS+=	tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}${_TCL_THREADED_PORT}
164
.  endif
87
. endif
165
. endif
88
.endfor
166
.endfor
89
167
90
.if ${_FOUND} == "no"
168
.if ${_FOUND} == "no"
91
IGNORE=		Unknown TCL version specified: ${USE_TCL}
169
IGNORE=		Unknown Tcl version specified: ${USE_TCL} ${_TCL_THREADED_IGNORE}
92
.endif
170
.endif
93
.endif # defined(USE_TCL) || defined(USE_TCL_BUILD)
94
171
95
.if defined(USE_TK) || defined(USE_TK_BUILD)
172
.endif # defined(USE_TCL)
96
173
97
_TK_VERSIONS=	85 84 83 82 81 80
174
# Backwards compatibility with old USE_TK_BUILD
175
.if defined(USE_TK_BUILD) && !defined(USE_TK)
176
USE_TK=	${USE_TK_BUILD}
177
USE_TK_BUILD=	yes
178
TK_NO_RUN_DEPENDS=	yes
179
.endif
98
180
181
# TK part
99
.if defined(USE_TK)
182
.if defined(USE_TK)
100
_TK_RUN=	yes
183
101
.endif
184
_TK_VERSIONS=	85 84 83 82 81 80
185
_TK_RANGE_VERSIONS= 85+ 84+ 83+
186
187
# For specifying [85, 84, 83, ..]+
188
_TK_83P=	83 84 85
189
_TK_84P=	84 85
190
_TK_85P=	85
102
191
103
.if defined(USE_TK_BUILD)
192
.if defined(USE_TK_BUILD)
104
USE_TK=		${USE_TK_BUILD}
193
. if defined(TK_NO_RUN_DEPENDS)
194
_TK_NORUN=	yes
195
. endif
105
_TK_BUILD=	yes
196
_TK_BUILD=	yes
106
.endif
197
.endif
107
198
Lines 109-114 Link Here
109
USE_TK=		84
200
USE_TK=		84
110
.endif
201
.endif
111
202
203
# Check for highest installed TK (if e.g. 83+ is specified)
204
_TK_VER=	no
205
.for ver in ${_TK_RANGE_VERSIONS}
206
. if ${USE_TK} == "${ver}" && ${_TK_VER} == "no"
207
_MATCHED_TK_VER:=	${USE_TK:S/+//}
208
.  for tk in ${_TK_${_MATCHED_TK_VER}P}
209
.   if exists(${LOCALBASE}/include/tk${tk:S/8/8./}/tk.h)
210
_TK_VER=${tk}
211
.   endif
212
.  endfor
213
. endif
214
.endfor
215
.if defined(_MATCHED_TK_VER)
216
. if ${_TK_VER} != "no"
217
USE_TK=		${_TK_VER}
218
. else
219
USE_TK=		${_MATCHED_TK_VER}
220
. endif
221
.endif
222
112
TK_VER:=	${USE_TK:S/8/8./}
223
TK_VER:=	${USE_TK:S/8/8./}
113
TCL_VER?=	${TK_VER}
224
TCL_VER?=	${TK_VER}
114
225
Lines 123-129 Link Here
123
.  if defined(_TK_BUILD)
234
.  if defined(_TK_BUILD)
124
BUILD_DEPENDS+=	wish${TK_VER}:${PORTSDIR}/x11-toolkits/tk${USE_TK}
235
BUILD_DEPENDS+=	wish${TK_VER}:${PORTSDIR}/x11-toolkits/tk${USE_TK}
125
.endif
236
.endif
126
.  if defined(_TK_RUN)
237
.  if !defined(_TK_NORUN)
127
RUN_DEPENDS+=	wish${TK_VER}:${PORTSDIR}/x11-toolkits/tk${USE_TK}
238
RUN_DEPENDS+=	wish${TK_VER}:${PORTSDIR}/x11-toolkits/tk${USE_TK}
128
.endif
239
.endif
129
TCL_INCLUDEDIR=	${LOCALBASE}/include/tcl${TK_VER}
240
TCL_INCLUDEDIR=	${LOCALBASE}/include/tcl${TK_VER}
Lines 138-144 Link Here
138
.if ${_FOUND} == "no"
249
.if ${_FOUND} == "no"
139
IGNORE=		Unknown TK version specified: ${USE_TK}
250
IGNORE=		Unknown TK version specified: ${USE_TK}
140
.endif
251
.endif
141
.endif # defined(USE_TK) || defined(USE_TK_BUILD)
252
.endif # defined(USE_TK)
142
253
143
.endif # !defined(_POSTMKINCLUDED) && !defined(Tcl_Pre_Include)
254
.endif # !defined(_POSTMKINCLUDED) && !defined(Tcl_Pre_Include)
144
255

Return to bug 109097