devel/cppunit misses a destructor declaration for one of its classes.
[pkgsrcv2.git] / devel / gettext-lib / builtin.mk
1 # $NetBSD: builtin.mk,v 1.40 2011/01/21 21:24:11 wiz Exp $
2
3 .include "../../mk/bsd.fast.prefs.mk"
4
5 BUILTIN_PKG:=   gettext
6
7 BUILTIN_FIND_LIBS:=                     intl
8 BUILTIN_FIND_FILES_VAR:=                H_GETTEXT H_GENTOO_GETTEXT      \
9                                         H_NGETTEXT_GETTEXT
10 BUILTIN_FIND_FILES.H_GETTEXT=           /usr/include/libintl.h
11 BUILTIN_FIND_GREP.H_GETTEXT=            \#define[       ]*__USE_GNU_GETTEXT
12 BUILTIN_FIND_FILES.H_GENTOO_GETTEXT=    /usr/include/libintl.h
13 BUILTIN_FIND_GREP.H_GENTOO_GETTEXT=     gentoo-multilib/.*/libintl.h
14 BUILTIN_FIND_FILES.H_NGETTEXT_GETTEXT=  /usr/include/libintl.h
15 BUILTIN_FIND_GREP.H_NGETTEXT_GETTEXT=   char.*ngettext
16
17 .include "../../mk/buildlink3/bsd.builtin.mk"
18
19 ###
20 ### Determine if there is a built-in implementation of the package and
21 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
22 ###
23 #
24 # Gentoo Linux has an unusual scheme where /usr/include/libintl.h
25 # pulls in gentoo-multilib/$ARCH/libintl.h, where the latter is the
26 # real libintl.h file.  We can safely assume that this is GNU gettext
27 # (in glibc).
28 #
29 .if !defined(IS_BUILTIN.gettext)
30 IS_BUILTIN.gettext=     no
31 .  if (empty(H_GETTEXT:M__nonexistent__) && \
32        empty(H_GETTEXT:M${LOCALBASE}/*)) || \
33       (empty(H_GENTOO_GETTEXT:M__nonexistent__) && \
34        empty(H_GENTOO_GETTEXT:M${LOCALBASE}/*))
35 IS_BUILTIN.gettext=     yes
36 .  endif
37 .endif
38 MAKEVARS+=      IS_BUILTIN.gettext
39
40 ###
41 ### Determine whether we should use the built-in implementation if it
42 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
43 ###
44 .if !defined(USE_BUILTIN.gettext)
45 .  if ${PREFER.gettext} == "pkgsrc"
46 USE_BUILTIN.gettext=    no
47 .  else
48 USE_BUILTIN.gettext=    ${IS_BUILTIN.gettext}
49 .    if defined(BUILTIN_PKG.gettext) && \
50         !empty(IS_BUILTIN.gettext:M[yY][eE][sS])
51 USE_BUILTIN.gettext=    yes
52 .      for _dep_ in ${BUILDLINK_API_DEPENDS.gettext}
53 .        if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
54 USE_BUILTIN.gettext!=                                                   \
55         if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.gettext:Q}; then \
56                 ${ECHO} yes;                                            \
57         else                                                            \
58                 ${ECHO} no;                                             \
59         fi
60 .        endif
61 .      endfor
62 .    endif
63 # XXX
64 # XXX By default, assume that the native gettext implementation is good
65 # XXX enough to replace GNU gettext if it supplies ngettext().
66 # XXX
67 .    if empty(H_NGETTEXT_GETTEXT:M__nonexistent__) && \
68         empty(H_NGETTEXT_GETTEXT:M${LOCALBASE}/*)
69 USE_BUILTIN.gettext=    yes
70 .    endif
71 #
72 # Some platforms don't have a gettext implementation that can replace
73 # GNU gettext.
74 #
75 _INCOMPAT_GETTEXT?=     SunOS-*-*       # XXX move to mk/platforms/SunOS.mk
76 .    for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
77 .      if !empty(MACHINE_PLATFORM:M${_pattern_})
78 USE_BUILTIN.gettext=    no
79 .      endif
80 .    endfor
81 .  endif  # PREFER.gettext
82 .endif
83 MAKEVARS+=      USE_BUILTIN.gettext
84
85 # Define BUILTIN_LIBNAME.gettext to be the base name of the built-in
86 # gettext library.
87 #
88 .if !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
89 BUILTIN_LIBNAME.gettext=        intl
90 .else
91 BUILTIN_LIBNAME.gettext=        # empty (part of the C library)
92 .endif
93
94 ###
95 ### The section below only applies if we are not including this file
96 ### solely to determine whether a built-in implementation exists.
97 ###
98 CHECK_BUILTIN.gettext?= no
99 .if !empty(CHECK_BUILTIN.gettext:M[nN][oO])
100
101 .  if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
102 BUILDLINK_LIBNAME.gettext=      ${BUILTIN_LIBNAME.gettext}
103 .    if empty(BUILTIN_LIBNAME.gettext)
104 BUILDLINK_TRANSFORM+=           rm:-lintl
105 .    endif
106 .  endif
107
108 # If using a built-in libintl that isn't from GNU gettext, then set up
109 # some GNU configure variables that are checked by modern gettext.m4
110 # so that it will detect "GNU gettext" in the existing libintl.
111 #
112 .  if defined(GNU_CONFIGURE)
113 .    if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
114 .      if !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
115 CONFIGURE_ENV+=         gt_cv_func_gnugettext_libintl="yes"
116 CONFIGURE_ENV+=         gt_cv_func_gnugettext1_libintl="yes"
117 .        if empty(H_NGETTEXT_GETTEXT:M__nonexistent__) && \
118             empty(H_NGETTEXT_GETTEXT:M${LOCALBASE}/*)
119 CONFIGURE_ENV+=         gt_cv_func_gnugettext2_libintl="yes"
120 .        endif
121 .      endif
122 .    endif
123 .    if !empty(USE_BUILTIN.gettext:M[nN][oO])
124 CONFIGURE_ARGS+=        --with-libintl-prefix="${BUILDLINK_PREFIX.gettext}"
125 .    endif
126 .  endif
127
128 .endif  # CHECK_BUILTIN.gettext