forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.linux
executable file
·601 lines (511 loc) · 12.7 KB
/
configure.linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
#!/bin/bash
#
# HTS configure script
#
# Copyright (c) 2005-2009 Andreas Öman
#
# Based on FFmpeg's configure script:
#
# Copyright (c) 2000-2002 Fabrice Bellard
# Copyright (c) 2005-2008 Diego Biurrun
# Copyright (c) 2005-2008 Mans Rullgard
#
PLATFORM="linux"
DEFAULT_UI="glw"
GLWFRONTEND="x11"
CONFIGURE_POSTFIX="linux"
source support/configure.inc
CPU=generic
ARCH=`uname -m`
prefix=/usr/local
bindir="\${prefix}/bin"
mandir="\${prefix}/share/man"
datadir="\${prefix}/share/showtime"
libdir="\${prefix}/lib/showtime"
CC=cc
CXX=c++
show_help(){
common_help
echo " --prefix=PREFIX Install in PREFIX [$prefix]"
echo " --bindir=DIR Install binaries in DIR [$bindir]"
echo " --mandir=DIR Install man pages in DIR [$mandir]"
echo " --datadir=DIR Install data files in DIR [$datadir]"
echo " --libdir=DIR Install libraries in DIR [$libdir]"
echo " --arch=ARCH Build for this architecture [$ARCH]"
echo " --cpu=CPU Build and optimize for specific CPU"
echo " --cc=CC Build using compiler CC [$CC]"
echo " --glw-frontend=FRONTEND Build GLW for FRONTEND [$GLWFRONTEND]"
echo " x11 X11 Windows"
echo " none Disable GLW"
echo " --pkg-config-path=PATH Extra paths for pkg-config"
exit 1
}
check_header() {
cat >$TMPDIR/1.c <<EOF
#include <$1>
int main() {
return 0;
}
EOF
$CC 2>/dev/null $TMPDIR/1.c -o $TMPDIR/1.bin
}
check_header_cpp() {
cat >$TMPDIR/1.cpp <<EOF
#include <$1>
int main() {
return 0;
}
EOF
$CXX $TMPDIR/1.cpp -o $TMPDIR/1.bin
}
check_lib() {
cat >$TMPDIR/1.c <<EOF
int main() {
return 0;
}
EOF
$CC 2>/dev/null $TMPDIR/1.c -o $TMPDIR/1.bin -l$1
}
fatal() {
echo "$1: $2"
echo "configure with --disable-$1 to skip this module"
die
}
enable libpthread
enable zlib
enable dvd
enable libfreetype
enable libfontconfig
enable libpulse
enable lirc
enable stdin
enable gu
enable avahi
enable libxss
enable libxv
enable openssl
enable locatedb
enable vdpau
enable libxxf86vm
enable httpserver
enable timegm
enable inotify
enable realpath
enable webkit
enable librtmp
enable vmir
#enable airplay -- not functional yet
#enable libxrandr -- code does not really work yet
[ -f project.config ] && source project.config
for opt do
optval="${opt#*=}"
case "$opt" in
--cpu=*) CPU="$optval"
;;
--help) show_help
;;
--cc=*) CC="$optval"
;;
--cxx=*) CXX="$optval"
;;
--arch=*) ARCH="$optval"
;;
--glw-frontend=*) GLWFRONTEND="$optval"
;;
--pkg-config-path=*) export PKG_CONFIG_PATH="$optval"
;;
--prefix=*)
prefix="$optval"
;;
--bindir=*)
bindir="$optval"
;;
--mandir=*)
mandir="$optval"
;;
--datadir=*)
datadir="$optval"
;;
--libdir=*)
libdir="$optval"
;;
--includedir=*)
;;
--infodir=*)
;;
--sysconfdir=*)
;;
--localstatedir=*)
;;
--libexecdir=*)
;;
--disable-maintainer-mode)
;;
--disable-dependency-tracking)
;;
--disable-silent-rules)
;;
*)
common_opt $opt $optval
esac
done
setup_env "$@"
#
# pkgconfig
#
which >/dev/null pkg-config
if [ $? -ne 0 ]; then
echo "pkg-config not found. Can not configure."
die
fi
#
# Check for compilers
#
checkcc() {
cat >$TMPDIR/1.c <<EOF
int main() {
return 0;
}
EOF
$CC 2>/dev/null $TMPDIR/1.c -o $TMPDIR/1.bin
}
checkcxx() {
cat >$TMPDIR/1.cpp <<EOF
int main() {
return 0;
}
EOF
$CXX 2>/dev/null $TMPDIR/1.cpp -o $TMPDIR/1.bin
}
if checkcc; then
echo "Using C compiler: $CC"
else
echo "C compiler ($CC) is not working"
die
fi
if checkcxx; then
echo "Using C++ compiler: $CXX"
else
echo "C++ compiler ($CXX) is not working"
die
fi
#
# sqlite3
#
if pkg-config sqlite3; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs sqlite3`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags sqlite3`
echo "Using Sqlite3: `pkg-config --modversion sqlite3`"
disable sqlite_internal
else
echo "sqlite3 not found"
die
fi
#
# libfreetype2
#
if enabled libfreetype; then
if pkg-config freetype2; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs freetype2`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags freetype2`
echo "Using Freetype2: `pkg-config --modversion freetype2`"
else
echo "FreeType 2 not found"
echo "To compile without it, configure with: --disable-libfreetype"
die
fi
fi
#
# libfontconfig
#
if enabled libfontconfig; then
if pkg-config fontconfig; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs fontconfig`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags fontconfig`
echo "Using libfontconfig: `pkg-config --modversion fontconfig`"
else
echo "libfontconfig not found"
echo "To compile without it, configure with: --disable-libfontconfig"
die
fi
fi
#
# libx11
#
if pkg-config x11; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags x11`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs x11`
echo "Using libX11: `pkg-config --modversion x11`"
enable libx11
fi
#
# libxext
#
if pkg-config xext; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags xext`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs xext`
echo "Using libXext: `pkg-config --modversion xext`"
enable libxext
fi
#
# GLW frontend
#
case "$GLWFRONTEND" in
x11)
enable glw_frontend_x11
;;
none)
;;
*)
echo "Invalid GLW frontend: $GLWFRONTEND"
die
esac
echo "Using GLW Frontend: $GLWFRONTEND"
#
# GLW on X11
#
if enabled glw_frontend_x11; then
if disabled libfreetype; then
echo "glw-x11 depends on libfreetype"
die
fi
if disabled libx11; then
echo "glw-x11 depends on libx11"
die
fi
if disabled libxext; then
echo "glw-x11 depends on libxext"
die
fi
check_header "X11/Xlib.h" || fatal "glw" "Missing X11 include file X11/Xlib.h"
if pkg-config gl ; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags gl`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gl`
echo "Using GL: `pkg-config --modversion gl`"
else
check_header "GL/gl.h" || fatal "glw-x11" "Missing OpenGL include file GL/gl.h"
check_header "GL/glx.h" || fatal "glw-x11" "Missing OpenGL include file GL/glx.h"
check_lib "GL" || fatal "glw-x11" "Unable to link with libGL"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -lGL"
fi
enable glw_backend_opengl
enable glw_rec
enable glw
else
disable vdpau
disable libxss
disable libxxf86vm
disable libxrandr
fi
#
# libasound (ALSA)
#
if enabled libasound; then
disable libpulse
if pkg-config alsa; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags alsa`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs alsa`
echo "Using ALSA: `pkg-config --modversion alsa`"
else
echo "libasound (ALSA) development files not found."
echo "To compile without it, configure with: --disable-libasound"
die
fi
fi
#
# libpulse (PulseAudio)
#
if enabled libpulse; then
if pkg-config libpulse; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags libpulse`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs libpulse`
echo "Using libpulse: `pkg-config --modversion libpulse`"
else
echo "libpulse (PulseAudio) development files not found."
echo "To compile without it, configure with: --disable-libpulse"
die
fi
fi
#
# GTK2 UI
#
if enabled gu; then
if pkg-config gtk+-2.0 && pkg-config gthread-2.0; then
if disabled libx11; then
echo "GU depends on libx11"
die
fi
if disabled libxext; then
echo "GU depends on libxext"
die
fi
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gtk+-2.0`
echo >>${CONFIG_MAK} "CFLAGS_GTK += " `pkg-config --cflags gtk+-2.0`
echo "Using GTK+: `pkg-config --modversion gtk+-2.0`"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gthread-2.0`
echo >>${CONFIG_MAK} "CFLAGS_GTK += " `pkg-config --cflags gthread-2.0`
echo "Using GTK Threading: `pkg-config --modversion gthread-2.0`"
else
echo "GTK2 not found. Unable to build GU (GTK user interface)."
echo "To compile without it, configure with: --disable-gu"
die
fi
else
disable libxv
fi
#
# webkit
#
if enabled webkit; then
if pkg-config webkit-1.0; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs webkit-1.0`
echo >>${CONFIG_MAK} "CFLAGS_GTK += " `pkg-config --cflags webkit-1.0`
echo "Using WebKit: `pkg-config --modversion webkit-1.0`"
enable webpopup
else
echo "libwebkitgtk development files not found."
echo "To compile without it, configure with: --disable-webkit"
die
fi
fi
#
# libXss (Screen saver control library)
#
if enabled libxss; then
if pkg-config xscrnsaver; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags xscrnsaver`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs xscrnsaver`
echo "Using libxscrnsaver: `pkg-config --modversion xscrnsaver`"
else
echo "libXss not found. Unable to build with screensaver disable support."
die
fi
fi
#
# libxxf86vm
#
if enabled libxxf86vm; then
if pkg-config xxf86vm; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags xxf86vm`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs xxf86vm`
echo "Using libxxf86vm: `pkg-config --modversion xxf86vm`"
else
echo "libxxf86vm not found. Unable to build with X11 video mode control."
die
fi
fi
#
# libxrandr
#
if enabled libxrandr; then
if pkg-config xrandr; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags xrandr`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs xrandr`
echo "Using libxrandr: `pkg-config --modversion xrandr`"
else
echo "libxrandr not found. Unable to build with X11 video mode control."
die
fi
fi
#
# libxv (Xvideo)
#
if enabled libxv; then
if pkg-config xv; then
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags xv`
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs xv`
echo "Using libXv: `pkg-config --modversion xv`"
else
echo "libXv not found. Unable to build with Xv support."
die
fi
fi
#
# AVAHI
#
if enabled avahi; then
if pkg-config avahi-client; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs avahi-client`
echo >>${CONFIG_MAK} "CFLAGS_AVAHI += "`pkg-config --cflags avahi-client`
echo "Using AVAHI client: `pkg-config --modversion avahi-client`"
else
echo "avahi-client not found. Unable to build with AVAHI support."
echo "To compile without it, configure with: --disable-avahi"
die
fi
fi
#
# polarssl
#
if enabled polarssl; then
disable openssl
fi
#
# OpenSSL
#
if enabled openssl; then
if pkg-config openssl; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs openssl`
echo "Using openssl: `pkg-config --modversion openssl`"
elif pkg-config libssl; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs libssl`
echo "Using libssl: `pkg-config --modversion libssl`"
else
echo "libssl or openssl not found"
echo "To compile without it, configure with: --disable-ssl"
echo "To build with built-in version of polarssl, configure with --enable-polarssl"
die
fi
fi
#
# VDPAU
#
if enabled vdpau; then
if pkg-config vdpau; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs vdpau`
echo "Using libvdpau: `pkg-config --modversion vdpau`"
else
echo "VDPAU not found"
echo "To compile without it, configure with: --disable-vdpau"
die
fi
fi
#
# NVCtrl
#
if enabled nvctrl; then
check_header "NVCtrl/NVCtrl.h" || fatal "nvctrl" "Missing include file NVCtrl/NVCtrl.h"
check_lib "XNVCtrl" || fatal "nvctrl" "Unable to link with libXNVCtrl"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -lXNVCtrl"
fi
#
# Check for valgrind include files
#
if pkg-config valgrind; then
enable valgrind
echo "Valgrind development environment detected"
fi
LIBAV_ARCH_FLAGS="--disable-shared --enable-static"
ext_setup
#
# Finalize
#
echo
echo "Installation paths:"
echo " Prefix: ${prefix}"
echo " Binaries: ${bindir}"
echo " Man pages: ${mandir}"
echo " Data files: ${datadir}"
echo " Libraries: ${libdir}"
echo
echo >>${CONFIG_MAK} "prefix=$prefix"
echo >>${CONFIG_MAK} "bindir=\${DESTDIR}$bindir"
echo >>${CONFIG_MAK} "mandir=\${DESTDIR}$mandir"
echo >>${CONFIG_MAK} "datadir=\${DESTDIR}$datadir"
echo >>${CONFIG_MAK} "libdir=\${DESTDIR}$libdir"
echo >>${CONFIG_MAK} LDFLAGS_cfg += -lpthread -lrt -ldl
eval datadirpath=${datadir}
echo >>${CONFIG_H} "#define SHOWTIME_DATADIR \"${datadirpath}\""
eval libdirpath=${libdir}
echo >>${CONFIG_H} "#define SHOWTIME_LIBDIR \"${libdirpath}\""
finalize