Lines 1-185
Link Here
|
1 |
#-*- tab-width: 4; -*- |
1 |
# $FreeBSD$ |
2 |
# ex:ts=4 |
|
|
3 |
# |
2 |
# |
4 |
# bsd.sdl.mk - Support for SDL-based ports. |
3 |
# Support for SDL-based ports |
5 |
# |
4 |
# |
6 |
# Created by: Edwin Groothuis <edwin@freebsd.org> |
5 |
# Feature: sdl |
|
|
6 |
# Usage: USES=sdl |
7 |
# USE_SDL=sdl console gfx image mixer mm net pango sound ttf |
8 |
# sdl2 gfx2 image2 mixer2 net2 ttf2 |
7 |
# |
9 |
# |
8 |
# For FreeBSD committers: |
10 |
# USE_SDL specifies which SDL components to add as dependencies. |
9 |
# - Changes in the version number of the shared libraries are encouraged. |
11 |
# Not specifying USE_SDL with USES=sdl is an error. |
10 |
# - For the rest, please try to run them via the maintainer but feel free |
12 |
# USE_SDL=yes implies USE_SDL=sdl. This is deprecated |
11 |
# to commit themselves if nothing breaks. |
|
|
12 |
# |
13 |
# |
13 |
# For ports-developers: |
14 |
# MAINTAINER: amdmi3@FreeBSD.org |
14 |
# If your port needs SDL or one of the SDL modules, you can easily |
|
|
15 |
# include them with the "USE_SDL=" statement. For example if you need |
16 |
# the standard SDL and SDL_sound, use "USE_SDL=sdl sound" and the |
17 |
# required libraries are included in your LIB_DEPENDS. |
18 |
# |
19 |
|
15 |
|
20 |
# |
16 |
.if !defined(_INCLUDE_USES_SDL_MK) |
21 |
# $FreeBSD$ |
17 |
_INCLUDE_USES_SDL_MK= yes |
22 |
# |
|
|
23 |
|
18 |
|
24 |
SDL_Include_MAINTAINER= ports@FreeBSD.org |
|
|
25 |
|
26 |
# |
27 |
# These are the current supported SDL1.2 modules |
19 |
# These are the current supported SDL1.2 modules |
28 |
# |
20 |
_SDL_USE_ALL= sdl console gfx image mixer mm net pango sound ttf |
29 |
_USE_SDL_ALL= console gfx image mixer mm net pango sdl sound ttf |
|
|
30 |
# |
31 |
# These are the current supported SDL2 modules |
32 |
# |
33 |
_USE_SDL_ALL+= gfx2 image2 mixer2 net2 sdl2 ttf2 |
34 |
|
21 |
|
35 |
# |
22 |
_SDL_sdl_LIB_DEPENDS= libSDL.so:devel/sdl12 |
36 |
# Variables used to determine what is needed: |
|
|
37 |
# _SUBDIR_xxx subdirectory below ${PORTSDIR} (required) |
38 |
# _PORTDIR_xxx subdirectory below ${PORTSDIR}/${_SUBDIR_xxx} |
39 |
# _LIB_xxx name of the shared lib |
40 |
# _REQUIRES_xxx also needs these SDL libraries |
41 |
# |
42 |
|
23 |
|
43 |
_SUBDIR_console= devel |
24 |
_SDL_console_LIB_DEPENDS= libSDL_console.so:devel/sdl_console |
44 |
_PORTDIR_console= sdl_console |
25 |
_SDL_console_REQUIRES= sdl |
45 |
_LIB_console= libSDL_console.so |
|
|
46 |
_REQUIRES_console= sdl |
47 |
|
26 |
|
48 |
_SUBDIR_gfx= graphics |
27 |
_SDL_gfx_LIB_DEPENDS= libSDL_gfx.so:graphics/sdl_gfx |
49 |
_PORTDIR_gfx= sdl_gfx |
28 |
_SDL_gfx_REQUIRES= sdl |
50 |
_LIB_gfx= libSDL_gfx.so |
|
|
51 |
_REQUIRES_gfx= sdl |
52 |
|
29 |
|
53 |
_SUBDIR_image= graphics |
30 |
_SDL_image_LIB_DEPENDS= libSDL_image.so:graphics/sdl_image |
54 |
_PORTDIR_image= sdl_image |
31 |
_SDL_image_REQUIRES= sdl |
55 |
_LIB_image= libSDL_image.so |
|
|
56 |
_REQUIRES_image=sdl |
57 |
|
32 |
|
58 |
_SUBDIR_mixer= audio |
33 |
_SDL_mixer_LIB_DEPENDS= libSDL_mixer.so:audio/sdl_mixer |
59 |
_PORTDIR_mixer= sdl_mixer |
34 |
_SDL_mixer_REQUIRES= sdl |
60 |
_LIB_mixer= libSDL_mixer.so |
|
|
61 |
_REQUIRES_mixer=sdl |
62 |
|
35 |
|
63 |
_SUBDIR_mm= devel |
36 |
_SDL_mm_LIB_DEPENDS= libSDLmm.so:devel/sdlmm |
64 |
_PORTDIR_mm= sdlmm |
37 |
_SDL_mm_REQUIRES= sdl |
65 |
_LIB_mm= libSDLmm.so |
|
|
66 |
_REQUIRES_mm= sdl |
67 |
|
38 |
|
68 |
_SUBDIR_net= net |
39 |
_SDL_net_LIB_DEPENDS= libSDL_net.so:net/sdl_net |
69 |
_PORTDIR_net= sdl_net |
40 |
_SDL_net_REQUIRES= sdl |
70 |
_LIB_net= libSDL_net.so |
|
|
71 |
_REQUIRES_net= sdl |
72 |
|
41 |
|
73 |
_SUBDIR_pango= x11-toolkits |
42 |
_SDL_pango_LIB_DEPENDS= libSDL_Pango.so:x11-toolkits/sdl_pango |
74 |
_PORTDIR_pango= sdl_pango |
43 |
_SDL_pango_REQUIRES= sdl |
75 |
_LIB_pango= libSDL_Pango.so |
|
|
76 |
_REQUIRES_pango=sdl |
77 |
|
44 |
|
78 |
_SUBDIR_sdl= devel |
45 |
_SDL_sound_LIB_DEPENDS= libSDL_sound.so:audio/sdl_sound |
79 |
_PORTDIR_sdl= sdl12 |
46 |
_SDL_sound_REQUIRES= sdl |
80 |
_LIB_sdl= libSDL.so |
|
|
81 |
_REQUIRES_sdl= |
82 |
|
47 |
|
83 |
_SUBDIR_sound= audio |
48 |
_SDL_ttf_LIB_DEPENDS= libSDL_ttf.so:graphics/sdl_ttf |
84 |
_PORTDIR_sound= sdl_sound |
49 |
_SDL_ttf_REQUIRES= sdl |
85 |
_LIB_sound= libSDL_sound.so |
|
|
86 |
_REQUIRES_sound=sdl |
87 |
|
50 |
|
88 |
_SUBDIR_ttf= graphics |
51 |
# These are the current supported SDL2 modules |
89 |
_PORTDIR_ttf= sdl_ttf |
52 |
_SDL_USE_ALL+= sdl2 gfx2 image2 mixer2 net2 ttf2 |
90 |
_LIB_ttf= libSDL_ttf.so |
|
|
91 |
_REQUIRES_ttf= sdl |
92 |
|
53 |
|
93 |
_SUBDIR_gfx2= graphics |
54 |
_SDL_sdl2_LIB_DEPENDS= libSDL2.so:devel/sdl20 |
94 |
_PORTDIR_gfx2= sdl2_gfx |
|
|
95 |
_LIB_gfx2= libSDL2_gfx.so |
96 |
_REQUIRES_gfx2= sdl2 |
97 |
|
55 |
|
98 |
_SUBDIR_image2= graphics |
56 |
_SDL_gfx2_LIB_DEPENDS= libSDL2_gfx.so:graphics/sdl2_gfx |
99 |
_PORTDIR_image2= sdl2_image |
57 |
_SDL_gfx2_REQUIRES= sdl2 |
100 |
_LIB_image2= libSDL2_image.so |
|
|
101 |
_REQUIRES_image2= sdl2 |
102 |
|
58 |
|
103 |
_SUBDIR_mixer2= audio |
59 |
_SDL_image2_LIB_DEPENDS= libSDL2_image.so:graphics/sdl2_image |
104 |
_PORTDIR_mixer2= sdl2_mixer |
60 |
_SDL_image2_REQUIRES= sdl2 |
105 |
_LIB_mixer2= libSDL2_mixer.so |
|
|
106 |
_REQUIRES_mixer2= sdl2 |
107 |
|
61 |
|
108 |
_SUBDIR_net2= net |
62 |
_SDL_mixer2_LIB_DEPENDS= libSDL2_mixer.so:audio/sdl2_mixer |
109 |
_PORTDIR_net2= sdl2_net |
63 |
_SDL_mixer2_REQUIRES= sdl2 |
110 |
_LIB_net2= libSDL2_net.so |
|
|
111 |
_REQUIRES_net2= sdl2 |
112 |
|
64 |
|
113 |
_SUBDIR_sdl2= devel |
65 |
_SDL_net2_LIB_DEPENDS= libSDL2_net.so:net/sdl2_net |
114 |
_PORTDIR_sdl2= sdl20 |
66 |
_SDL_net2_REQUIRES= sdl2 |
115 |
_LIB_sdl2= libSDL2.so |
|
|
116 |
_REQUIRES_sdl2= |
117 |
|
67 |
|
118 |
_SUBDIR_ttf2= graphics |
68 |
_SDL_ttf2_LIB_DEPENDS= libSDL2_ttf.so:graphics/sdl2_ttf |
119 |
_PORTDIR_ttf2= sdl2_ttf |
69 |
_SDL_ttf2_REQUIRES= sdl2 |
120 |
_LIB_ttf2= libSDL2_ttf.so |
|
|
121 |
_REQUIRES_ttf2= sdl2 |
122 |
|
70 |
|
123 |
# |
71 |
# Basic checks |
124 |
# If USE_SDL is defined, make dependencies for the libraries |
72 |
.if !empty(sdl_ARGS) |
125 |
# |
73 |
IGNORE= USES=sdl takes no arguments |
126 |
.if !defined(BEFOREPORTMK) |
74 |
.endif |
127 |
.if !defined(SDL_Include_post) |
|
|
128 |
.if defined(USE_SDL) |
129 |
|
75 |
|
130 |
SDL_Include_post= bsd.sdl.mk |
76 |
.if !defined(USE_SDL) |
131 |
|
77 |
IGNORE= need to specify sdl component(s) with USE_SDL |
132 |
# |
|
|
133 |
# Keep some backward compatibility |
134 |
# |
135 |
.if ${USE_SDL}=="yes" |
136 |
USE_SDL= sdl |
137 |
.endif |
78 |
.endif |
138 |
|
79 |
|
139 |
# |
80 |
# Expand implied dependencies on main SDL/SDL2 ports |
140 |
# Check if all the values given in USE_SDL are valid. |
|
|
141 |
# |
142 |
_USE_SDL= |
81 |
_USE_SDL= |
143 |
.for component in ${USE_SDL} |
82 |
.for _component in ${USE_SDL} |
144 |
. if ${_USE_SDL_ALL:M${component}}=="" |
83 |
. if !${_SDL_USE_ALL:M${_component}} |
145 |
IGNORE= cannot install: unknown SDL component ${component} |
84 |
IGNORE= uses unknown SDL component ${_component} |
|
|
85 |
. else |
86 |
_USE_SDL+= ${_component} ${_SDL_${_component}_REQUIRES} |
146 |
. endif |
87 |
. endif |
147 |
_USE_SDL+= ${_REQUIRES_${component}} ${component} |
|
|
148 |
.endfor |
88 |
.endfor |
149 |
|
89 |
|
150 |
# |
90 |
# Provide LIB_DEPENDS |
151 |
# Uniquefy[sp] the list of libs required |
91 |
.for _component in ${_USE_SDL:O:u} |
152 |
# |
92 |
LIB_DEPENDS+= ${_SDL_${_component}_LIB_DEPENDS} |
153 |
__USE_SDL= |
|
|
154 |
.for component in ${_USE_SDL} |
155 |
. if ${__USE_SDL:M${component}}=="" |
156 |
__USE_SDL+= ${component} |
157 |
. endif |
158 |
.endfor |
93 |
.endfor |
159 |
|
94 |
|
160 |
# |
95 |
# Provide dependency on main SDL ports |
161 |
# Finally make the list of libs required |
96 |
.if ${_USE_SDL:Msdl} |
162 |
# |
|
|
163 |
.for component in ${__USE_SDL} |
164 |
LIB_DEPENDS+= ${_LIB_${component}}:${_SUBDIR_${component}}/${_PORTDIR_${component}} |
165 |
.endfor |
166 |
|
167 |
# |
168 |
# "Normal" dependencies and variables |
169 |
# |
170 |
.if ${__USE_SDL:Msdl} != "" |
171 |
BUILD_DEPENDS+= ${SDL_CONFIG}:${_SUBDIR_sdl}/${_PORTDIR_sdl} |
172 |
SDL_CONFIG?= ${LOCALBASE}/bin/sdl-config |
97 |
SDL_CONFIG?= ${LOCALBASE}/bin/sdl-config |
|
|
98 |
BUILD_DEPENDS+= ${SDL_CONFIG}:devel/sdl12 |
173 |
CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} |
99 |
CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} |
174 |
MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} |
100 |
MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} |
175 |
.endif |
101 |
.endif |
176 |
.if ${__USE_SDL:Msdl2} != "" |
102 |
|
177 |
BUILD_DEPENDS+= ${SDL2_CONFIG}:${_SUBDIR_sdl2}/${_PORTDIR_sdl2} |
103 |
.if ${_USE_SDL:Msdl2} |
178 |
SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config |
104 |
SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config |
|
|
105 |
BUILD_DEPENDS+= ${SDL2_CONFIG}:devel/sdl20 |
179 |
CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} |
106 |
CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} |
180 |
MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} |
107 |
MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} |
181 |
.endif |
108 |
.endif |
182 |
|
109 |
|
|
|
110 |
# _INCLUDE_USES_SDL_MK |
183 |
.endif |
111 |
.endif |
184 |
.endif |
112 |
|
185 |
.endif |
|
|