blob: d073634700f78e3eef11929a4bf4aa9be6618241 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
.if !defined(_BLNK_LIBINTL_FOUND)
_BLNK_LIBINTL_FOUND!= \
if [ "`${ECHO} /usr/lib/libintl.*`" = "/usr/lib/libintl.*" ]; then \
${ECHO} "no"; \
else \
${ECHO} "yes"; \
fi
MAKEFLAGS+= _BLNK_LIBINTL_FOUND=${_BLNK_LIBINTL_FOUND}
.endif
_LIBINTL_H= /usr/include/libintl.h
.if !defined(IS_BUILTIN.gettext)
IS_BUILTIN.gettext= no
. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H})
IS_BUILTIN.gettext!= \
if ${GREP} -q "\#define[ ]*__USE_GNU_GETTEXT" ${_LIBINTL_H}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
. if !empty(IS_BUILTIN.gettext:M[yY][eE][sS])
#
# XXX Consider the base system libintl to be gettext-lib-0.10.35nb1.
#
BUILTIN_PKG.gettext= gettext-lib-0.10.35nb1
MAKEFLAGS+= BUILTIN_PKG.gettext=${BUILTIN_PKG.gettext}
. endif
. endif
MAKEFLAGS+= IS_BUILTIN.gettext=${IS_BUILTIN.gettext}
.endif
CHECK_BUILTIN.gettext?= no
.if !empty(CHECK_BUILTIN.gettext:M[yY][eE][sS])
USE_BUILTIN.gettext= yes
.endif
.if !defined(USE_BUILTIN.gettext)
USE_BUILTIN.gettext?= ${IS_BUILTIN.gettext}
PREFER.getext?= pkgsrc
. if defined(BUILTIN_PKG.gettext)
USE_BUILTIN.gettext= yes
. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
USE_BUILTIN.gettext!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.gettext}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
. endif
. endfor
. endif
. if ${PREFER.gettext} == "native"
# XXX
# XXX By default, assume that the native libintl is good enough.
# XXX
. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H})
USE_BUILTIN.gettext= yes
#
# The listed platforms have an implementation of libintl that isn't
# GNUish enough.
#
_INCOMPAT_GETTEXT= SunOS-*-*
. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
. if !empty(MACHINE_PLATFORM:M${_pattern_})
USE_BUILTIN.gettext= no
. endif
. endfor
. endif
. endif
. if defined(USE_GNU_GETTEXT)
. if !empty(IS_BUILTIN.gettext:M[nN][oO]) || \
(${PREFER.gettext} == "pkgsrc")
USE_BUILTIN.gettext= no
. endif
. endif
.endif # USE_BUILTIN.gettext
.if !empty(USE_BUILTIN.gettext:M[nN][oO])
_BLNK_LIBINTL= -lintl
_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1
. if !defined(_GETTEXT_NEEDS_ICONV)
_GETTEXT_NEEDS_ICONV?= no
. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
. if !empty(_GETTEXT_NEEDS_ICONV:M[nN][oO])
_GETTEXT_NEEDS_ICONV!= \
if ${PKG_INFO} -qe '${_depend_}'; then \
pkg=`cd ${_PKG_DBDIR}; ${PKG_ADMIN} -S lsbest '${_depend_}'`; \
if ${PKG_INFO} -qN "$$pkg" | ${GREP} -q "libiconv-[0-9]"; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi; \
else \
${ECHO} "yes"; \
fi
. endif
. endfor
. endif
. if ${_GETTEXT_NEEDS_ICONV} == "yes"
. for _mkfile_ in buildlink3.mk builtin.mk
. if exists(../../converters/libiconv/${_mkfile_})
. include "../../converters/libiconv/${_mkfile_}"
. endif
. endfor
BUILDLINK_DEPENDS.gettext+= ${_GETTEXT_ICONV_DEPENDS}
_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv}
. endif
.endif
.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
. if ${_BLNK_LIBINTL_FOUND} == "yes"
_BLNK_LIBINTL= -lintl
. else
_BLNK_LIBINTL= # empty
BUILDLINK_TRANSFORM+= l:intl:
. endif
.endif
BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL}
# Add -lintl to LIBS in CONFIGURE_ENV to work around broken gettext.m4:
# older gettext.m4 does not add -lintl where it should, and the resulting
# configure script fails to detect if libintl.a is the genuine GNU gettext
# or not.
#
.if defined(GNU_CONFIGURE)
LIBS+= ${BUILDLINK_LDADD.gettext}
CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}"
. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
. if ${_BLNK_LIBINTL_FOUND} == "yes"
CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes"
. endif
. endif
. if !empty(USE_BUILTIN.gettext:M[nN][oO])
CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext}
. else
CONFIGURE_ARGS+= --without-libintl-prefix
. endif
.endif
|