[XviD-devel] [PATCH] xvid-1.2.2 compilation patch for Darwin

Michael Militzer michael at xvid.org
Sun May 31 14:03:00 CEST 2009


Hi,

thanks for the patch. I however do not really understand why it is needed.
Xvid 1.2.2 compiles fine for me on OSX 10.5 (x86) without any modification.
Also according to the Darwin documentation, _SC_NPROCESSORS_CONF should be
available:

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sysconf.3.html

So I don't understand why we should avoid the use of _SC_NPROCESSORS_CONF
for Darwin (as your patch indicates). Can you shed some light on this?

Thanks,
Michael


Quoting Fabian Groffen <grobian at gentoo.org>:

> Compilation fails this way:
>
>>>> Compiling source in   
>>>> /Library/Gentoo/var/tmp/portage/media-libs/xvid-1.2.2-r1/work/xvidcore/build/generic   
>>>> ...
> make -j2
>   D: =build
>   C: ./decoder.c
>   C: ./encoder.c
>   C: ./xvid.c
> ../../src/xvid.c: In function ‘xvid_gbl_info’:
> ../../src/xvid.c:682: error: ‘_SC_NPROCESSORS_CONF’ undeclared   
> (first use in this function)
> ../../src/xvid.c:682: error: (Each undeclared identifier is reported  
>  only once
> ../../src/xvid.c:682: error: for each function it appears in.)
> make: *** [xvid.o] Error 1
> make: *** Waiting for unfinished jobs....
>  * ERROR: media-libs/xvid-1.2.2-r1 failed:
>  *   emake failed
>
> The attached patch fixes the issue for Darwin to retrieve the number of
> CPUs via sysctl.  This should also work for BSD, but I couldn't try
> that.  Additionally, the patch avoids failing during compilation by
> assuming a single CPU in case there is no known way to retrieve the
> number of CPUs.
>
> Patch tested on OSX 10.4/ppc and 10.5/x86.
>
>
> --
> Fabian Groffen
> Gentoo on a different level
>








More information about the Xvid-devel mailing list