-
Notifications
You must be signed in to change notification settings - Fork 15
/
mkjenkins
executable file
·162 lines (137 loc) · 4.72 KB
/
mkjenkins
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
#!/bin/bash
set -e
#COMPILER=gcc
#TOOLKIT=ffmpeg
#FFMPEGVER=4.1
#CONFIGUREOPT=
CHECK=1
COMPILER=$1
TOOLKIT=$2
FFMPEGVER=$3
CONFIGUREOPT=$4
if [ ! -z "$5" ];
then
CHECK=$5
fi
if [ -z "${COMPILER}" ] || [ -z "${TOOLKIT}" ]
then
echo "Usage: mkjenkins COMPILER TOOLKIT [FFMPEGVER] [CONFIGIVERSION]"
echo
echo "Set toolkit to 'native' to install to system"
echo
echo "Example: mkjenkins gcc native [configure options]"
exit 0
fi
# -------------------------------------------------------------------------------------------------
if [ "${HOSTNAME}" != "rasppi4dev" ];
then
CPUCOUNT=`nproc`
else
CPUCOUNT=1
fi
echo "*********************************************************************************************"
if [ -z "${CONFIGUREOPT}" ];
then
echo "Building for ${TOOLKIT} ${FFMPEGVER} with ${COMPILER} and CPU count ${CPUCOUNT}"
else
echo "Building for ${TOOLKIT} ${FFMPEGVER} with ${COMPILER} (configure ${CONFIGUREOPT}) and CPU count ${CPUCOUNT}"
fi
echo "*********************************************************************************************"
if [ ${TOOLKIT} != "native" ];
then
FFMPEG_BUILD="${HOME}/dev/builds/${TOOLKIT}"
if [ ! -z "$FFMPEGVER" ]
then
FFMPEG_BUILD="${FFMPEG_BUILD}-${FFMPEGVER}"
fi
if [ ! -d ${FFMPEG_BUILD} ];
then
echo "*** ERROR *** FFmpeg not found in ${FFMPEG_BUILD}"
exit 99
fi
echo "****** Using FFmpeg in ${FFMPEG_BUILD} ******"
# 32+64 bit
#export LIB32="${FFMPEG_BUILD}/lib"
#export LIB64="${FFMPEG_BUILD}/lib64"
#export LD_LIBRARY_PATH="${LIB64}:${LIB32}"
#export LDFLAGS="-L${LIB64} -L${LIB32} -Wl,-rpath,${LD_LIBRARY_PATH}"
#export PKG_CONFIG_PATH="${FFMPEG_BUILD}/lib/pkgconfig:${FFMPEG_BUILD}/lib64/pkgconfig"
# 64 bit only
export LIB="${FFMPEG_BUILD}/lib"
export LD_LIBRARY_PATH="${LIB}"
export LDFLAGS="-L${LIB} -Wl,-rpath,${LD_LIBRARY_PATH}"
export PKG_CONFIG_PATH="${FFMPEG_BUILD}/lib/pkgconfig"
export CPLUS_INCLUDE_PATH="${FFMPEG_BUILD}/include"
export CFLAGS=-I"${FFMPEG_BUILD}/include"
export CPPFLAGS=-I"${FFMPEG_BUILD}/include"
else
echo "****** Using native FFmpeg library ******"
fi
REBUILD=0
if [ ! -f configure ];
then
REBUILD=1
echo "---------------------------------------------------------------------------------------------"
echo "configure not present, rebuilding"
echo "---------------------------------------------------------------------------------------------"
elif [ configure.ac -nt configure ];
then
REBUILD=1
echo "---------------------------------------------------------------------------------------------"
echo "configure.ac was modified"
echo "---------------------------------------------------------------------------------------------"
fi
if [ ${REBUILD} != 0 ];
then
rm -Rf autom4te.cache config
./autogen.sh
if [ ${COMPILER} = "clang" ];
then
echo "****** Using clang ****** "
CC=clang CXX=clang++ ./configure ${CONFIGUREOPT}
elif [ ${COMPILER} = "gcc" ];
then
echo "****** Using gcc ****** "
CC=gcc CXX="g++" ./configure ${CONFIGUREOPT}
else
echo "****** Using default compiler ****** "
./configure ${CONFIGUREOPT}
fi
echo "---------------------------------------------------------------------------------------------"
echo "Running make clean"
echo "---------------------------------------------------------------------------------------------"
make -j ${CPUCOUNT} -s clean
fi
if [ ${CHECK} != 0 ];
then
echo "---------------------------------------------------------------------------------------------"
echo "Running make check"
echo "---------------------------------------------------------------------------------------------"
make -j ${CPUCOUNT} -s check
#runs again with distcheck
else
echo "---------------------------------------------------------------------------------------------"
echo "Running make"
echo "---------------------------------------------------------------------------------------------"
make -j ${CPUCOUNT} -s
fi
#echo "---------------------------------------------------------------------------------------------"
#echo "Running make distcheck"
#echo "---------------------------------------------------------------------------------------------"
#
# make -j ${CPUCOUNT} -s distcheck
#
#echo "---------------------------------------------------------------------------------------------"
#echo "Running make cppcheck"
#echo "---------------------------------------------------------------------------------------------"
#
# make -j ${CPUCOUNT} -s cppcheck
#
#echo "---------------------------------------------------------------------------------------------"
#
#if [ -s cppcheck.log ]
#then
# echo "Non-zero sized cppcheck.log found:"
# cat cppcheck.log
#fi
echo "---------------------------------------------------------------------------------------------"