summaryrefslogtreecommitdiff
path: root/mcon/U/d_gnugettext.U
blob: 64757383b32e1155dee08a8ecd43f30b7ef9942a (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
?RCS: $Id: d_gnugettext.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS:
?RCS: Copyright (c) 2006, Christian Biere
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?MAKE:d_gnugettext: Myread Setvar cat d_nls +cc +ccflags +ldflags +libs
?MAKE:	-pick add $@ %<
?S:d_gnugettext:
?S:	This variable conditionally defines HAS_GNU_GETTEXT
?S:.
?C:HAS_GNU_GETTEXT:
?C:	This symbol, if defined, indicates that GNU gettext() is available.
?C:.
?H:#$d_gnugettext HAS_GNU_GETTEXT	/**/
?H:.
?F:!t.c !t
?LINT:set d_gnugettext
?LINT:usefile t t.c
: determine whether we have GNU 'gettext()'
echo " "
case "$d_nls" in
"$define")
	echo "Looking for GNU gettext()..." >&4
	$cat >t.c <<'EOC'
#include <libintl.h>
extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;
int main()
{
	bindtextdomain ("", "");
	return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings;
}
EOC
	if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; then
		echo "Yes, you have the GNU version." >&4
		val="$define"
	else
		echo "No, you don't have the GNU version." >&4
		val="$undef"
	fi
	;;
*)
	echo "You don't have NLS, you can't have GNU gettext()!" >&4
	val="$undef"
	;;
esac
set d_gnugettext
eval $setvar