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
|
#!/bin/sh
##################################################################
Parallel_Make () {
local numprocs=1
case $OS in
'linux')
numprocs=`grep -c ^processor /proc/cpuinfo 2>/dev/null`
;;
'mac')
if type sysctl &> /dev/null; then
numprocs=`sysctl -n hw.ncpu`
fi
;;
#"solaris')
# on Solaris you need to use psrinfo -p instead
# ;;
#'freebsd')
# ;;
*) ;;
esac
if [ "$numprocs" = "" ] || [ "$numprocs" = "0" ]; then
numprocs=1
fi
make -s -j$numprocs
}
##################################################################
# Init
Home=`pwd`
ZenLib_Options=""
MacOptions="--with-macosx-version-min=10.10 --enable-arch-x86_64"
OS=$(uname -s)
# expr isn't available on mac
if [ "$OS" = "Darwin" ]; then
OS="mac"
BINARY="MediaConch.app/Contents/MacOS/MediaConch"
if test -d ~/Qt/5.3/clang_64/bin; then
export PATH=$PATH:~/Qt/5.3/clang_64/bin
fi
# if the 5 first caracters of $OS equal "Linux"
elif [ "$(expr substr $OS 1 5)" = "Linux" ]; then
OS="linux"
BINARY="mediaconch-gui"
#elif [ "$(expr substr $OS 1 5)" = "SunOS" ]; then
# OS="solaris"
#elif [ "$(expr substr $OS 1 7)" = "FreeBSD" ]; then
# OS="freebsd"
fi
if [ "$OS" = "mac" ] ; then
export CXXFLAGS="-mmacosx-version-min=10.10 -arch x86_64 $CXXFLAGS"
export CFLAGS="-mmacosx-version-min=10.10 -arch x86_64 $CFLAGS"
export LDFLAGS="-mmacosx-version-min=10.10 -arch x86_64 $LDFLAGS"
fi
##################################################################
# Configure zlib
if test -e Shared/Source/zlib/configure; then
cd Shared/Source/zlib
test -e Makefile && rm Makefile
chmod +x configure
./configure --static
if test ! -e Makefile; then
echo Problem while configuring zlib
exit
fi
else
echo zlib directory is not found
exit
fi
cd $Home
##################################################################
# Configure libxml2
if test -e libxml2/configure; then
cd libxml2
test -e Makefile && rm Makefile
chmod +x configure
./configure --without-python --without-modules --without-iconv --without-ftp --without-http --without-c14n --without-catalog --with-xpath --without-xptr --without-xinclude --without-iconv --without-icu --without-iso8859x --without-zlib --without-lzma --without-mem_debug --without-run_debug --without-regexps --with-tree --without-writer --with-pattern --with-push --without-valid --with-sax1 --without-legacy --with-output --with-schemas --with-schematron --enable-static --disable-shared
if test ! -e Makefile; then
echo Problem while configuring libxml2
exit
fi
else
echo libxml2 directory is not found
exit
fi
cd $Home
##################################################################
# Configure libxslt
if test -e libxslt/configure; then
cd libxslt
test -e Makefile && rm Makefile
chmod +x configure
./configure --with-libxml-src="$Home"/libxml2 --without-python --without-modules --without-crypto --enable-static --disable-shared
if test ! -e Makefile; then
echo Problem while configuring libxslt
exit
fi
else
echo libxslt directory is not found
exit
fi
cd $Home
##################################################################
# Configure jansson
if test -e jansson/configure; then
cd jansson
test -e Makefile && rm Makefile
chmod +x configure
./configure --enable-static --disable-shared
if test ! -e Makefile; then
echo Problem while configuring jansson
exit
fi
else
echo jansson directory is not found
exit
fi
cd $Home
##################################################################
# Configure libevent
if test -e libevent/configure; then
cd libevent
test -e Makefile && rm Makefile
chmod +x configure
./configure --disable-openssl --enable-static --disable-shared
if test ! -e Makefile; then
echo Problem while configuring libevent
exit
fi
else
echo libevent directory is not found
exit
fi
cd $Home
##################################################################
# Configure sqlite
if test -e sqlite/configure; then
cd sqlite
test -e Makefile && rm Makefile
chmod +x configure
./configure --enable-static --disable-shared
if test ! -e Makefile; then
echo Problem while configuring sqlite
exit
fi
else
echo sqlite directory is not found
exit
fi
cd $Home
##################################################################
# Configure ZenLib
if test -e ZenLib/Project/GNU/Library/configure; then
cd ZenLib/Project/GNU/Library/
test -e Makefile && rm Makefile
chmod +x configure
if [ "$OS" = "mac" ]; then
./configure --enable-static --disable-shared $MacOptions $ZenLib_Options $*
else
./configure --enable-static --disable-shared $ZenLib_Options $*
fi
if test ! -e Makefile; then
echo Problem while configuring ZenLib
exit
fi
else
echo ZenLib directory is not found
exit
fi
cd $Home
##################################################################
# Compile zlib
cd Shared/Source/zlib
make clean
Parallel_Make
if test -e libz.a; then
echo zlib compiled
else
echo Problem while compiling zlib
exit
fi
cd $Home
##################################################################
# Compile ZenLib
cd ZenLib/Project/GNU/Library/
make clean
Parallel_Make
if test -e libzen.la; then
echo ZenLib compiled
else
echo Problem while compiling ZenLib
exit
fi
cd $Home
##################################################################
# Configure MediaInfoLib
if test -e MediaInfoLib/Project/GNU/Library/configure; then
cd MediaInfoLib/Project/GNU/Library/
test -e Makefile && rm Makefile
chmod +x configure
if [ "$OS" = "mac" ]; then
./configure --enable-static --disable-shared $MacOptions --with-libcurl=runtime $*
else
./configure --enable-static --disable-shared --with-libcurl=runtime $*
fi
if test ! -e Makefile; then
echo Problem while configuring MediaInfoLib
exit
fi
else
echo MediaInfoLib directory is not found
exit
fi
cd $Home
##################################################################
# Compile libxml2
cd libxml2
make clean
Parallel_Make
if test -e libxml2.la; then
echo libxml2 compiled
else
echo Problem while compiling libxml2
exit
fi
cd $Home
##################################################################
# Compile libxslt
cd libxslt
make clean
Parallel_Make
if test -e libxslt/.libs/libxslt.la ; then
echo libxslt compiled
else
echo Problem while compiling libxslt
exit
fi
cd $Home
##################################################################
# Compile jansson
cd jansson
make clean
Parallel_Make
if test -e src/.libs/libjansson.la; then
echo jansson compiled
else
echo Problem while compiling jansson
exit
fi
cd $Home
##################################################################
# Compile libevent
cd libevent
make clean
Parallel_Make
if test -e .libs/libevent.la; then
echo libevent compiled
else
echo Problem while compiling libevent
exit
fi
cd $Home
##################################################################
# Compile sqlite
cd sqlite
make clean
Parallel_Make
if test -e .libs/libsqlite3.la; then
echo sqlite compiled
else
echo Problem while compiling sqlite
exit
fi
cd $Home
##################################################################
# Configure MediaConch
if test -e MediaConch/Project/Qt/prepare; then
cd MediaConch/Project/Qt/
test -e Makefile && rm Makefile
chmod +x prepare
./prepare STATIC_LIBS=1
if test ! -e Makefile; then
echo "Problem while configuring MediaConch (GUI)"
exit
fi
else
echo MediaConch directory is not found
exit
fi
cd $Home
##################################################################
# Compile MediaInfoLib
cd MediaInfoLib/Project/GNU/Library
make clean
Parallel_Make
if test -e libmediainfo.la; then
echo MediaInfoLib compiled
else
echo Problem while compiling MediaInfoLib
exit
fi
cd $Home
##################################################################
# Compile MediaConch
cd MediaConch/Project/Qt
make clean
Parallel_Make
if test -e $BINARY; then
echo "MediaConch (GUI) compiled"
else
echo "Problem while compiling MediaConch (GUI)"
exit
fi
cd $Home
##################################################################
echo "MediaConch executable is MediaConch/Project/Qt/$BINARY"
unset -v Home ZenLib_Options MacOptions OS BINARY
|