-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
74 lines (56 loc) · 2.38 KB
/
build.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
#! /bin/sh
#Print commands and their arguments as they are executed.
set -x
###################################
# Compiler optimization flags:
# Platform native (not include AVX-512, it's standard options)
# Remove "-flto" to avoid Wstringop-overflow warning for fdkaac
CFLAGS="-O3 -march=native"
# AVX-512
#CFLAGS="-O3 -march=native -mavx512f -mavx512dq -mavx512er -mavx512cd -mavx512bw -mavx512pf -mavx512vl -mavx512ifma -mavx512vbmi"
# For debugging/reference usage
#CFLAGS="-O0"
###################################
NPB=`cat /proc/cpuinfo |grep "processor"|wc -l`
if [ -z "$MINGW_CHOST" ]; then
echo "Building failed, because maybe you did not use MinGW terminal instead MSYS terminal."
echo "See README.md how to use instructions."
exit
fi
cd stage
rm -rf $MINGW_CHOST
mkdir $MINGW_CHOST
cd $MINGW_CHOST
tar -zxf ../../artifacts/fdk-aac-0.1.6.tar.gz
tar -zxf ../../artifacts/fdk-aac-2.0.2.tar.gz
tar -zxf ../../artifacts/fdkaac-1.0.3.tar.gz
cd fdk-aac-0.1.6
#Temporary add "-flto" option here, should be replaced by interactive compile switches in the future
CC="gcc -pipe -static-libgcc -flto" CXX="g++ -pipe -static-libgcc -flto" ./configure --prefix=$MINGW_PREFIX/$MINGW_CHOST/ CFLAGS="${CFLAGS}"
make -j$NPB
make install
cd ..
cd fdk-aac-2.0.2
autoreconf -i
#Temporary add "-flto" option here, should be replaced by interactive compile switches in the future
CC="gcc -pipe -static-libgcc -flto" CXX="g++ -pipe -static-libgcc -flto" ./configure --prefix=$MINGW_PREFIX/$MINGW_CHOST/ CFLAGS="${CFLAGS}"
make -j$NPB
make install
cd ..
cd fdkaac-1.0.3
autoreconf -i
CC="gcc -pipe -static-libgcc" CXX="g++ -pipe -static-libgcc" ./configure --prefix=$MINGW_PREFIX/$MINGW_CHOST/ CFLAGS="${CFLAGS}"
make -j$NPB
make install
cd ..
cd ../..
rm -rf artifacts/$MINGW_CHOST
mkdir artifacts/$MINGW_CHOST
cd artifacts/$MINGW_CHOST
cp ../../stage/$MINGW_CHOST/fdk-aac-0.1.6/.libs/libfdk-aac.a libfdk-aac-1.a
cp ../../stage/$MINGW_CHOST/fdk-aac-0.1.6/.libs/libfdk-aac.dll.a libfdk-aac-1.dll.a
cp ../../stage/$MINGW_CHOST/fdk-aac-0.1.6/.libs/libfdk-aac-1.dll .
cp ../../stage/$MINGW_CHOST/fdk-aac-2.0.2/.libs/libfdk-aac.a libfdk-aac-2.a
cp ../../stage/$MINGW_CHOST/fdk-aac-2.0.2/.libs/libfdk-aac.dll.a libfdk-aac-2.dll.a
cp ../../stage/$MINGW_CHOST/fdk-aac-2.0.2/.libs/libfdk-aac-2.dll .
cp ../../stage/$MINGW_CHOST/fdkaac-1.0.3/fdkaac.exe .