1 ################################################################################
3 # fox.cygclass - functions for building FOX-toolkit-dependent packages
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/fox.cygclass
29 # The FOX toolkit is a cross-platform, C++ GUI toolkit. The API changes with
30 # each major.minor version, each of which is parallel-installable. Packages
31 # which depend on the FOX toolkit will only build against one or two branches
34 # This cygclass selects the fox-config script for the desired version of the
40 #****v* fox.cygclass/FOX_VERSION
42 # The desired major.minor branch of the FOX toolkit. This variable must be
43 # set before inherit()ing the fox.cygclass.
45 # Even minor version numbers represent stable branches; versions 1.2, 1.4,
46 # and 1.6 are supported. Unstable branches (with odd minor versions) are
47 # currently not supported.
53 case ${FOX_VERSION} in
54 '') error "FOX_VERSION must be defined" ;;
55 *.*.*) error "FOX_VERSION must be only a major-minor branch" ;;
56 1.[01]) error "FOX ${FOX_VERSION} is not supported" ;;
58 for fc in fox-config-${FOX_VERSION} fox-${FOX_VERSION}-config fox-config
60 if [ -f $(__host_prefix)/bin/$fc ]
62 fox_config=$(__host_prefix)/bin/$fc
67 *) error "FOX ${FOX_VERSION} is not yet supported" ;;
70 if [ ! -f ${fox_config} ]
72 error "libFOX${FOX_VERSION}-devel is not installed"
75 case $(${fox_config} --version) in
77 *) error "version mismatch: ${FOX_VERSION} requested but not found" ;;
83 #****d* fox.cygclass/FOX_CONFIG
85 # Absolute path to the fox-config script for the given FOX_VERSION. This definition
86 # is exported to the build environment.
88 export FOX_CONFIG="$(_fox_find_config)"
90 #****d* fox.cygclass/FOX_CFLAGS
92 # Compile flags for the specified version of the FOX toolkit. This
93 # is equivalent to `$FOX_CONFIG --cflags`.
95 FOX_CFLAGS="$(${FOX_CONFIG} --cflags)"
97 #****d* fox.cygclass/FOX_LIBS
99 # Link flags for the specified version of the FOX toolkit. This
100 # is equivalent to `$FOX_CONFIG --libs`.
102 FOX_LIBS="$(${FOX_CONFIG} --libs)"
104 #****f* fox.cygclass/fox-config
106 # Wrapper function for calling FOX_CONFIG.
112 readonly -f _fox_find_config fox-config