summaryrefslogtreecommitdiff
blob: 30481921fb0fc6d0c0f2500247d17bf642975686 (plain)
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
#!/bin/sh -
# $Id$
#
# /usr/bin/wx-config
#
#  a lame wx-config wrapper (bugs to wxwidgets@gentoo.org)

_wxerror() {
	cat >&2 <<- EOF
		An error occurred while calling wx-config:
		
		${1}

		Please use \`eselect wxwidgets\` to select an available profile and try again.
	EOF
	exit 1
}

if [ -n "${WX_ECLASS_CONFIG}" ]; then
	${WX_ECLASS_CONFIG} "$@"
	exit 0
else
	if [ -e /var/lib/wxwidgets/current ]; then
		. /var/lib/wxwidgets/current
	else
		_wxerror "Cannot find the wxWidgets profile configuration ( /var/lib/wxwidgets/current )"
	fi

	[ -z "${WXCONFIG}" -o "${WXCONFIG}" = none ] && _wxerror "No profile currently selected"

	if [ -x /usr/lib/wx/config/${WXCONFIG} ]; then
	   /usr/lib/wx/config/${WXCONFIG} "$@"
	else
		_wxerror "Cannot find wxWidgets profile ( ${WXCONFIG} )"
	fi
	exit 0
fi