OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
1 | #!/bin/sh |
2 | |
3 | prefix=$1/usr |
4 | exec_prefix=$1/usr |
5 | exec_prefix_set=no |
6 | moduledir=${exec_prefix}/lib/directfb-1.4-0 |
7 | |
8 | usage() |
9 | { |
10 | cat <<EOF |
11 | Usage: directfb-config [OPTIONS] [LIBRARIES] |
12 | Options: |
13 | [--prefix[=DIR]] |
14 | [--exec-prefix[=DIR]] |
15 | [--version] |
16 | [--libs] |
17 | [--cflags] |
18 | |
19 | For static linking: |
20 | [--input=<driver>[,<driver>]...] (default: none) |
21 | [--graphics=<driver>[,<driver>]...] (default: none) |
22 | [--system=<system>[,<system>]...] (default: 'fbdev') |
23 | [--wm=<wm>[,<wm>]...] (default: 'default') |
24 | [--font=<impl>[,<impl>]...] (default: none) |
25 | [--imageprovider=<impl>[,<impl>]...] (default: none) |
26 | [--videoprovider=<impl>[,<impl>]...] (default: none) |
27 | [--fusionsound] |
28 | [--voodoo] |
29 | |
30 | Example for static linking: |
31 | directfb-config --libs --graphics=matrox,r200 |
32 | --input=linux_input --font=ft2 |
33 | --imageprovider=jpeg,png,gif |
34 | EOF |
35 | exit $2 |
36 | } |
37 | |
38 | if test $# -eq 0; then |
39 | usage 1 1>&2 |
40 | fi |
41 | |
42 | lib_directfb=yes |
43 | lib_avifile=no |
44 | |
45 | while test $# -gt 1; do |
46 | case "$2" in |
47 | -*=*) optarg=`echo "$2" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
48 | *) optarg= ;; |
49 | esac |
50 | |
51 | case $2 in |
52 | --prefix=*) |
53 | prefix=$optarg |
54 | if test $exec_prefix_set = no ; then |
55 | exec_prefix=$optarg |
56 | fi |
57 | ;; |
58 | --prefix) |
59 | echo_prefix=yes |
60 | ;; |
61 | --exec-prefix=*) |
62 | exec_prefix=$optarg |
63 | exec_prefix_set=yes |
64 | ;; |
65 | --exec-prefix) |
66 | echo_exec_prefix=yes |
67 | ;; |
68 | --version) |
69 | echo 1.4.2 |
70 | ;; |
71 | --cflags) |
72 | echo_cflags=yes |
73 | ;; |
74 | --libs) |
75 | echo_libs=yes |
76 | ;; |
77 | directfb) |
78 | lib_directfb=yes |
79 | ;; |
80 | avifile) |
81 | lib_avifile=yes |
82 | ;; |
83 | --input=*) |
84 | if test -z "$optarg"; then |
85 | usage 2 1>&2 |
86 | fi |
87 | |
88 | for i in `echo $optarg | sed 's/,/ /g'`; do |
89 | echo_input="$echo_input $moduledir/inputdrivers/libdirectfb_$i.o" |
90 | done |
91 | |
92 | echo_static=yes |
93 | ;; |
94 | --graphics=*) |
95 | if test -z "$optarg"; then |
96 | usage 2 1>&2 |
97 | fi |
98 | |
99 | for i in `echo $optarg | sed 's/,/ /g'`; do |
100 | echo_graphics="$echo_graphics $moduledir/gfxdrivers/libdirectfb_$i.o" |
101 | done |
102 | |
103 | echo_static=yes |
104 | ;; |
105 | --font=*) |
106 | if test -z "$optarg"; then |
107 | usage 2 1>&2 |
108 | fi |
109 | |
110 | for i in `echo $optarg | sed 's/,/ /g'`; do |
111 | echo_font="$echo_font $moduledir/interfaces/IDirectFBFont/libidirectfbfont_$i.o" |
112 | case $i in |
113 | ft2) |
114 | echo_font="$echo_font -lfreetype" |
115 | ;; |
116 | esac |
117 | done |
118 | |
119 | echo_static=yes |
120 | ;; |
121 | --system=*) |
122 | if test -z "$optarg"; then |
123 | usage 2 1>&2 |
124 | fi |
125 | |
126 | for i in `echo $optarg | sed 's/,/ /g'`; do |
127 | echo_system="$echo_system $moduledir/systems/libdirectfb_$i.o" |
128 | case $i in |
129 | fbdev) |
130 | echo_system="$echo_system " |
131 | ;; |
132 | sdl) |
133 | echo_system="$echo_system " |
134 | ;; |
135 | esac |
136 | done |
137 | |
138 | echo_static=yes |
139 | ;; |
140 | --wm=*) |
141 | if test -z "$optarg"; then |
142 | usage 2 1>&2 |
143 | fi |
144 | |
145 | for i in `echo $optarg | sed 's/,/ /g'`; do |
146 | echo_wm="$echo_wm $moduledir/wm/libidirectfb_$i.o" |
147 | case $i in |
148 | unique) |
149 | echo_wm="$echo_wm -luniquewm" |
150 | ;; |
151 | esac |
152 | done |
153 | |
154 | echo_static=yes |
155 | ;; |
156 | --imageprovider=*) |
157 | if test -z "$optarg"; then |
158 | usage 2 1>&2 |
159 | fi |
160 | |
161 | for i in `echo $optarg | sed 's/,/ /g'`; do |
162 | echo_imageprovider="$echo_imageprovider $moduledir/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_$i.o" |
163 | case $i in |
164 | imlib2) |
165 | echo_imageprovider="$echo_imageprovider -lImlib2 -lttf -lm -lXext -lX11" |
166 | ;; |
167 | jpeg) |
168 | echo_imageprovider="$echo_imageprovider -ljpeg" |
169 | ;; |
170 | png) |
171 | echo_imageprovider="$echo_imageprovider -lpng -lz -lm" |
172 | ;; |
173 | gif) |
174 | ;; |
175 | esac |
176 | done |
177 | |
178 | echo_static=yes |
179 | ;; |
180 | --videoprovider=*) |
181 | if test -z "$optarg"; then |
182 | usage 2 1>&2 |
183 | fi |
184 | |
185 | for i in `echo $optarg | sed 's/,/ /g'`; do |
186 | echo_videoprovider="$echo_videoprovider $moduledir/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_$i.o" |
187 | case $i in |
188 | libmpeg3) |
189 | echo_videoprovider="$echo_videoprovider -lmpeg3" |
190 | ;; |
191 | swf) |
192 | echo_videoprovider="$echo_videoprovider -ljpeg -lz" |
193 | ;; |
194 | openquicktime) |
195 | echo_videoprovider="$echo_videoprovider -lopenquicktime -lz -lglib -lm" |
196 | ;; |
197 | esac |
198 | done |
199 | |
200 | echo_static=yes |
201 | ;; |
202 | --fusionsound) |
203 | echo_fusionsound="-Wl,-uIFusionSound_default -lifusionsound" |
204 | echo_static=yes |
205 | ;; |
206 | --voodoo) |
207 | echo_voodoo=yes |
208 | echo_static=yes |
209 | ;; |
210 | *) |
211 | usage 1 1>&2 |
212 | ;; |
213 | esac |
214 | shift |
215 | done |
216 | |
217 | if test "$echo_prefix" = "yes"; then |
218 | echo $prefix |
219 | fi |
220 | |
221 | if test "$echo_exec_prefix" = "yes"; then |
222 | echo $exec_prefix |
223 | fi |
224 | |
225 | if test "$echo_cflags" = "yes"; then |
226 | if test ${prefix}/include/directfb != /usr/include ; then |
227 | cflags="-I${SYSROOT}${prefix}/include/directfb" |
228 | fi |
229 | echo $cflags -D_REENTRANT |
230 | fi |
231 | |
232 | if test -n "$echo_static"; then |
233 | echo -static |
234 | |
235 | if test -z "$echo_system"; then |
236 | echo $moduledir/systems/libdirectfb_fbdev.o |
237 | fi |
238 | |
239 | if test -z "$echo_wm"; then |
240 | echo $moduledir/wm/libdirectfbwm_default.o |
241 | fi |
242 | fi |
243 | |
244 | |
245 | if test -n "$echo_font"; then |
246 | echo $echo_font |
247 | fi |
248 | |
249 | if test -n "$echo_imageprovider"; then |
250 | echo $echo_imageprovider |
251 | fi |
252 | |
253 | if test -n "$echo_videoprovider"; then |
254 | echo $echo_videoprovider |
255 | fi |
256 | |
257 | |
258 | if test -n "$echo_input"; then |
259 | echo $echo_input |
260 | fi |
261 | |
262 | if test -n "$echo_graphics"; then |
263 | echo $echo_graphics |
264 | fi |
265 | |
266 | if test -n "$echo_system"; then |
267 | echo $echo_system |
268 | fi |
269 | |
270 | if test -n "$echo_wm"; then |
271 | echo $echo_wm |
272 | fi |
273 | |
274 | if test -n "$echo_fusionsound"; then |
275 | echo -L${SYSROOT}$moduledir/interfaces/IFusionSound $echo_fusionsound |
276 | fi |
277 | |
278 | |
279 | print_voodoo () |
280 | { |
281 | echo $moduledir/interfaces/$1/lib$2_dispatcher.o $moduledir/interfaces/$1/lib$2_requestor.o |
282 | } |
283 | |
284 | if test -n "$echo_voodoo"; then |
285 | print_voodoo IDirectFB idirectfb |
286 | print_voodoo IDirectFBDataBuffer idirectfbdatabuffer |
287 | print_voodoo IDirectFBDisplayLayer idirectfbdisplaylayer |
288 | print_voodoo IDirectFBEventBuffer idirectfbeventbuffer |
289 | print_voodoo IDirectFBFont idirectfbfont |
290 | print_voodoo IDirectFBImageProvider idirectfbimageprovider |
291 | print_voodoo IDirectFBInputDevice idirectfbinputdevice |
292 | print_voodoo IDirectFBPalette idirectfbpalette |
293 | print_voodoo IDirectFBScreen idirectfbscreen |
294 | print_voodoo IDirectFBSurface idirectfbsurface |
295 | print_voodoo IDirectFBWindow idirectfbwindow |
296 | echo -lvoodoo |
297 | fi |
298 | |
299 | if test "$echo_libs" = "yes"; then |
300 | libs=-L${SYSROOT}${exec_prefix}/lib |
301 | |
302 | if test "$lib_directfb" = "yes"; then |
303 | libs="$libs -ldirectfb -lfusion -ldirect -lpthread" |
304 | |
305 | if test -n "$echo_static"; then |
306 | libs="$libs -ldl -lz" |
307 | fi |
308 | fi |
309 | |
310 | if test "$lib_avifile" = "yes"; then |
311 | libs="$libs @AVIFILE_LIBS@" |
312 | fi |
313 | |
314 | echo $libs |
315 | fi |
316 |