Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / x11 / libXau / builtin.mk
blob1b543eff25efae2ce2757c3118d0a649f240a525
1 # $NetBSD: builtin.mk,v 1.3 2010/12/10 08:45:15 obache Exp $
3 BUILTIN_PKG:= libXau
5 BUILTIN_FIND_FILES_VAR:= H_XAUTH
6 BUILTIN_FIND_FILES.H_XAUTH= ${X11BASE}/include/X11/Xauth.h
8 .include "../../mk/buildlink3/bsd.builtin.mk"
10 ###
11 ### Determine if there is a built-in implementation of the package and
12 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
13 ###
14 .if ${X11BASE} == ${LOCALBASE}
15 IS_BUILTIN.libXau= no
16 .elif !defined(IS_BUILTIN.libXau)
17 IS_BUILTIN.libXau= no
18 . if empty(H_XAUTH:M__nonexistent__)
19 IS_BUILTIN.libXau= yes
20 . endif
21 .endif
22 MAKEVARS+= IS_BUILTIN.libXau
24 ###
25 ### Determine whether we should use the built-in implementation if it
26 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
27 ###
28 .if !defined(USE_BUILTIN.libXau)
29 . if ${PREFER.libXau} == "pkgsrc"
30 USE_BUILTIN.libXau= no
31 . else
32 USE_BUILTIN.libXau= ${IS_BUILTIN.libXau}
33 . if defined(BUILTIN_PKG.libXau) && \
34 !empty(IS_BUILTIN.libXau:M[yY][eE][sS])
35 USE_BUILTIN.libXau= yes
36 . for _dep_ in ${BUILDLINK_API_DEPENDS.libXau}
37 . if !empty(USE_BUILTIN.libXau:M[yY][eE][sS])
38 USE_BUILTIN.libXau!= \
39 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libXau:Q}; then \
40 ${ECHO} yes; \
41 else \
42 ${ECHO} no; \
44 . endif
45 . endfor
46 . endif
47 . endif # PREFER.libXau
48 .endif
49 MAKEVARS+= USE_BUILTIN.libXau
51 .include "../../mk/x11.builtin.mk"
53 CHECK_BUILTIN.libXau?= no
54 .if !empty(CHECK_BUILTIN.libXau:M[nN][oO])
56 # If we are using the builtin version, check whether it has a xau.pc
57 # file or not. If the latter, generate a fake one.
58 . if !empty(USE_BUILTIN.libXau:M[Yy][Ee][Ss])
59 BUILDLINK_TARGETS+= xau-fake-pc
61 xau-fake-pc:
62 ${RUN} \
63 src=${BUILDLINK_PREFIX.libXau}/lib/pkgconfig/xau.pc; \
64 dst=${BUILDLINK_DIR}/lib/pkgconfig/xau.pc; \
65 ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \
66 if ${TEST} -f $${src}; then \
67 ${LN} -sf $${src} $${dst}; \
68 else \
69 req=""; \
70 if ${TEST} -f \
71 ${BUILDLINK_PREFIX.xproto}/lib/pkgconfig/xproto.pc; then \
72 req="xproto"; \
73 fi; \
74 { ${ECHO} "Name: Xau"; \
75 ${ECHO} "Description: X authorization file management library"; \
76 ${ECHO} "Version: 1.0.1"; \
77 ${ECHO} "Requires: $${req}"; \
78 ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.libXau}/include"; \
79 ${ECHO} "Libs: -L${BUILDLINK_PREFIX.libXau}/lib" \
80 "${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libXau}/lib" \
81 "-lXau"; \
82 } >$${dst}; \
84 . endif
86 .endif # CHECK_BUILTIN.libXau