forked from m-ab-s/media-autobuild_suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
media-suite_compile.sh
1873 lines (1498 loc) · 61.9 KB
/
media-suite_compile.sh
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
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# set CPU count global. This can be overwrite from the compiler script (media-autobuild_suite.bat)
cpuCount=1
compile="false"
buildFFmpeg="false"
x264Bin="no"
newFfmpeg="no"
while true; do
case $1 in
--cpuCount=* ) cpuCount="${1#*=}"; shift ;;
--build32=* ) build32="${1#*=}"; shift ;;
--build64=* ) build64="${1#*=}"; shift ;;
--mp4box=* ) mp4box="${1#*=}"; shift ;;
--ffmpeg=* ) ffmpeg="${1#*=}"; shift ;;
--ffmpegUpdate=* ) ffmpegUpdate="${1#*=}"; shift ;;
--mplayer=* ) mplayer="${1#*=}"; shift ;;
--mpv=* ) mpv="${1#*=}"; shift ;;
--mkv=* ) mkv="${1#*=}"; shift ;;
--deleteSource=* ) deleteSource="${1#*=}"; shift ;;
--nonfree=* ) nonfree="${1#*=}"; shift ;;
--stripping* ) stripping="${1#*=}"; shift ;;
--packing* ) packing="${1#*=}"; shift ;;
-- ) shift; break ;;
-* ) echo "Error, unknown option: '$1'."; exit 1 ;;
* ) break ;;
esac
done
# get git clone, or update
do_git() {
local gitURL="$1"
local gitFolder="$2"
local gitDepth="$3"
echo -ne "\033]0;compile $gitFolder $bits\007"
if [ ! -d $gitFolder ]; then
if [[ $gitDepth == "noDepth" ]]; then
git clone $gitURL $gitFolder
else
git clone --depth 1 $gitURL $gitFolder
fi
compile="true"
cd $gitFolder
else
cd $gitFolder
oldHead=`git rev-parse HEAD`
git pull origin master
newHead=`git rev-parse HEAD`
if [[ "$oldHead" != "$newHead" ]]; then
compile="true"
fi
fi
}
# get svn checkout, or update
do_svn() {
local svnURL="$1"
local svnFolder="$2"
echo -ne "\033]0;compile $svnFolder $bits\007"
if [ ! -d $svnFolder ]; then
svn checkout $svnURL $svnFolder
compile="true"
cd $svnFolder
else
cd $svnFolder
oldRevision=`svnversion`
svn update
newRevision=`svnversion`
if [[ "$oldRevision" != "$newRevision" ]]; then
compile="true"
fi
fi
}
# get hg clone, or update
do_hg() {
local hgURL="$1"
local hgFolder="$2"
echo -ne "\033]0;compile $hgFolder $bits\007"
if [ ! -d $hgFolder ]; then
hg clone $hgURL $hgFolder
compile="true"
cd $hgFolder
else
cd $hgFolder
oldHead=`hg id --id`
hg pull
hg update
newHead=`hg id --id`
if [[ "$oldHead" != "$newHead" ]]; then
compile="true"
fi
fi
}
# check if compiled file exist
do_checkIfExist() {
local packetName="$1"
local fileName="$2"
local fileExtension=${fileName##*.}
if [[ "$fileExtension" = "exe" ]]; then
if [ -f "$LOCALDESTDIR/$fileName" ]; then
echo -
echo -------------------------------------------------
echo "build $packetName done..."
echo -------------------------------------------------
echo -
if [[ $deleteSource = "y" ]]; then
if [[ ! "${packetName: -4}" = "-git" ]]; then
if [[ ! "${packetName: -3}" = "-hg" ]]; then
if [[ ! "${packetName: -4}" = "-svn" ]]; then
cd $LOCALBUILDDIR
rm -rf $LOCALBUILDDIR/$packetName
fi
fi
fi
fi
else
echo -------------------------------------------------
echo "Build $packetName failed..."
echo "Delete the source folder under '$LOCALBUILDDIR' and start again,"
echo "or if you know there is no dependences hit enter for continue it."
read -p ""
sleep 5
fi
elif [[ "$fileExtension" = "a" ]] || [[ "$fileExtension" = "dll" ]]; then
if [ -f "$LOCALDESTDIR/lib/$fileName" ]; then
echo -
echo -------------------------------------------------
echo "build $packetName done..."
echo -------------------------------------------------
echo -
if [[ $deleteSource = "y" ]]; then
if [[ ! "${packetName: -4}" = "-git" ]]; then
if [[ ! "${packetName: -3}" = "-hg" ]]; then
if [[ ! "${packetName: -4}" = "-svn" ]]; then
cd $LOCALBUILDDIR
rm -rf $LOCALBUILDDIR/$packetName
fi
fi
fi
fi
else
echo -------------------------------------------------
echo "build $packetName failed..."
echo "delete the source folder under '$LOCALBUILDDIR' and start again,"
echo "or if you know there is no dependences hit enter for continue it"
read -p "first close the batch window, then the shell window"
sleep 5
fi
fi
}
buildProcess() {
cd $LOCALBUILDDIR
echo "-------------------------------------------------------------------------------"
echo
echo "compile global tools $bits"
echo
echo "-------------------------------------------------------------------------------"
if [ -f "$LOCALDESTDIR/lib/libopenjpeg.a" ]; then
echo -------------------------------------------------
echo "openjpeg-1.5.2 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile openjpeg $bits\007"
rm -rf openjpeg-1.5.2
wget --tries=20 --retry-connrefused --waitretry=2 -O openjpeg-1.5.2.tar.gz -c "http://sourceforge.net/projects/openjpeg.mirror/files/1.5.2/openjpeg-1.5.2.tar.gz/download"
tar xf openjpeg-1.5.2.tar.gz
rm openjpeg-1.5.2.tar.gz
cd openjpeg-1.5.2
cmake -G "MSYS Makefiles" -DBUILD_SHARED_LIBS:BOOL=off -DBUILD_MJ2:BOOL=on -DBUILD_JPWL:BOOL=on -DBUILD_JPIP:BOOL=on -DBUILD_THIRDPARTY:BOOL=on -DCMAKE_INSTALL_PREFIX=$LOCALDESTDIR -DOPENJPEG_INSTALL_BIN_DIR=$LOCALDESTDIR/bin-global -DCMAKE_C_FLAGS="-mms-bitfields -mthreads -mtune=generic -pipe -DOPJ_STATIC"
make -j $cpuCount
make install
do_checkIfExist openjpeg-1.5.2 libopenjpeg.a
cp $LOCALDESTDIR/include/openjpeg-1.5/openjpeg.h $LOCALDESTDIR/include
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libfreetype.a" ]; then
echo -------------------------------------------------
echo "freetype-2.5.4 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile freetype $bits\007"
rm -rf freetype-2.5.4
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.sourceforge.net/project/freetype/freetype2/2.5.4/freetype-2.5.4.tar.bz2
tar xf freetype-2.5.4.tar.bz2
rm freetype-2.5.4.tar.bz2
cd freetype-2.5.4
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared --with-harfbuzz=no
make -j $cpuCount
make install
do_checkIfExist freetype-2.5.4 libfreetype.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libfontconfig.a" ]; then
echo -------------------------------------------------
echo "fontconfig-2.11.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile fontconfig $bits\007"
rm -rf fontconfig-2.11.1
wget --tries=20 --retry-connrefused --waitretry=2 -c http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.gz
tar xf fontconfig-2.11.1.tar.gz
rm fontconfig-2.11.1.tar.gz
cd fontconfig-2.11.1
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --enable-shared=no
make -j $cpuCount
make install
sed -i 's/-L${libdir} -lfontconfig[^l]*$/-L${libdir} -lfontconfig -lfreetype -lexpat/' "$LOCALDESTDIR/lib/pkgconfig/fontconfig.pc"
do_checkIfExist fontconfig-2.11.1 libfontconfig.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libfribidi.a" ]; then
echo -------------------------------------------------
echo "fribidi-0.19.6 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile fribidi $bits\007"
rm -rf fribidi-0.19.6
wget --tries=20 --retry-connrefused --waitretry=2 -c http://fribidi.org/download/fribidi-0.19.6.tar.bz2
tar xf fribidi-0.19.6.tar.bz2
rm fribidi-0.19.6.tar.bz2
cd fribidi-0.19.6
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --enable-shared=no --with-glib=no
make -j $cpuCount
make install
if [ ! -f ${LOCALDESTDIR}/bin-global/fribidi-config ]; then
cat > ${LOCALDESTDIR}/bin-global/fribidi-config << "EOF"
#!/bin/sh
case $1 in
--version)
pkg-config --modversion fribidi
;;
--cflags)
pkg-config --cflags fribidi
;;
--libs)
pkg-config --libs fribidi
;;
*)
false
;;
esac
EOF
fi
do_checkIfExist fribidi-0.19.6 libfribidi.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libSDL.a" ]; then
echo -------------------------------------------------
echo "SDL-1.2.15 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile SDL $bits\007"
rm -rf SDL-1.2.15
wget --tries=20 --retry-connrefused --waitretry=2 -c http://www.libsdl.org/release/SDL-1.2.15.tar.gz
tar xf SDL-1.2.15.tar.gz
rm SDL-1.2.15.tar.gz
cd SDL-1.2.15
CFLAGS="-DDECLSPEC=" ./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --enable-shared=no
make -j $cpuCount
make install
sed -i "s/-mwindows//" "$LOCALDESTDIR/bin-global/sdl-config"
sed -i "s/-mwindows//" "$LOCALDESTDIR/lib/pkgconfig/sdl.pc"
do_checkIfExist SDL-1.2.15 libSDL.a
fi
#----------------------
# crypto engine
#----------------------
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libgcrypt.a" ]; then
echo -------------------------------------------------
echo "libgcrypt-1.6.2 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile libgcrypt $bits\007"
rm -rf libgcrypt-1.6.2
wget --tries=20 --retry-connrefused --waitretry=2 ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.2.tar.bz2
tar xf libgcrypt-1.6.2.tar.bz2
rm libgcrypt-1.6.2.tar.bz2
cd libgcrypt-1.6.2
if [[ "$bits" = "32bit" ]]; then
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared --with-gpg-error-prefix=$MINGW_PREFIX
else
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared --with-gpg-error-prefix=$MINGW_PREFIX --disable-asm --disable-padlock-support
fi
make -j $cpuCount
make install
do_checkIfExist libgcrypt-1.6.2 libgcrypt.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libgnutls.a" ]; then
echo -------------------------------------------------
echo "gnutls-3.3.11 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile gnutls $bits\007"
rm -rf gnutls-3.3.11
wget --tries=20 --retry-connrefused --waitretry=2 ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.11.tar.xz
tar xf gnutls-3.3.11.tar.xz
rm gnutls-3.3.11.tar.xz
cd gnutls-3.3.11
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-guile --enable-cxx --disable-doc --disable-tests --disable-shared --with-zlib --without-p11-kit --disable-rpath --disable-gtk-doc --disable-libdane --enable-local-libopts
make -j $cpuCount
make install
sed -i 's/-lgnutls *$/-lgnutls -lnettle -lhogweed -liconv -lcrypt32 -lws2_32 -lz -lgmp -lintl/' $LOCALDESTDIR/lib/pkgconfig/gnutls.pc
do_checkIfExist gnutls-3.3.11 libgnutls.a
fi
cd $LOCALBUILDDIR
do_git "git://git.ffmpeg.org/rtmpdump" rtmpdump-git
if [[ $compile == "true" ]]; then
if [ -f "$LOCALDESTDIR/lib/librtmp.a" ]; then
rm -rf $LOCALDESTDIR/include/librtmp
rm $LOCALDESTDIR/lib/librtmp.a
rm $LOCALDESTDIR/lib/pkgconfig/librtmp.pc
rm $LOCALDESTDIR/man/man3/librtmp.3
rm $LOCALDESTDIR/bin-video/rtmpdump.exe $LOCALDESTDIR/bin-video/rtmpsuck.exe $LOCALDESTDIR/bin-video/rtmpsrv.exe $LOCALDESTDIR/bin-video/rtmpgw.exe
rm $LOCALDESTDIR/man/man1/rtmpdump.1
rm $LOCALDESTDIR/man/man8/rtmpgw.8
make clean
fi
make XCFLAGS=$MINGW_PREFIX/include LDFLAGS="$LDFLAGS" prefix=$LOCALDESTDIR bindir=$LOCALDESTDIR/bin-video sbindir=$LOCALDESTDIR/bin-video CRYPTO=GNUTLS SHARED= SYS=mingw install LIBS="$LIBS -liconv -lrtmp -lgnutls -lhogweed -lnettle -lgmp -liconv -ltasn1 -lws2_32 -lwinmm -lgdi32 -lcrypt32 -lintl -lz -liconv" LIB_GNUTLS="-lgnutls -lhogweed -lnettle -lgmp -liconv -ltasn1" LIBS_mingw="-lws2_32 -lwinmm -lgdi32 -lcrypt32 -lintl"
sed -i 's/Libs:.*/Libs: -L${libdir} -lrtmp -lwinmm -lz -lgmp -lintl/' $LOCALDESTDIR/lib/pkgconfig/librtmp.pc
do_checkIfExist rtmpdump librtmp.a
compile="false"
else
echo -------------------------------------------------
echo "rtmpdump is already up to date"
echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libdca.a" ]; then
echo -------------------------------------------------
echo "libdca is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile libdca $bits\007"
rm -rf libdca
svn co svn://svn.videolan.org/libdca/trunk libdca
cd libdca
./bootstrap
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared
make -j $cpuCount
make install
do_checkIfExist libdca libdca.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libxml2.a" ]; then
echo -------------------------------------------------
echo "libxml2-2.9.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile libxml2 $bits\007"
rm -rf libxml2-2.9.1
wget --tries=20 --retry-connrefused --waitretry=2 -c ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz
tar xf libxml2-2.9.1.tar.gz
rm libxml2-2.9.1.tar.gz
cd libxml2-2.9.1
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared --enable-static
make -j $cpuCount
make install
do_checkIfExist libxml2-2.9.1 libxml2.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libmagic.a" ]; then
echo -------------------------------------------------
echo "file-5.19[libmagic] is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile file $bits\007"
rm -rf file-5.19
wget --tries=20 --retry-connrefused --waitretry=2 -c ftp://ftp.astron.com/pub/file/file-5.19.tar.gz
tar xf file-5.19.tar.gz
rm file-5.19.tar.gz
cd file-5.19
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --enable-static=yes --enable-shared=no CPPFLAGS='-DPCRE_STATIC' LIBS='-lpcre -lshlwapi -lz'
make CPPFLAGS='-D_REGEX_RE_COMP' -j $cpuCount
make install
do_checkIfExist file-5.19 libmagic.a
fi
cd $LOCALBUILDDIR
do_git "https://github.com/dekkers/libilbc.git" libilbc-git
if [[ $compile == "true" ]]; then
if [[ ! -f "configure" ]]; then
autoreconf -fiv
else
make uninstall
make clean
fi
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --disable-shared
make -j $cpuCount
make install
do_checkIfExist libilbc-git libilbc.a
compile="false"
else
echo -------------------------------------------------
echo "libilbc-git is already up to date"
echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
#do_svn "svn://dev.exiv2.org/svn/trunk" exiv2-svn
if [[ $compile == "no" ]]; then # is deactivated for the moment
if [ -d "build" ]; then
cd build
make uninstall
rm $LOCALDESTDIR/bin-global/metacopy.exe
rm $LOCALDESTDIR/bin-global/path-test.exe
rm $LOCALDESTDIR/bin-global/exiv2.exe
rm -rf *
else
mkdir build
cd build
fi
LDFLAGS="$LDFLAGS -static -static-libgcc -static-libstdc++" cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$LOCALDESTDIR -DEXIV2_ENABLE_SHARED:BOOL=off -DCMAKE_BUILD_TYPE=release -Wno-dev
make -j $cpuCount
make install
mv $LOCALDESTDIR/bin/metacopy.exe $LOCALDESTDIR/bin-global
mv $LOCALDESTDIR/bin/path-test.exe $LOCALDESTDIR/bin-global
mv $LOCALDESTDIR/bin/exiv2.exe $LOCALDESTDIR/bin-global
do_checkIfExist exiv2-svn bin-global/exiv2.exe
compile="false"
#else
# echo -------------------------------------------------
# echo "exiv2 is already up to date"
# echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
do_git "git://midipix.org/waio" waio-git
if [[ $compile == "true" ]]; then
if [[ $bits = "32bit" ]]; then
if [[ -f lib32/libwaio.a ]]; then
./build-mingw-nt32 clean
rm -rf $LOCALDESTDIR/include/waio
rm -f $LOCALDESTDIR/lib/libwaio.a
fi
build-mingw-nt32 AR=i686-w64-mingw32-gcc-ar LD=ld STRIP=strip lib-static
cp -r ./include/waio/ $LOCALDESTDIR/include/waio/
cp -r ./lib32/libwaio.a $LOCALDESTDIR/lib/libwaio.a
else
if [[ -f lib64/libwaio.a ]]; then
./build-mingw-nt64 clean
rm -rf $LOCALDESTDIR/include/waio
rm -f $LOCALDESTDIR/lib/libwaio.a
fi
build-mingw-nt64 AR=x86_64-w64-mingw32-gcc-ar LD=ld STRIP=strip lib-static
cp -r ./include/waio/ $LOCALDESTDIR/include/waio/
cp -r ./lib64/libwaio.a $LOCALDESTDIR/lib/libwaio.a
fi
do_checkIfExist waio-git libwaio.a
compile="false"
fi
cd $LOCALBUILDDIR
if [ -f $LOCALDESTDIR/lib/libwx_baseu-3.0.a ]; then
echo -------------------------------------------------
echo "wxWidgets is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile wxWidgets $bits\007"
rm -rf wxWidgets-3.0.1
wget --tries=20 --retry-connrefused --waitretry=2 -c -O wxWidgets-3.0.1.tar.bz2 http://sourceforge.net/projects/wxwindows/files/3.0.1/wxWidgets-3.0.1.tar.bz2/download
tar xf wxWidgets-3.0.1.tar.bz2
rm wxWidgets-3.0.1.tar.bz2
cd wxWidgets-3.0.1
CPPFLAGS+=" -fno-devirtualize" CFLAGS+=" -fno-devirtualize" configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-global --with-msw --disable-mslu --disable-shared --enable-static --enable-iniconf --enable-iff --enable-permissive --disable-monolithic --enable-unicode --enable-accessibility --disable-precomp-headers LDFLAGS="$LDFLAGS -static -static-libgcc -static-libstdc++"
make -j $cpuCount
make install
do_checkIfExist wxWidgets-3.0.1 libwx_baseu-3.0.a
fi
echo "-------------------------------------------------------------------------------"
echo
echo "compile global tools $bits done..."
echo
echo "-------------------------------------------------------------------------------"
cd $LOCALBUILDDIR
echo "-------------------------------------------------------------------------------"
echo
echo "compile audio tools $bits"
echo
echo "-------------------------------------------------------------------------------"
if [ -f "$LOCALDESTDIR/lib/libtheora.a" ]; then
echo -------------------------------------------------
echo "libtheora-1.1.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile libtheora $bits\007"
rm -rf libtheora-1.1.1
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar xf libtheora-1.1.1.tar.bz2
rm libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no --disable-examples
make -j $cpuCount
make install
do_checkIfExist libtheora-1.1.1 libtheora.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libspeex.a" ]; then
echo -------------------------------------------------
echo "speex-1.2rc1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile speex $bits\007"
rm -rf speex-1.2rc1
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
tar xf speex-1.2rc1.tar.gz
rm speex-1.2rc1.tar.gz
cd speex-1.2rc1
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio --enable-shared=no
make -j $cpuCount
make install
do_checkIfExist speex-1.2rc1 libspeex.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/bin-audio/flac.exe" ]; then
echo -------------------------------------------------
echo "flac-1.3.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile flac $bits\007"
rm -rf flac-1.3.0
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz
tar xf flac-1.3.1.tar.xz
rm flac-1.3.1.tar.xz
cd flac-1.3.1
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio --disable-xmms-plugin --disable-doxygen-docs --enable-shared=no --enable-static
make -j $cpuCount
make install
do_checkIfExist flac-1.3.1 bin-audio/flac.exe
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libvo-aacenc.a" ]; then
echo -------------------------------------------------
echo "vo-aacenc-0.1.3 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile vo-aacenc $bits\007"
rm -rf vo-aacenc-0.1.3
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.sourceforge.net/project/opencore-amr/vo-aacenc/vo-aacenc-0.1.3.tar.gz
tar xf vo-aacenc-0.1.3.tar.gz
rm vo-aacenc-0.1.3.tar.gz
cd vo-aacenc-0.1.3
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no
make -j $cpuCount
make install
do_checkIfExist vo-aacenc-0.1.3 libvo-aacenc.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libopencore-amrnb.a" ]; then
echo -------------------------------------------------
echo "opencore-amr-0.1.3 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile opencore-amr $bits\007"
rm -rf opencore-amr-0.1.3
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz
tar xf opencore-amr-0.1.3.tar.gz
rm opencore-amr-0.1.3.tar.gz
cd opencore-amr-0.1.3
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no
make -j $cpuCount
make install
do_checkIfExist opencore-amr-0.1.3 libopencore-amrnb.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libvo-amrwbenc.a" ]; then
echo -------------------------------------------------
echo "vo-amrwbenc-0.1.2 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile vo-amrwbenc $bits\007"
rm -rf vo-amrwbenc-0.1.2
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.2.tar.gz
tar xf vo-amrwbenc-0.1.2.tar.gz
rm vo-amrwbenc-0.1.2.tar.gz
cd vo-amrwbenc-0.1.2
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no
make -j $cpuCount
make install
do_checkIfExist vo-amrwbenc-0.1.2 libvo-amrwbenc.a
fi
cd $LOCALBUILDDIR
if [[ $nonfree = "y" ]]; then
do_git "https://github.com/mstorsjo/fdk-aac" fdk-aac-git
if [[ $compile == "true" ]]; then
if [[ ! -f ./configure ]]; then
./autogen.sh
else
make uninstall
make clean
fi
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no
make -j $cpuCount
make install
do_checkIfExist fdk-aac-git libfdk-aac.a
compile="false"
else
echo -------------------------------------------------
echo "fdk-aac is already up to date"
echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/bin-audio/fdkaac.exe" ]; then
echo -------------------------------------------------
echo "bin-fdk-aac is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile fdk-aac $bits\007"
rm -rf bin-fdk-aac
wget --tries=20 --retry-connrefused --waitretry=2 --no-check-certificate -c https://github.com/nu774/fdkaac/archive/master.zip -O bin-fdk-aac.zip
unzip bin-fdk-aac.zip
rm bin-fdk-aac.zip
mv fdkaac-master bin-fdk-aac
cd bin-fdk-aac
if [[ ! -f ./configure ]]; then
autoreconf -i
fi
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio
make -j $cpuCount
make install
do_checkIfExist bin-fdk-aac bin-audio/fdkaac.exe
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/bin-audio/faac.exe" ]; then
echo -------------------------------------------------
echo "faac-1.28 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile faac $bits\007"
rm -rf faac-1.28
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
tar xf faac-1.28.tar.gz
rm faac-1.28.tar.gz
cd faac-1.28
sh bootstrap
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio --enable-shared=no --without-mp4v2
make -j $cpuCount
make install
do_checkIfExist faac-1.28 bin-audio/faac.exe
fi
fi # nonfree end
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libopus.a" ]; then
echo -------------------------------------------------
echo "opus-1.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile opus $bits\007"
rm -rf opus-1.1
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar xf opus-1.1.tar.gz
rm opus-1.1.tar.gz
cd opus-1.1
wget --tries=20 --retry-connrefused --waitretry=2 --no-check-certificate -c https://raw.github.com/jb-alvarado/media-autobuild_suite/master/patches/opus11.patch
patch -p0 < opus11.patch
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --enable-shared=no --enable-static --disable-doc
make -j $cpuCount
make install
do_checkIfExist opus-1.1 libopus.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/bin-audio/opusenc.exe" ]; then
echo -------------------------------------------------
echo "opus-tools-0.1.9 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile opus-tools $bits\007"
rm -rf opus-tools-0.1.9
wget --tries=20 --retry-connrefused --waitretry=2 -c http://downloads.xiph.org/releases/opus/opus-tools-0.1.9.tar.gz
tar xf opus-tools-0.1.9.tar.gz
rm opus-tools-0.1.9.tar.gz
cd opus-tools-0.1.9
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio LDFLAGS="$LDFLAGS -static -static-libgcc -static-libstdc++"
make -j $cpuCount
make install
do_checkIfExist opus-tools-0.1.9 bin-audio/opusenc.exe
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/liba52.a" ]; then
echo -------------------------------------------------
echo "a52dec-0.7.4 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile a52dec $bits\007"
rm -rf a52dec-0.7.4
wget --tries=20 --retry-connrefused --waitretry=2 -c "http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz"
tar xf a52dec-0.7.4.tar.gz
rm a52dec-0.7.4.tar.gz
cd a52dec-0.7.4
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio --disable-shared
make -j $cpuCount
make install
do_checkIfExist a52dec-0.7.4 liba52.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libmad.a" ]; then
echo -------------------------------------------------
echo "libmad-0.15.1b is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile libmad $bits\007"
rm -rf libmad-0.15.1b
wget --tries=20 --retry-connrefused --waitretry=2 -c "ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz"
tar xf libmad-0.15.1b.tar.gz
rm libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --disable-shared --enable-fpm=intel --disable-debugging
make -j $cpuCount
make install
do_checkIfExist libmad-0.15.1b libmad.a
fi
cd $LOCALBUILDDIR
if [ -f "$LOCALDESTDIR/lib/libsoxr.a" ]; then
echo -------------------------------------------------
echo "soxr-0.1.1 is already compiled"
echo -------------------------------------------------
else
echo -ne "\033]0;compile soxr-0.1.1 $bits\007"
rm -rf soxr-0.1.1-Source
wget --tries=20 --retry-connrefused --waitretry=2 -c "http://sourceforge.net/projects/soxr/files/soxr-0.1.1-Source.tar.xz"
tar xf soxr-0.1.1-Source.tar.xz
rm soxr-0.1.1-Source.tar.xz
cd soxr-0.1.1-Source
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$LOCALDESTDIR -DHAVE_WORDS_BIGENDIAN_EXITCODE=0 -DBUILD_SHARED_LIBS:bool=off -DBUILD_TESTS:BOOL=OFF -DWITH_OPENMP:BOOL=OFF
make -j $cpuCount
make install
do_checkIfExist soxr-0.1.1-Source libsoxr.a
fi
cd $LOCALBUILDDIR
do_git "git://git.code.sf.net/p/sox/code" sox-git
if [[ $compile == "true" ]]; then
mv $MINGW_PREFIX/lib/libgsm.a $MINGW_PREFIX/lib/tmp_libgsm.a
if [[ ! -f ./configure ]]; then
autoreconf -i
else
make uninstall
make clean
fi
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-audio --enable-shared=no CPPFLAGS='-DPCRE_STATIC' LIBS='-lpcre -lshlwapi -lz -lgnurx'
make -j $cpuCount
make install
mv $MINGW_PREFIX/lib/tmp_libgsm.a $MINGW_PREFIX/lib/libgsm.a
do_checkIfExist sox-git bin-audio/sox.exe
compile="false"
else
echo -------------------------------------------------
echo "sox is already up to date"
echo -------------------------------------------------
fi
echo "-------------------------------------------------------------------------------"
echo
echo "compile audio tools $bits done..."
echo
echo "-------------------------------------------------------------------------------"
cd $LOCALBUILDDIR
sleep 3
echo "-------------------------------------------------------------------------------"
echo
echo "compile video tools $bits"
echo
echo "-------------------------------------------------------------------------------"
do_git "http://git.chromium.org/webm/libvpx.git" libvpx-git noDepth
if [[ $compile == "true" ]]; then
if [ -d $LOCALDESTDIR/include/vpx ]; then
rm -rf $LOCALDESTDIR/include/vpx
rm -f $LOCALDESTDIR/lib/pkgconfig/vpx.pc
rm -f $LOCALDESTDIR/lib/libvpx.a
make clean
fi
if [[ $bits = "64bit" ]]; then
LDFLAGS="$LDFLAGS -static-libgcc -static" ./configure --prefix=$LOCALDESTDIR --target=x86_64-win64-gcc --disable-shared --enable-static --disable-unit-tests --disable-docs --enable-postproc --enable-vp9-postproc --enable-runtime-cpu-detect
sed -i 's/HAVE_GNU_STRIP=yes/HAVE_GNU_STRIP=no/g' libs-x86_64-win64-gcc.mk
else
LDFLAGS="$LDFLAGS -static-libgcc -static" ./configure --prefix=$LOCALDESTDIR --target=x86-win32-gcc --disable-shared --enable-static --disable-unit-tests --disable-docs --enable-postproc --enable-vp9-postproc --enable-runtime-cpu-detect
sed -i 's/HAVE_GNU_STRIP=yes/HAVE_GNU_STRIP=no/g' libs-x86-win32-gcc.mk
fi
make -j $cpuCount
make install
mv $LOCALDESTDIR/bin/vpxdec.exe $LOCALDESTDIR/bin-video
mv $LOCALDESTDIR/bin/vpxenc.exe $LOCALDESTDIR/bin-video
do_checkIfExist libvpx-git libvpx.a
compile="false"
buildFFmpeg="true"
else
echo -------------------------------------------------
echo "libvpx-git is already up to date"
echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
do_git "https://github.com/ultravideo/kvazaar.git" kvazaar-git
if [[ $compile == "true" ]]; then
cd src
if [[ -f intra.o ]]; then
make clean
fi
if [[ "$bits" = "32bit" ]]; then
make ARCH=i686 DFLAGS="$DFLAGS -O2 -g -ftree-vectorize" LD="gcc -pthread" -j $cpuCount
else
make ARCH=x86_64 DFLAGS="$DFLAGS -O2 -g -ftree-vectorize" LD="gcc -pthread" ASMFLAGS="-f win64 -DHAVE_ALIGNED_STACK=0 -DARCH_X86_64=1 -I. -I./strategies -I./extras" -j $cpuCount
fi
cp kvazaar.exe $LOCALDESTDIR/bin-video
do_checkIfExist kvazaar-git bin-video/kvazaar.exe
compile="false"
else
echo -------------------------------------------------
echo "kvazaar-git is already up to date"
echo -------------------------------------------------
fi
cd $LOCALBUILDDIR
do_git "git://git.videolan.org/libdvdread.git" libdvdread-git
if [[ $compile == "true" ]]; then
if [[ ! -f "configure" ]]; then
autoreconf -fiv
else
make uninstall
make clean
fi
./configure --build=$targetBuild --host=$targetHost --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video --disable-shared --disable-apidoc