Bump version to 0.36.9
[cygport.git] / cygclass / tcl.cygclass
bloba607f85ac9b2a87df7c49478e89b19e583321821
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
25 #  SYNOPSIS
26 #  inherit tcl
27 #  DESCRIPTION
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
35 #  the Tcl language.
36 #  REQUIRES
37 #  tcl
38 #****
40 check_prog_req tclsh tcl
42 # this is used for TCL_VERSION
43 if cross_compiling
44 then
45         export ac_cv_c_tclconfig=$(${CC} -print-sysroot)$(__target_prefix)/lib
46 else
47         export ac_cv_c_tclconfig=$(__host_prefix)/lib
49 if test -f ${ac_cv_c_tclconfig}/tkConfig.sh
50 then
51         export ac_cv_c_tkconfig=${ac_cv_c_tclconfig}
54 #****d* tcl.cygclass/TCLSH
55 #  DESCRIPTION
56 #  Absolute path to the Tcl interpreter.
57 #****
58 TCLSH=/usr/bin/tclsh
60 #****d* tcl.cygclass/TCL_VERSION
61 #  DESCRIPTION
62 #  The major.minor version of the Tcl interpreter.
63 #****
64 eval $(grep '^TCL_VERSION=' ${ac_cv_c_tclconfig}/tclConfig.sh)
66 #****d* tcl.cygclass/TCL_INCLUDEDIR
67 #  DESCRIPTION
68 #  Location of the Tcl private headers, necessary when building packages
69 #  which expect to build from a Tcl source tree (e.g. Tk).
70 #****
71 TCL_INCLUDEDIR="/usr/include/tcl${TCL_VERSION}"
73 #****d* tcl.cygclass/TCL_LIBDIR
74 #  DESCRIPTION
75 #  Location of the Tcl standard library.
76 #****
77 TCL_LIBDIR="/usr/lib/tcl${TCL_VERSION}"
79 #****d* tcl.cygclass/TK_INCLUDEDIR
80 #  DESCRIPTION
81 #  Location of the Tk private headers, necessary when building packages
82 #  which expect to build from a Tk source tree.
83 #****
84 TK_INCLUDEDIR=${TCL_INCLUDEDIR}
86 #****d* tcl.cygclass/TK_LIBDIR
87 #  DESCRIPTION
88 #  Location of the Tk standard library.
89 #****
90 TK_LIBDIR=${TCL_LIBDIR/tcl/tk}
92 #****d* tcl.cygclass/LIBTCL
93 #  DESCRIPTION
94 #  Link flags for the Tcl C library.
95 #****
96 LIBTCL="-ltcl${TCL_VERSION}"
98 #****d* tcl.cygclass/LIBTK
99 #  DESCRIPTION
100 #  Link flags for the Tk and Tcl C libraries.
101 #****
102 LIBTK="-ltk${TCL_VERSION} ${LIBTCL}"
105 __tcl_sys_version() {
106         local tclsys
108         # FIXME: do binutils/gcc really support all these?
109         case ${CHOST} in
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" ;;
133         esac
135         echo -n ${tclsys}
138 export tcl_cv_sys_version=$(__tcl_sys_version)
140 readonly -f __tcl_sys_version