-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·101 lines (90 loc) · 2.68 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·101 lines (90 loc) · 2.68 KB
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
#!/bin/bash
ffmpeg_proj_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -z "$DIST" ]; then
DIST=${ffmpeg_proj_dir}/"dist"
fi
if [ ! -d ${DIST} ]; then
mkdir -p ${DIST}
echo "CREATED ${DIST}"
fi
echo "DIST=${DIST}"
CONFIGURE_TO_USE="./configure"
command_options=(
--prefix=${DIST}
--enable-libfreetype
--enable-libfribidi
--enable-libfontconfig
--enable-shared
--enable-avresample
--enable-pthreads
--enable-version3
--enable-hardcoded-tables
--cc=clang
--host-cflags=-fPIC
--host-ldflags=
--enable-gpl
--enable-libmp3lame
--enable-libx264
--enable-libx265
--enable-libxvid
--enable-opencl
--disable-lzma
)
if [ "$1" == "--DEBUG" ] || [ "$1" == "--debug" ]; then
CONFIGURE_TO_USE="./configure.debug"
command_options+=(
--disable-stripping
--enable-debug=3
--extra-cflags=-ggdb
--extra-cflags=-O0
--extra-cflags=-g
)
fi
if [ "$(uname)" == "Darwin" ]; then
command_options+=(
--enable-videotoolbox
)
HOMEBREW_LOCATION="$(brew --prefix)"
if [ -n "${HOMEBREW_LOCATION}" -a -d "${HOMEBREW_LOCATION}" ]; then
command_options+=(
--extra-ldflags=-L${HOMEBREW_LOCATION}/lib
--extra-cflags=-I${HOMEBREW_LOCATION}/include
)
fi
echo "configuring with command_options=${command_options[@]}"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
command_options+=(
--extra-cflags=-fPIC
)
if find /usr/local/cuda* -name version.txt | read; then
if [ -d /usr/local/cuda/include -a -d /usr/local/cuda/lib64 ]; then
command_options+=(
--enable-cuda
--enable-cuvid
--enable-nvenc
--enable-nonfree
--enable-libnpp
--extra-cflags=-I/usr/local/cuda/include
--extra-ldflags=-L/usr/local/cuda/lib64
)
else
echo "CUDA found, but not linked to /usr/local/cuda, so skipping setup"
fi
fi
echo "configuring with command_options=${command_options[@]}"
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
echo "MINGW32 Not yet supported"
exit 1
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
echo "MINGW64 Not yet supported"
exit 1
fi
(
cd ${ffmpeg_proj_dir}
${CONFIGURE_TO_USE} ${command_options[@]}
)
NPROCS=$(getconf _NPROCESSORS_ONLN)
ELUVIO_BUILD_THREAD_COUNT=${ELUVIO_BUILD_THREAD_COUNT:-"-j${NPROCS}"}
ELUVIO_TEST_THREAD_COUNT=${ELUVIO_TEST_THREAD_COUNT:-"${NPROCS}"}
ELUVIO_BUILD_THREAD_COUNT=${ELUVIO_BUILD_THREAD_COUNT:-"-j4"}
make ${ELUVIO_BUILD_THREAD_COUNT} && make install