Add files from parent branch HEAD:
[pkgsrc.git] / graphics / glu / builtin.mk
1 # $NetBSD: builtin.mk,v 1.11 2006/04/06 06:22:02 reed Exp $
2
3 BUILTIN_PKG:=   glu
4
5 BUILTIN_FIND_FILES_VAR:=        H_GLU
6 BUILTIN_FIND_FILES.H_GLU=       ${X11BASE}/include/GL/glu.h
7
8 .include "../../mk/buildlink3/bsd.builtin.mk"
9
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 !defined(IS_BUILTIN.glu)
15 IS_BUILTIN.glu= no
16 .  if empty(H_GLU:M__nonexistent__)
17 BUILTIN_IMAKE_CHECK:=   glu:BuildGLULibrary
18 .    include "../../mk/buildlink3/imake-check.mk"
19 IS_BUILTIN.glu=         ${BUILTIN_IMAKE_CHECK.glu}
20 .  endif
21 .endif
22 MAKEVARS+=      IS_BUILTIN.glu
23
24 ###
25 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
26 ### a package name to represent the built-in package.
27 ###
28 .if !defined(BUILTIN_PKG.glu) && \
29     !empty(IS_BUILTIN.glu:M[yY][eE][sS]) && \
30     empty(H_GLU:M__nonexistent__)
31 .  include "../../graphics/Mesa/version.mk"
32 BUILTIN_PKG.glu=        glu-${BUILTIN_VERSION.Mesa}
33 .endif
34 MAKEVARS+=      BUILTIN_PKG.glu
35
36 ###
37 ### Determine whether we should use the built-in implementation if it
38 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
39 ###
40 .if !defined(USE_BUILTIN.glu)
41 .  if ${PREFER.glu} == "pkgsrc"
42 USE_BUILTIN.glu=        no
43 .  else
44 USE_BUILTIN.glu=        ${IS_BUILTIN.glu}
45 .    if defined(BUILTIN_PKG.glu) && \
46         !empty(IS_BUILTIN.glu:M[yY][eE][sS])
47 USE_BUILTIN.glu=        yes
48 .      for dep in ${BUILDLINK_API_DEPENDS.glu}
49 .        if !empty(USE_BUILTIN.glu:M[yY][eE][sS])
50 USE_BUILTIN.glu!=                                                       \
51         if ${PKG_ADMIN} pmatch ${dep:Q} ${BUILTIN_PKG.glu:Q}; then      \
52                 ${ECHO} yes;                                            \
53         else                                                            \
54                 ${ECHO} no;                                             \
55         fi
56 .        endif
57 .      endfor
58 .    endif
59 .  endif  # PREFER.glu
60 .endif
61 MAKEVARS+=      USE_BUILTIN.glu
62
63 ###
64 ### The section below only applies if we are not including this file
65 ### solely to determine whether a built-in implementation exists.
66 ###
67
68 .include "../../mk/x11.builtin.mk"
69
70 CHECK_BUILTIN.glu?=     no
71 .if !empty(CHECK_BUILTIN.glu:M[nN][oO])
72
73 .  if !empty(USE_BUILTIN.glu:M[nN][oO])
74 BUILDLINK_API_DEPENDS.glu+=     glu>=6.0
75 .  endif
76
77 .endif  # CHECK_BUILTIN.glu