Compiling / building XviD with asm optimisations for Mac OS X Intel
Using Apple’s nasm one can compile a working XviD binary using the x86 asm that will run on Core Duo systems. Thanks to Christoph Naegeli and Andrea Gianarro for the following information.
Enter the build/generic directory in the xvid source directory, run bootstrap.sh and (for bash) run:
./configure --enable-macosx_module(這一步得否必須,有待確定)(不加這個,也可以正常操作)
特別提醒:修改platform.inc文件, 要在./configure 操作之後
Then edit build/generic/platform.inc and ADD the flags shown below:第一個:"-undefined suppress" to SPECIFIC_CFLAGS(不添加這個也可鏈接成功)
第二個:"-f macho -DPREFIX" to AFLAGS (so it reads AFLAGS="AFLAGS=-I$(<D)/ -f macho
-DPREFIX")
第三個:"-read_only_relocs suppress" to SPECIFIC_LDFLAGS()
Here’s my platform.inc if you would like to have a look to check you’ve edited it correctly.
Then make and make install as usual.
I also change -O2 to -O3 and add “-march=prescott” to the CFLAGS and configure with –prefix=/usr/local . The CFLAGS enable some GCC optimisations. There is debate as to whether the use of -march with “pentium-m” or “prescott” is better for the Core processors. I haven’t particularly researched it all that much but the Core is supposedly a heavily reworked Pentium 3 that is a bit like a Pentium M, has the same instruction set as the Prescott and behaves more like the NetBurst architecture. As such -march=prescott is supposed to be the most appropriate choice. When I get bored someday I’ll run some benchmarks and test to see which is faster.