Created
March 16, 2013 15:42
-
-
Save siretart/5176950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar xvf *.tar.xz | |
rm *.tar.xz | |
cd libav-* | |
COMMON_CONFIG="--enable-runtime-cpudetect --enable-cross-compile --enable-w32threads --prefix=/usr --target-os=mingw32 --enable-gpl --enable-version3 --enable-librtmp --enable-libx264 --enable-libvorbis --enable-libvo-aacenc --enable-memalign-hack --enable-shared --enable-avisynth --enable-libvpx --enable-libmp3lame" | |
if [[ $FLAVOR == "win32" ]]; then | |
ROOT=/usr/mingw32/ | |
CONFIG="--enable-w32threads --cross-prefix=mingw32- --arch=i686 --sysroot=${ROOT} $COMMON_CONFIG" | |
elif [[ $FLAVOR == "win64" ]]; then | |
ROOT=/usr/x86_64-w64-mingw32/ | |
CONFIG="--enable-w32threads --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --sysroot=${ROOT} $COMMON_CONFIG" | |
elif [[ $FLAVOR == "win32-pthreads" ]]; then | |
ROOT=/usr/i686-w64-mingw32/ | |
CONFIG="--cross-prefix=i686-w64-mingw32- --arch=i686 --target-os=mingw32 --sysroot=${ROOT} $COMMON_CONFIG" | |
elif [[ $FLAVOR == "win64-pthreads" ]]; then | |
ROOT=/usr/x86_64-w64-mingw32/ | |
CONFIG="--cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --sysroot=${ROOT} $COMMON_CONFIG" | |
else | |
echo "Unsupported configuration: $FLAVOR" | |
exit 1 | |
fi | |
VERSION=`cat VERSION` | |
DESTDIR="${TMPDIR-/tmp}/$FLAVOR" | |
NAME="libav-$FLAVOR-$VERSION" | |
PKG_CONFIG_SYSROOT_DIR=${ROOT} | |
PKG_CONFIG_PATH=${ROOT}/usr/lib/pkgconfig/ | |
export PKG_CONFIG_PATH PKG_CONFIG_SYSROOT_DIR | |
rm -rf ${DESTDIR} | |
./configure $CONFIG || ( \ | |
echo "==========================" && \ | |
echo "last 50 lines of config.log" && \ | |
tail -50 config.log && \ | |
echo "==========================" && \ | |
exit 1) | |
make V=1 -j$(getconf _NPROCESSORS_ONLN) | |
make V=1 DESTDIR=$DESTDIR install | |
cp -av ${ROOT}/usr/bin/*.dll ${DESTDIR}/usr/bin | |
cp -v VERSION ${DESTDIR} | |
cp -av ${ROOT}/usr/include/{pthread.h,semaphore.h} ${DESTDIR}/usr/include || true # this step may fail in some variants | |
cd .. | |
7z a libav-$VERSION-$FLAVOR.7z ${DESTDIR} | |
rm -rf ${DESTDIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment