1 ################################################################################
3 # tcl.cygclass - definitions for installing Tcl modules
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****h* Cygclasses/tcl.cygclass
28 # Tcl is a general-purpose scripting language used for a variety of purposes.
29 # It supports extensions written in Tcl or C. Tk is both a Tcl extension and
30 # a GUI toolkit in its own right, which is used in turn by several other
31 # programming languages (including Perl, Python, R, and Ruby) as their
32 # default GUI library.
34 # This cygclass provides definitions for Tcl extensions and packages embedding
40 check_prog_req tclsh tcl
42 # this is used for TCL_VERSION
45 export ac_cv_c_tclconfig=$(${CC} -print-sysroot)$(__target_prefix)/lib
47 export ac_cv_c_tclconfig=$(__host_prefix)/lib
49 if test -f ${ac_cv_c_tclconfig}/tkConfig.sh
51 export ac_cv_c_tkconfig=${ac_cv_c_tclconfig}
54 #****d* tcl.cygclass/TCLSH
56 # Absolute path to the Tcl interpreter.
60 #****d* tcl.cygclass/TCL_VERSION
62 # The major.minor version of the Tcl interpreter.
64 eval $(grep '^TCL_VERSION=' ${ac_cv_c_tclconfig}/tclConfig.sh)
66 #****d* tcl.cygclass/TCL_INCLUDEDIR
68 # Location of the Tcl private headers, necessary when building packages
69 # which expect to build from a Tcl source tree (e.g. Tk).
71 TCL_INCLUDEDIR="/usr/include/tcl${TCL_VERSION}"
73 #****d* tcl.cygclass/TCL_LIBDIR
75 # Location of the Tcl standard library.
77 TCL_LIBDIR="/usr/lib/tcl${TCL_VERSION}"
79 #****d* tcl.cygclass/TK_INCLUDEDIR
81 # Location of the Tk private headers, necessary when building packages
82 # which expect to build from a Tk source tree.
84 TK_INCLUDEDIR=${TCL_INCLUDEDIR}
86 #****d* tcl.cygclass/TK_LIBDIR
88 # Location of the Tk standard library.
90 TK_LIBDIR=${TCL_LIBDIR/tcl/tk}
92 #****d* tcl.cygclass/LIBTCL
94 # Link flags for the Tcl C library.
96 LIBTCL="-ltcl${TCL_VERSION}"
98 #****d* tcl.cygclass/LIBTK
100 # Link flags for the Tk and Tcl C libraries.
102 LIBTK="-ltk${TCL_VERSION} ${LIBTCL}"
105 __tcl_sys_version() {
108 # FIXME: do binutils/gcc really support all these?
110 *-ibm-aix*) tclsys="AIX-x" ;;
111 *-*-beos*) tclsys="BeOS" ;;
112 *-*-bsdi*) tclsys="BSD/OS-4.x" ;;
113 *-*-cygwin*) tclsys="CYGWIN_NT" ;;
114 *-*-darwin*) tclsys="Darwin-x" ;;
115 *-*-freebsd*) tclsys="FreeBSD-x" ;;
116 *-*-haiku*) tclsys="Haiku" ;;
117 *-*-hpux*) tclsys="HP-UX-x.11.z" ;;
118 *64-*-irix*) tclsys="IRIX64-6.x" ;;
119 *-*-irix*) tclsys="IRIX-6.x" ;;
120 *-*-linux*) tclsys="Linux" ;;
121 *-*-lynxos*) tclsys="Lynx" ;;
122 *-*-netbsd*) tclsys="NetBSD-x" ;;
123 *-*-openbsd*) tclsys="OpenBSD-x" ;;
124 *-ibm-openedition) tclsys="OS/390-x" ;;
125 *-*-osf*) tclsys="OSF1-Vx" ;;
126 *-*-nto-qnx*) tclsys="QNX-6" ;;
127 *-*-sco*) tclsys="SCO_SV-3.2" ;;
128 *-*-solaris*) tclsys="SunOS-5" ;;
129 *-*-mingw*) tclsys="windows" ;;
130 # must be last to avoid false positives from *-*-KERNEL-gnu
131 *-*-gnu*) tclsys="GNU" ;;
132 *) error "Host ${CHOST} is not supported by Tcl" ;;
138 export tcl_cv_sys_version=$(__tcl_sys_version)
140 readonly -f __tcl_sys_version