MyCometG3
4th November 2008, 09:21
FYI; for MacOS X and Linux users.
To anyone who want to build custom build using patches.
// ==============================================
// On Linux, I guess it's simple way.
1) download daily snapshot tarball (http://www.xvid.org/Xvid-Codec.2.0.html).
It is the well-known multithreaded version xvid-1.2.
2) Download VAQ patch and apply it to lumimasking.c (from http://forum.doom9.org/showthread.php?t=135093).
3) cd build/generic
4) sh bootstrap.sh
5) sh configure
6) make clean
7) make -j3
8) sudo make install
// ==============================================
// On MacOS X, you have to do some more.
0a) install macport, then install yasm
0b) export PATH="$PATH:/opt/local/bin"
4a) sh bootstrap.sh
4b) PPC: patch -faltivec to configure
Open build/generic/configure, replace all "-faltivec" with "-arch ppc -faltivec"
4c) i386: patch xvid.fdct_sse2_skal.asm (from http://trac.handbrake.fr/changeset/1315)
Open src/dct/x86_asm/xvid.fdct_sse2_skal.asm and patch it.
5) sh configure --enable-macosx_module
// ==============================================
// For MacOS X cross-compile, you need some extra steps.
// example; Followings are build on 10.5.x, target for 10.4.x or later.
5a)
# Xcompile intel core
THEARC="i386"; THECPU="-mtune=pentium-m "
THEBUILD="powerpc-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
THEHOST="i386-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
# Xcompile PPC G4
THEARC="ppc"; THECPU="-mcpu=7450 -faltivec "
THEBUILD="i386-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
THEHOST="powerpc-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
5b)
THESDK="/Developer/SDKs/MacOSX10.4u.sdk"
export LDFLAGS="-arch $THEARC -isysroot $THESDK -mmacosx-version-min=10.4 -Wl,-syslibroot,$THESDK "
export CFLAGS="-arch $THEARC -isysroot $THESDK -mmacosx-version-min=10.4 $THECPU"
sh configure --enable-macosx_module --build=$THEBUILD --host=$THEHOST
8) Extra step; You can make universal binary using lipo:
Keep each build (rename binary with suffix like .ppc or .i386)
lipo -create libxvidcore.a.ppc libxvidcore.a.i386 -output libxvidcore.a
lipo -create xvid_encraw.ppc xvid_encraw.i386 -output xvid_encraw
To anyone who want to build custom build using patches.
// ==============================================
// On Linux, I guess it's simple way.
1) download daily snapshot tarball (http://www.xvid.org/Xvid-Codec.2.0.html).
It is the well-known multithreaded version xvid-1.2.
2) Download VAQ patch and apply it to lumimasking.c (from http://forum.doom9.org/showthread.php?t=135093).
3) cd build/generic
4) sh bootstrap.sh
5) sh configure
6) make clean
7) make -j3
8) sudo make install
// ==============================================
// On MacOS X, you have to do some more.
0a) install macport, then install yasm
0b) export PATH="$PATH:/opt/local/bin"
4a) sh bootstrap.sh
4b) PPC: patch -faltivec to configure
Open build/generic/configure, replace all "-faltivec" with "-arch ppc -faltivec"
4c) i386: patch xvid.fdct_sse2_skal.asm (from http://trac.handbrake.fr/changeset/1315)
Open src/dct/x86_asm/xvid.fdct_sse2_skal.asm and patch it.
5) sh configure --enable-macosx_module
// ==============================================
// For MacOS X cross-compile, you need some extra steps.
// example; Followings are build on 10.5.x, target for 10.4.x or later.
5a)
# Xcompile intel core
THEARC="i386"; THECPU="-mtune=pentium-m "
THEBUILD="powerpc-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
THEHOST="i386-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
# Xcompile PPC G4
THEARC="ppc"; THECPU="-mcpu=7450 -faltivec "
THEBUILD="i386-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
THEHOST="powerpc-apple-darwin8.11.0" # Compatiblity Tiger 10.4.11
5b)
THESDK="/Developer/SDKs/MacOSX10.4u.sdk"
export LDFLAGS="-arch $THEARC -isysroot $THESDK -mmacosx-version-min=10.4 -Wl,-syslibroot,$THESDK "
export CFLAGS="-arch $THEARC -isysroot $THESDK -mmacosx-version-min=10.4 $THECPU"
sh configure --enable-macosx_module --build=$THEBUILD --host=$THEHOST
8) Extra step; You can make universal binary using lipo:
Keep each build (rename binary with suffix like .ppc or .i386)
lipo -create libxvidcore.a.ppc libxvidcore.a.i386 -output libxvidcore.a
lipo -create xvid_encraw.ppc xvid_encraw.i386 -output xvid_encraw