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
|
#!/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 2>&1; 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=""
OS=$(uname -s)
# expr isn’t available on mac
if [ "$OS" = "Darwin" ]; then
OS="mac"
# if the 5 first characters of $OS equal "Linux"
elif [ "$(expr substr $OS 1 5)" = "Linux" ]; then
OS="linux"
#elif [ "$(expr substr $OS 1 5)" = "SunOS" ]; then
# OS="solaris"
#elif [ "$(expr substr $OS 1 7)" = "FreeBSD" ]; then
# OS="freebsd"
fi
##################################################################
# ZenLib
if test -e ZenLib/Project/GNU/Library/configure; then
cd ZenLib/Project/GNU/Library/
test -e Makefile && rm Makefile
chmod +x configure
./configure --enable-static --disable-shared $ZenLib_Options $*
if test -e Makefile; then
make clean
Parallel_Make
if test -e libzen.la; then
echo "ZenLib compiled"
else
echo "Problem while compiling ZenLib"
exit
fi
else
echo "Problem while configuring ZenLib"
exit
fi
else
echo "ZenLib directory is not found"
exit
fi
cd "$Home"
##################################################################
# MediaInfoLib
if test -e MediaInfoLib/Project/GNU/Library/configure; then
cd MediaInfoLib/Project/GNU/Library/
test -e Makefile && rm Makefile
chmod +x configure
./configure --enable-static --disable-shared $*
if test -e Makefile; then
make clean
Parallel_Make
if test -e libmediainfo.la; then
echo "MediaInfoLib compiled"
else
echo "Problem while compiling MediaInfoLib"
exit
fi
else
echo "Problem while configuring MediaInfoLib"
exit
fi
else
echo "MediaInfoLib directory is not found"
exit
fi
cd "$Home"
##################################################################
# MediaInfo (GUI)
if test -e MediaInfo/Project/GNU/GUI/configure; then
cd MediaInfo/Project/GNU/GUI/
test -e Makefile && rm Makefile
chmod +x configure
./configure --enable-staticlibs $*
if test -e Makefile; then
make clean
Parallel_Make
if test -e mediainfo-gui; then
echo "MediaInfo (GUI) compiled"
else
echo "Problem while compiling MediaInfo (GUI)"
exit
fi
else
echo "Problem while configuring MediaInfo (GUI)"
exit
fi
else
echo "MediaInfo directory is not found"
exit
fi
cd "$Home"
##################################################################
echo "MediaInfo executable is MediaInfo/Project/GNU/GUI/mediainfo-gui"
echo "For installing, cd MediaInfo/Project/GNU/GUI && make install"
unset -v Home ZenLib_Options OS
|