On 2/23/11 8:33 AM, Dominique Dhumieres wrote:
Updating to xvidcore-1.2.2-2 failed with:

(1) G4 OSX 10.4.11

make: Entering directory 
`/sw/src/fink.build/xvidcore-1.2.2-2/xvidcore/build/generic'
   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: Leaving directory 
`/sw/src/fink.build/xvidcore-1.2.2-2/xvidcore/build/generic'
### execution of /var/tmp/tmp.1.OCZ7Rk failed, exit code 2
Removing runtime build-lock...
Removing build-lock package...
/sw/bin/dpkg-lockwait -r fink-buildlock-xvidcore-1.2.2-2
(Reading database ... 447765 files and directories currently installed.)
Removing fink-buildlock-xvidcore-1.2.2-2 ...
Failed: phase compiling: xvidcore-1.2.2-2 failed

Apparently _SC_NPROCESSORS_CONF doesn't exist on 10.4, but upstream has a patch. Take the xvidcore.patch file that is in this message and save it to /sw/fink/dists/unstable/main/finkinfo/graphics/xvidcore.patch (overwrite the original) and then modify xvidcore.info in the same directory to change the PatchFile-MD5: field to cdd3227f6477e3b0a7e9e4d78d1f6d95 and rebuild xvidcore.

This should fix the 10.4 build. Note that there's a new yasm now available in Fink: 1.1.0. Upgrade that first to make sure you have the latest version before retrying xvidcore. Please post your positive or negative results from this change on 10.4.

For those following at home, the source of the 10.4 patch:
http://list.xvid.org/pipermail/xvid-devel/2009-May/006094.html

(2) Core2Duo OSX 10.6.6
...

Presumably 10.6/x86_64

   A: utils/x86_asm/mem_transfer_3dne.asm
   A: utils/x86_asm/interlacing_mmx.asm
   A: utils/x86_asm/cpuid.asm
   A: plugins/x86_asm/plugin_ssim-a.asm
   L: libxvidcore.a
/usr/bin/ranlib: archive member: libxvidcore.a(cbp_mmx.o) cputype (7) does not 
match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: libxvidcore.a(cbp_sse2.o) cputype (7) does not 
match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: libxvidcore.a(fdct_mmx_ffmpeg.o) cputype (7) 
does not match previous archive members cputype (16777223) (all members must 
match)
...
/usr/bin/ranlib: archive member: libxvidcore.a(plugin_ssim-a.o) cputype (7) 
does not match previous archive members cputype (16777223) (all members must 
match)
/usr/bin/ranlib: object: libxvidcore.a(idct_sse2_dmitry.o) malformed object 
(addr field plus size of section 1 in LC_SEGMENT command 0 greater than than 
the segment's vmaddr plus vmsize)
ar: internal ranlib command failed
make: *** [libxvidcore.a] Error 1
make: Leaving directory 
`/sw64/src/fink.build/xvidcore-1.2.2-2/xvidcore/build/generic'

This is also known and is partly fixed by updating yasm, but it'll still fail and I'm still looking for a solution.

Note that the update went fine on a G5 OSX 10.5.8

This is good to know that PPC hasn't been completely borked by the update. What I've now determined is that 10.5 is the only decent OS X version around :)

Hanspeter
--- xvidcore/build/generic/configure.orig       2009-05-28 13:13:31.000000000 
-0400
+++ xvidcore/build/generic/configure    2011-02-22 16:38:01.000000000 -0500
@@ -1319,7 +1319,7 @@
 API_MAJOR="4"
 API_MINOR="2"
 
-minimum_yasm_minor_version=8
+minimum_yasm_major_version=1
 minimum_nasm_minor_version=0
 minimum_nasm_major_version=2
 nasm_prog="nasm"
@@ -3977,14 +3977,14 @@
    if test "$ac_yasm" = "yes" ; then
                             echo "$as_me:$LINENO: checking for yasm version" 
>&5
 echo $ECHO_N "checking for yasm version... $ECHO_C" >&6
-       yasm_minor=`$yasm_prog --version | cut -d '.' -f 2 | cut -d ' ' -f 1`
-       if test -z $yasm_minor ; then
-          yasm_minor=-1
+       yasm_major=`$yasm_prog --version | head -n 1 | cut -d '.' -f 1 | cut -d 
' ' -f 2`
+       if test -z $yasm_major ; then
+          yasm_major=-1
        fi
-       echo "$as_me:$LINENO: result: $yasm_minor" >&5
-echo "${ECHO_T}$yasm_minor" >&6
+       echo "$as_me:$LINENO: result: $yasm_major" >&5
+echo "${ECHO_T}$yasm_major" >&6
 
-                     if test "$yasm_minor" -lt "$minimum_yasm_minor_version" ; 
then
+                     if test "$yasm_major" -lt "$minimum_yasm_major_version" ; 
then
          { echo "$as_me:$LINENO: WARNING: yasm version is too old" >&5
 echo "$as_me: WARNING: yasm version is too old" >&2;}
        else

--- xvidcore/src/xvid.c.orig    2009-02-28 00:13:41 -0600
+++ xvidcore/src/xvid.c 2009-02-28 00:13:45 -0600
@@ -32,6 +32,17 @@
   #include <unistd.h>
 #endif
 
+#if defined(__APPLE__) && defined(__MACH__)
+#  include <sys/types.h>
+#  include <sys/sysctl.h>
+#  ifdef MAX
+#    undef MAX
+#  endif
+#  ifdef MIN
+#    undef MIN
+#  endif
+#endif
+
 #include "xvid.h"
 #include "decoder.h"
 #include "encoder.h"
@@ -677,10 +682,29 @@
        info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of 
_logical_ cores */
   }
 
-#else
+#elif defined(__APPLE__) && defined(__MACH__)
+
+  {
+    size_t len;
+    int    mib[2], ncpu;
+
+    mib[0] = CTL_HW;
+    mib[1] = HW_NCPU;
+    len    = sizeof(ncpu);
+    if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == 0)
+      info -> num_threads = ncpu;
+    else
+      info -> num_threads = 1;
+  }
+
+#elif defined(_SC_NPROCESSORS_CONF)
 
   info->num_threads = sysconf(_SC_NPROCESSORS_CONF);   
 
+#else
+
+  info->num_threads = 1;
+
 #endif
 
        return 0;
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to