-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtcl.cygclass
140 lines (123 loc) · 4.16 KB
/
tcl.cygclass
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
################################################################################
#
# tcl.cygclass - definitions for installing Tcl modules
#
# Part of cygport - Cygwin packaging application
# Copyright (C) 2006-2020 Cygport authors
# Provided by the Cygwin project <https://cygwin.com/>
#
# cygport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cygport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cygport. If not, see <https://www.gnu.org/licenses/>.
#
################################################################################
#****h* Cygclasses/tcl.cygclass
# SYNOPSIS
# inherit tcl
# DESCRIPTION
# Tcl is a general-purpose scripting language used for a variety of purposes.
# It supports extensions written in Tcl or C. Tk is both a Tcl extension and
# a GUI toolkit in its own right, which is used in turn by several other
# programming languages (including Perl, Python, R, and Ruby) as their
# default GUI library.
#
# This cygclass provides definitions for Tcl extensions and packages embedding
# the Tcl language.
# REQUIRES
# tcl
#****
check_prog_req tclsh tcl
# this is used for TCL_VERSION
if cross_compiling
then
export ac_cv_c_tclconfig=$(${CC} -print-sysroot)$(__target_prefix)/lib
else
export ac_cv_c_tclconfig=$(__host_prefix)/lib
fi
if test -f ${ac_cv_c_tclconfig}/tkConfig.sh
then
export ac_cv_c_tkconfig=${ac_cv_c_tclconfig}
fi
#****d* tcl.cygclass/TCLSH
# DESCRIPTION
# Absolute path to the Tcl interpreter.
#****
TCLSH=/usr/bin/tclsh
#****d* tcl.cygclass/TCL_VERSION
# DESCRIPTION
# The major.minor version of the Tcl interpreter.
#****
eval $(grep '^TCL_VERSION=' ${ac_cv_c_tclconfig}/tclConfig.sh)
#****d* tcl.cygclass/TCL_INCLUDEDIR
# DESCRIPTION
# Location of the Tcl private headers, necessary when building packages
# which expect to build from a Tcl source tree (e.g. Tk).
#****
TCL_INCLUDEDIR="/usr/include/tcl${TCL_VERSION}"
#****d* tcl.cygclass/TCL_LIBDIR
# DESCRIPTION
# Location of the Tcl standard library.
#****
TCL_LIBDIR="/usr/lib/tcl${TCL_VERSION}"
#****d* tcl.cygclass/TK_INCLUDEDIR
# DESCRIPTION
# Location of the Tk private headers, necessary when building packages
# which expect to build from a Tk source tree.
#****
TK_INCLUDEDIR=${TCL_INCLUDEDIR}
#****d* tcl.cygclass/TK_LIBDIR
# DESCRIPTION
# Location of the Tk standard library.
#****
TK_LIBDIR=${TCL_LIBDIR/tcl/tk}
#****d* tcl.cygclass/LIBTCL
# DESCRIPTION
# Link flags for the Tcl C library.
#****
LIBTCL="-ltcl${TCL_VERSION}"
#****d* tcl.cygclass/LIBTK
# DESCRIPTION
# Link flags for the Tk and Tcl C libraries.
#****
LIBTK="-ltk${TCL_VERSION} ${LIBTCL}"
__tcl_sys_version() {
local tclsys
# FIXME: do binutils/gcc really support all these?
case ${CHOST} in
*-ibm-aix*) tclsys="AIX-x" ;;
*-*-beos*) tclsys="BeOS" ;;
*-*-bsdi*) tclsys="BSD/OS-4.x" ;;
*-*-cygwin*) tclsys="CYGWIN_NT" ;;
*-*-darwin*) tclsys="Darwin-x" ;;
*-*-freebsd*) tclsys="FreeBSD-x" ;;
*-*-haiku*) tclsys="Haiku" ;;
*-*-hpux*) tclsys="HP-UX-x.11.z" ;;
*64-*-irix*) tclsys="IRIX64-6.x" ;;
*-*-irix*) tclsys="IRIX-6.x" ;;
*-*-linux*) tclsys="Linux" ;;
*-*-lynxos*) tclsys="Lynx" ;;
*-*-netbsd*) tclsys="NetBSD-x" ;;
*-*-openbsd*) tclsys="OpenBSD-x" ;;
*-ibm-openedition) tclsys="OS/390-x" ;;
*-*-osf*) tclsys="OSF1-Vx" ;;
*-*-nto-qnx*) tclsys="QNX-6" ;;
*-*-sco*) tclsys="SCO_SV-3.2" ;;
*-*-solaris*) tclsys="SunOS-5" ;;
*-*-mingw*) tclsys="windows" ;;
# must be last to avoid false positives from *-*-KERNEL-gnu
*-*-gnu*) tclsys="GNU" ;;
*) error "Host ${CHOST} is not supported by Tcl" ;;
esac
echo -n ${tclsys}
}
export tcl_cv_sys_version=$(__tcl_sys_version)
readonly -f __tcl_sys_version