forked from MythTV/mythtv
/
configure
executable file
·941 lines (800 loc) · 24.1 KB
/
configure
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
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
#!/bin/sh
#
# Configure script for mythplugins
#
###
# functions from ffmpeg's configure
log(){
echo "$@" >> $logfile
}
log_file(){
log BEGIN $1
pr -n -t $1 >> $logfile
log END $1
}
echolog(){
log "$@"
echo "$@"
}
set_all(){
value=$1
shift
for var in $*; do
eval $var=$value
done
}
enable(){
set_all yes $*
}
disable(){
set_all no $*
}
enabled(){
test "${1#!}" = "$1" && op== || op=!=
eval test "x\$${1#!}" $op "xyes"
}
disabled(){
test "${1#!}" = "$1" && op== || op=!=
eval test "x\$${1#!}" $op "xno"
}
enabled_all(){
for opt; do
enabled $opt || return 1
done
}
disabled_all(){
for opt; do
disabled $opt || return 1
done
}
enabled_any(){
for opt; do
enabled $opt && return 0
done
}
disabled_any(){
for opt; do
disabled $opt && return 0
done
return 1
}
is_in(){
value=$1
shift
for var in $*; do
[ $var = $value ] && return 0
done
return 1
}
check_cmd(){
log "$@"
"$@" >> $logfile 2>&1
}
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
die(){
echolog "$@"
cat <<EOF
If you think configure made a mistake, make sure that you are using the latest
version of MythTV from git. If the latest version fails, report the problem to the
mythtv-dev@mythtv.org mailing list or IRC #mythtv on irc.freenode.net
EOF
cat <<EOF
Include the log file "$logfile" produced by configure as this will help
solving the problem.
EOF
exit 1
}
append(){
var=$1
shift
eval "$var=\"\$$var $*\""
}
prepend(){
var=$1
shift
eval "$var=\"$* \$$var\""
}
check_cmd(){
log "$@"
"$@" >> $logfile 2>&1
}
filter_cflags=echo
filter_cppflags=echo
filter_cxxflags=echo
filter_cxxppflags=echo
check_cc(){
log check_cc "$@"
cat > $TMPC
log_file $TMPC
check_cmd $CC $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
}
check_cpp(){
log check_cpp "$@"
cat > $TMPC
log_file $TMPC
check_cmd $CC $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
}
check_ld(){
log check_ld "$@"
flags=''
libs=''
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
check_cc $($filter_cflags $flags) || return
check_cmd $LD $LDFLAGS $flags -o $TMPE $TMPO $libs $EXTRALIBS
}
check_header(){
log check_header "$@"
header=$1
shift
check_cpp "$@" <<EOF
#include <$header>
int x;
EOF
}
check_func(){
log check_func "$@"
func=$1
shift
check_ld "$@" <<EOF
extern int $func();
int main(void){ $func(); }
EOF
}
check_func_headers(){
log check_func_headers "$@"
headers=$1
func=$2
shift 2
incs=""
for hdr in $headers; do
incs="$incs
#include <$hdr>"
done
check_ld "$@" <<EOF
$incs
int main(int argc, char **argv){
return (long) $func;
}
EOF
}
check_lib(){
log check_lib "$@"
header="$1"
func="$2"
shift 2
check_header $header && check_func $func "$@"
}
check_lib2(){
log check_lib2 "$@"
headers="$1"
func="$2"
shift 2
check_func_headers "$headers" $func "$@"
}
#CXX related tests
check_header_cxx(){
log check_header_cxx "$@"
header=$1
shift
check_cxx "$@" <<EOF
#include <$header>
int x;
EOF
}
add_ldflags(){
append LDFLAGS "$@"
}
add_cxxflags(){
append ECXXFLAGS "$@"
}
check_cxx(){
log check_cxx "$@"
cat > $TMPCXX
log_file $TMPCXX
check_cmd $CXX $CXXPPFLAGS $ECXXFLAGS "$@" -c -o $TMPO $TMPCXX
}
check_ld_cxx(){
log check_ld_cxx "$@"
flags=''
libs=''
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
check_cxx $($filter_cxxflags $flags) || return
check_cmd $CXX $LDFLAGS $flags -o $TMPE $TMPO $libs
}
check_func_cxx(){
log check_func_cxx "$@"
func=$1
header=$2
shift 2
disable $(echo $func | sed -e 's/:://g')
check_ld_cxx "$@" <<EOF
#include <$header>
int main(void){ $func(); }
EOF
}
check_lib_cxx(){
log check_lib_cxx "$@"
header="$1"
func="$2"
shift 2
check_header_cxx $header && check_func_cxx $func $header "$@"
}
#
# default parameters for all plugins
#
PLUGIN_LIST="
archive
browser
flix
gallery
game
music
netvision
news
weather
zoneminder
"
CONFIG_LIST="
opengl
fftw
exif
newexif
dcraw
cdio
"
DEPEND_LIST="
vorbis
flac
mp3lame
taglib
"
enable $PLUGIN_LIST $CONFIG_LIST $DEPEND_LIST
prefix="/usr/local"
libdir_name="lib"
sysroot=""
ln_s="ln -sf"
logfile="config.ep"
cc="gcc"
qmake="qmake"
python="python"
targetos=`uname -s`
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF
Usage: configure [options]
Options: [defaults in brackets after descriptions]
NB: all --enable-* options can be reversed with --disable-*
Generic options:
--prefix=PREFIX MythTV install location PREFIX [$prefix]
--sysroot=SYSROOT MythTV sysroot location SYSROOT [$sysroot]
--qmake=QMAKE use specified qmake [$qmake]
--python=PATH Force a specific python executable to use [$python]
--libdir-name=LIBNAME install/look for libs in PREFIX/LIBNAME [$libdir_name]
--help print this message
--enable-all Enable all options
--enable-opengl enable OpenGL (Music and Gallery) [$opengl]
--previous use previous configure parameters if possible
MythArchive related options:
--enable-mytharchive build the mytharchive plugin [$archive]
MythBrowser related options:
--enable-mythbrowser build the mythbrowser plugin [$browser]
MythGallery related options:
--enable-mythgallery build the mythgallery plugin [$gallery]
--enable-exif enable reading of EXIF headers [$exif]
--enable-new-exif use libexif > version 0.6.9 [$newexif]
--enable-dcraw use dcraw to view raw photos [$dcraw]
--icc-profile=PROFILE ICC profile for dcraw decoding [$icc]
MythGame related options:
--enable-mythgame build the mythgame plugin [$game]
MythMusic related options:
--enable-mythmusic build the mythmusic plugin [$music]
--enable-fftw enable fftw visualizers [$fftw]
MythNetvision related options:
--enable-mythnetvision build the mythnetvision plugin [$netvision]
MythNews related options:
--enable-mythnews build the mythnews plugin [$news]
MythWeather related options:
--enable-mythweather build the mythweather plugin [$weather]
MythZoneMinder related options:
--enable-mythzoneminder build the mythzoneminder plugin [$zoneminder]
EOF
exit 0
fi
if [ -e config.log ] ; then
PCONF=`cat config.log | tail -n 1 | grep configure`
if test x"$PCONF" != x"" ; then
PCONF=`echo $PCONF | sed 's/.\/configure//g'`
fi
for opt do
if test x"$opt" != x"--prev" -a x"$opt" != x"--previous" ; then
OTHOPT="$OTHOPT$opt"
fi
if test x"$opt" = x"--prev" -o x"$opt" = x"--previous" ; then
if test x"$PCONF" != "--prev" ; then
PREV="yes";
fi
fi
done
if test x"$PREV" = x"yes"; then
echo "Options: $PCONF $OTHOPT"
./configure $PCONF $OTHOPT
exit
fi
fi
CMDLINE_SET="
logfile
qmake
python
sysroot
"
CONFIGURATION_OPTS=""
for opt do
CONFIGURATION_OPTS="$CONFIGURATION_OPTS ""$opt"
done
date >> config.log
echo " $0$CONFIGURATION_OPTS" >> config.log
for opt do
optval="${opt#*=}"
case "$opt" in
--targetos=*) targetos=`echo $opt | cut -d '=' -f 2`
;;
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
;;
--libdir-name=*) libdir_name=`echo $opt | cut -d '=' -f 2`;
;;
--enable-myth?*|--disable-myth?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-myth/ option=/;s/-/_/g')
if is_in $option $PLUGIN_LIST; then
$action $option
else
die_unknown $opt
fi
;;
--enable-new-exif) enable exif newexif
;;
--disable-new-exif) disable newexif
;;
--enable-dcraw) dcraw="yes"
;;
--disable-dcraw) dcraw="no"
;;
--icc-profile=*) icc=`echo $opt | cut -d '=' -f 2`
;;
--enable-all)
enable $PLUGIN_LIST $CONFIG_LIST
;;
--disable-all)
disable $PLUGIN_LIST $CONFIG_LIST
;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
if is_in $option $CONFIG_LIST; then
$action $option
else
die_unknown $opt
fi
;;
*)
optname="${opt%%=*}"
optname="${optname#--}"
optname=$(echo "$optname" | sed 's/-/_/g')
if is_in $optname $CMDLINE_SET; then
eval $optname='$optval'
fi
esac
done
check_py_lib(){
log check_py_lib "$@"
lib=${1}
check_cmd $python <<EOF
from distutils.sysconfig import get_python_lib
import sys
sys.path.append(get_python_lib(prefix='${prefix}'))
try:
import $lib
except:
sys.exit(1)
sys.exit(0)
EOF
}
# set temporary file name
: ${TMPDIR:=$TEMPDIR}
: ${TMPDIR:=$TMP}
: ${TMPDIR:=/tmp}
if ! check_cmd type mktemp; then
# simple replacement for missing mktemp
# NOT SAFE FOR GENERAL USE
mktemp(){
echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
}
fi
tmpfile(){
tmp=$(mktemp -u "${TMPDIR}/mythplugins_conf.XXXXXXXX")$2 &&
(set -C; exec > $tmp) 2>/dev/null ||
die "Unable to create temporary file in $TMPDIR."
append TMPFILES $tmp
eval $1=$tmp
}
trap 'rm -f -- $TMPFILES' EXIT
trap exit HUP INT TERM
tmpfile TMPC .c
tmpfile TMPE $EXESUF
tmpfile TMPH .h
tmpfile TMPO .o
tmpfile TMPS .S
tmpfile TMPV .ver
tmpfile TMPSH .sh
tmpfile TMPCXX .cpp
tmpfile TMPASM .asm
tmpfile TMPMAK .mak
unset -f mktemp
# make sure we can execute files in $TMPDIR
cat > $TMPSH 2>> $logfile <<EOF
#! /bin/sh
EOF
chmod +x $TMPSH >> $logfile 2>&1
if ! $TMPSH >> $logfile 2>&1; then
cat <<EOF
Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
EOF
die "Sanity test failed."
fi
is_qmake4(){
$1 --version 2>&1 | egrep -q -e "Qt version 4\.[5-9]\.[0-9]"
}
# bring in mythtv config
if [ -e $prefix/include/mythtv/mythconfig.mak ] ; then
rm mythconfig.mak 2> /dev/null
${ln_s} $prefix/include/mythtv/mythconfig.mak mythconfig.mak
else
echo "ERROR: mythconfig.mak not found at $prefix/include/mythtv/mythconfig.mak"
echo "Did you make AND install MythTV first?"
echo "Are you using the correct prefix ($prefix)?"
echo "Bailing out!!"
exit
fi
#Set build env variables according to mythconfig.mak
LD=$(cat mythconfig.mak | grep -e "^LD=")
LD=${LD#LD=}
CC=$(cat mythconfig.mak | grep -e "^CC=")
CC=${CC#CC=}
CFLAGS=$(cat mythconfig.mak | grep -e "^CFLAGS=")
CFLAGS=${CFLAGS#CFLAGS=}
CPPFLAGS=$(cat mythconfig.mak | grep -e "^CPPFLAGS=")
CPPFLAGS=${CPPFLAGS#CPPFLAGS=}
LDFLAGS=$(cat mythconfig.mak | grep -e "^LDFLAGS=")
LDFLAGS=${LDFLAGS#LDFLAGS=}
CXX=$(cat mythconfig.mak | grep -e "^QMAKE_CXX=")
CXX=${CXX#QMAKE_CXX=}
ECXXFLAGS=$(cat mythconfig.mak | grep -e "^ECXXFLAGS=")
ECXXFLAGS=${ECXXFLAGS#ECXXFLAGS=}
CXXPPFLAGS=$(cat mythconfig.mak | grep -e "^CXXPPFLAGS=")
CXXPPFLAGS=${CXXPPFLAGS#CXXPPFLAGS=}
OPENGLV=$(cat mythconfig.mak | grep -e "^CONFIG_OPENGL_VIDEO=yes")
EXTRALIBS=$(cat mythconfig.mak | grep -e "^EXTRALIBS=")
EXTRALIBS=${EXTRALIBS#EXTRALIBS=}
if ! is_qmake4 $qmake; then
is_qmake4 qmake-qt4 && qmake=qmake-qt4 || die "qmake for Qt4.6 or newer not found.\nPlease specify the correct qmake with --qmake="
fi
if ! expr $($qmake -query QT_VERSION) : "4\.[6-9]\.[0-9]" >/dev/null; then
die "Qt4.6 or newer is required to build MythTV."
fi
# rely on what was discover during MythTV configure
if enabled opengl && test "$OPENGLV" != "CONFIG_OPENGL_VIDEO=yes"; then
disable opengl
fi
#Test if fftw_lib3 is available
if enabled fftw &&! check_lib2 fftw3.h fftw_init_threads -lfftw3_threads -lfftw3f -lfftw3 ; then
disable fftw
fi
if ! check_lib libexif/exif-data.h exif_loader_new -lexif ; then
disable exif
fi
if enabled netvision; then
disable_netvision(){
msg="$1"
echo "MythNetvision requires the $msg"
disable netvision
}
check_py_lib MythTV || disable_netvision "MythTV Python bindings (MythTV)"
check_py_lib pycurl || disable_netvision "Python pycurl library (pycurl)"
check_py_lib lxml || disable_netvision "Python lxml library (lxml)"
check_py_lib xml || disable_netvision "Python XML library (xml)"
check_py_lib urllib || disable_netvision "Python URL library (urllib)"
check_py_lib urllib2 || disable_netvision "Python URL library 2 (urllib2)"
check_py_lib oauth || disable_netvision "Python OAuth library (oauth)"
disabled netvision && echo "Disabling MythNetvision due to missing dependencies."
fi
if enabled weather; then
check_pl_lib(){
log check_pl_lib "$@"
check_cmd perl -e "use ${1};"
}
disable_weather(){
echo "MythWeather requires $1"
disable weather
}
check_pl_lib "Date::Manip" || disable_weather "Date::Manip"
check_pl_lib "XML::Simple" || disable_weather "XML::Simple"
check_pl_lib "XML::XPath" || disable_weather "XML::XPath"
check_pl_lib "Image::Size" || disable_weather "Image::Size"
check_pl_lib "DateTime::Format::ISO8601" ||
disable_weather "DateTime::Format::ISO8601"
check_pl_lib "SOAP::Lite" || disable_weather "SOAP::Lite"
check_pl_lib "JSON" || disable_weather "JSON"
disabled weather && echo "Disabling MythWeather due to missing dependencies."
fi
# Test for dcraw utility
enabled dcraw && command -v dcraw 2>/dev/null > /dev/null || disable dcraw
if test x"$icc" != x ; then
# Assume relative paths are for files in the standard icc directory.
case "$icc" in
/*)
;;
*) icc=$sysroot/usr/share/color/icc/$icc
;;
esac
# Verify the presence of the file.
if test ! -f "$icc" ; then
icc=""
fi
fi
if enabled music ; then
if ! check_lib vorbis/codec.h vorbis_info_init -lvorbis || ! check_lib vorbis/vorbisenc.h vorbis_encode_setup_vbr -lvorbisenc -lvorbis -logg ; then
disable vorbis
echo "MythMusic requires vorbis."
fi
if ! check_lib FLAC/all.h FLAC__stream_decoder_new -lFLAC ;then
disable flac
echo "MythMusic requires FLAC."
fi
if ! check_lib cdio/cdio.h cdio_open -lcdio || ! check_lib cdio/cdda.h cdio_cddap_open -lcdio_cdda || ! check_lib cdio/paranoia.h cdio_paranoia_init -lcdio_paranoia ; then
disable cdio
fi
if ! check_lib lame/lame.h lame_init -lmp3lame ; then
disable mp3lame
echo "MythMusic requires the LAME mp3 encoder."
fi
taglib_minor="0"
if test x`which taglib-config` != x"" ; then
taglib_minor=`taglib-config --version | cut -d. -f2`
if test x"$taglib_minor" = x"" ; then
echo "Can't find taglib-config. Assuming 1.6 or later."
taglib_minor="6"
fi
tagprefix=`taglib-config --prefix`
add_cxxflags "-I${tagprefix}/include"
add_ldflags "-L${tagprefix}/lib"
fi
if test $taglib_minor -lt 6 || ! check_lib_cxx taglib/fileref.h TagLib::FileRef -ltag -lz ; then
disable taglib
echo "MythMusic requires taglib 1.6 or later."
fi
if disabled vorbis || disabled flac || disabled mp3lame || disabled taglib ; then
echo "Disabling MythMusic due to missing dependencies."
disable music
fi
fi
if enabled zoneminder ; then
if ! check_header mysql/mysql.h ; then
echo "Disabling MythZoneMinder. Requires mysql/mysql.h header"
disable zoneminder
fi
fi
cat > $TMPC << EOF
#include <stdint.h>
int main( void ) { return 0; }
EOF
disable _stdint_h
if $cc -o $TMPE $TMPC 2> /dev/null ; then
enable _stdint_h
fi
###########################################################
# #
# Top level mythplugin.pro file creation #
# (ie. which plugins to build) #
# #
###########################################################
echo ""
echo "Configuration settings: "
echo " "
echo " qmake $(which $qmake)"
echo " "
echo "#" > ./config.pro
echo "# Automatically generated by mythplugin configure" >> ./config.pro
echo "# (manual modifications will be overwritten)" >> ./config.pro
echo "#" >> ./config.pro
if enabled archive ; then
echo " MythArchive plugin will be built"
echo "SUBDIRS += mytharchive" >> ./config.pro
else
echo " MythArchive plugin will not be built"
fi
if enabled browser ; then
echo " MythBrowser plugin will be built"
echo "SUBDIRS += mythbrowser" >> ./config.pro
else
echo " MythBrowser plugin will not be built"
fi
if enabled gallery ; then
echo " MythGallery plugin will be built"
echo "SUBDIRS += mythgallery" >> ./config.pro
else
echo " MythGallery plugin will not be built"
fi
if enabled game ; then
echo " MythGame plugin will be built"
echo "SUBDIRS += mythgame" >> ./config.pro
else
echo " MythGame plugin will not be built"
fi
if enabled music ; then
echo " MythMusic plugin will be built"
echo "SUBDIRS += mythmusic" >> ./config.pro
else
echo " MythMusic plugin will not be built"
fi
if enabled netvision ; then
echo " MythNetvision plugin will be built"
echo "SUBDIRS += mythnetvision" >> ./config.pro
else
echo " MythNetvision plugin will not be built"
fi
if enabled news ; then
echo " MythNews plugin will be built"
echo "SUBDIRS += mythnews" >> ./config.pro
else
echo " MythNews plugin will not be built"
fi
if enabled weather ; then
echo " MythWeather plugin will be built"
echo "SUBDIRS += mythweather" >> ./config.pro
else
echo " MythWeather plugin will not be built"
fi
if enabled zoneminder ; then
echo " MythZoneMinder plugin will be built"
echo "SUBDIRS += mythzoneminder" >> ./config.pro
else
echo " MythZoneMinder plugin will not be built"
fi
###########################################################
# #
# MythGallery related configuration options #
# #
###########################################################
if enabled gallery ; then
echo "/*" > ./mythgallery/mythgallery/config.h
echo " Automatically generated by configure - do not modify" >> ./mythgallery/mythgallery/config.h
echo "*/" >> ./mythgallery/mythgallery/config.h
echo "#" > ./mythgallery/config.pro
echo "# Automatically generated by configure - modify only under penalty of death" >> ./mythgallery/config.pro
echo "#" >> ./mythgallery/config.pro
echo "#" > ./mythgallery/mythgallery/config.pro
echo "# Automatically generated by configure - modify only under penalty of death" >> ./mythgallery/mythgallery/config.pro
echo "#" >> ./mythgallery/mythgallery/config.pro
if enabled opengl ; then
echo " OpenGL support will be included in MythGallery"
echo "#define OPENGL_SUPPORT 1" >> ./mythgallery/mythgallery/config.h
echo "CONFIG += opengl" >> ./mythgallery/mythgallery/config.pro
echo "HEADERS += glsingleview.h" >> ./mythgallery/mythgallery/config.pro
echo "SOURCES += glsingleview.cpp" >> ./mythgallery/mythgallery/config.pro
else
echo " OpenGL support will not be included in MythGallery"
fi
if enabled exif ; then
echo " EXIF support will be included in MythGallery"
echo "#define EXIF_SUPPORT 1" >> ./mythgallery/mythgallery/config.h
echo "LIBS += -lexif" >> ./mythgallery/mythgallery/config.pro
if test x`which pkg-config 2>/dev/null` != x"" ; then
if `pkg-config --atleast-version 0.6.9 libexif` ; then
echo "#define NEW_LIB_EXIF 1" >> \
./mythgallery/mythgallery/config.h
fi
else
if test x"$newexif" = x"yes" ; then
echo "#define NEW_LIB_EXIF 1" >> \
./mythgallery/mythgallery/config.h
else
echo
echo "Could not determine libexif version, if it is greater"
echo "than or equal to 0.6.9 you need to add"
echo "--enable-new-exif to the configure flags"
echo
fi
fi
else
echo " EXIF support will not be included in MythGallery"
fi
if enabled dcraw ; then
echo " Dcraw support will be included in MythGallery"
echo "SUBDIRS += dcrawplugin" >> ./mythgallery/config.pro
echo "#define DCRAW_SUPPORT 1" >> ./mythgallery/mythgallery/config.h
echo "LIBS += -L../dcrawplugin -ldcrawplugin" >> ./mythgallery/mythgallery/config.pro
echo "TARGETDEPS += ../dcrawplugin/libdcrawplugin.a" >> ./mythgallery/mythgallery/config.pro
echo "/*" > ./mythgallery/dcrawplugin/config.h
echo " Automatically generated by configure - do not modify" >> ./mythgallery/dcrawplugin/config.h
echo "*/" >> ./mythgallery/dcrawplugin/config.h
if enabled exif ; then
echo "#define EXIF_SUPPORT 1" >> ./mythgallery/dcrawplugin/config.h
fi
if test x"$icc" != x ; then
echo " ICC profile $icc"
# Quote C escape characters.
quoted_icc=`echo "$icc" | sed 's/\\([\\\\"?]\\)/\\\\\\1/g;\$!{s/\$/\\\\/}'`
echo "#define ICC_PROFILE \"$quoted_icc\"" >> ./mythgallery/dcrawplugin/config.h
fi
else
echo " Dcraw support will not be included in MythGallery"
fi
fi
###########################################################
# #
# MythMusic related configuration options #
# #
###########################################################
if enabled music ; then
echo "/*" > ./mythmusic/mythmusic/config.h
echo " Automatically generated by configure - do not modify" >> ./mythmusic/mythmusic/config.h
echo "*/" >> ./mythmusic/mythmusic/config.h
echo "#" > ./mythmusic/mythmusic/config.pro
echo "# Automatically generated by configure - modify only under penalty of death" >> ./mythmusic/mythmusic/config.pro
echo "#" >> ./mythmusic/mythmusic/config.pro
if enabled _stdint_h ; then
echo "#define HAVE_STDINT_H 1" >> ./mythmusic/mythmusic/config.h
else
echo "#undef HAVE_STDINT_H" >> ./mythmusic/mythmusic/config.h
fi
if enabled cdio ; then
echo "#define HAVE_CDIO 1" >> ./mythmusic/mythmusic/config.h
echo "CONFIG += cdio" >> ./mythmusic/mythmusic/config.pro
echo " libcdio support will be included in MythMusic"
else
echo "#undef HAVE_CDIO" >> ./mythmusic/mythmusic/config.h
echo " libcdio support will not be included in MythMusic"
fi
if enabled fftw; then
echo " FFTW v.3 support will be included in MythMusic"
echo "#define FFTW3_SUPPORT 1" >> ./mythmusic/mythmusic/config.h
echo "LIBS += -lfftw3 -lm" >> \
./mythmusic/mythmusic/config.pro
else
echo " FFTW support will not be included in MythMusic"
fi
if enabled taglib ; then
echo "INCLUDEPATH += `taglib-config --prefix`/include/taglib" >> ./mythmusic/mythmusic/config.pro
fi
fi
###########################################################
# #
# An extra directory and Makefile for cleanup rules #
# #
###########################################################
mkdir -p cleanup
cat << END_CLEANUP > cleanup/Makefile
check:
all:
clean:
distclean:
install:
qmake_all:
\$(NONE)
# Hack to remove some empty directories that qmake doesn't create rules for
uninstall:
-rmdir \$(INSTALL_ROOT)/$prefix/share/mythtv/*
-rmdir \$(INSTALL_ROOT)/$prefix/share/mythtv
END_CLEANUP
echo >> ./config.pro
echo "# clean up for 'make uninstall'. This must be last" >> ./config.pro
echo "SUBDIRS += cleanup " >> ./config.pro
###########################################################
echo ""
${qmake} QMAKE=$(which ${qmake}) mythplugins.pro