squashfs: fix build with uClibc
authorPeter Korsgaard <jacmet@sunsite.dk>
Thu, 17 Jun 2010 20:45:22 +0000 (22:45 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 17 Jun 2010 20:45:22 +0000 (22:45 +0200)
squashfs used the get_nprocs() GNU extension, instead of directly
calling sysconf(), breaking the build on uClibc.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
CHANGES
package/squashfs/squashfs-4.0-mksquashfs-get_nprocs.patch [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 0b1dde951b1e8fd6ca4e3dac358a40877a508239..c9cf1e0ba6f7c04baf40b931303bf7f1cbaf551b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -15,8 +15,8 @@
 
        Updated/fixed packages: busybox, cdrkit, file, gawk,
        gstreamer, intltool, ipsec-tools, iptables, libart, libidn,
-       lmbench, lrzsz, netperf, openssl, php, qt, sqlite, tn5250,
-       usbutils, xkeyboard-config
+       lmbench, lrzsz, netperf, openssl, php, qt, sqlite, squashfs,
+       tn5250, usbutils, xkeyboard-config
 
        Removed packages: modutils
 
diff --git a/package/squashfs/squashfs-4.0-mksquashfs-get_nprocs.patch b/package/squashfs/squashfs-4.0-mksquashfs-get_nprocs.patch
new file mode 100644 (file)
index 0000000..8a19923
--- /dev/null
@@ -0,0 +1,37 @@
+[PATCH] squashfs-tools: Don't use get_nprocs()
+
+get_nprocs() is a GNU extension, not supported on E.G. uClibc. It is a
+simple wrapper around sysconf(_SC_NPROCESSORS_CONF), so use that instead.
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ squashfs-tools/mksquashfs.c |    2 +-
+ squashfs-tools/unsquashfs.c |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: squashfs4.0/squashfs-tools/mksquashfs.c
+===================================================================
+--- squashfs4.0.orig/squashfs-tools/mksquashfs.c
++++ squashfs4.0/squashfs-tools/mksquashfs.c
+@@ -3705,7 +3705,7 @@ void initialise_threads()
+                       processors = 1;
+               }
+ #else
+-              processors = get_nprocs();
++              processors = sysconf(_SC_NPROCESSORS_CONF);
+ #endif
+       }
+Index: squashfs4.0/squashfs-tools/unsquashfs.c
+===================================================================
+--- squashfs4.0.orig/squashfs-tools/unsquashfs.c
++++ squashfs4.0/squashfs-tools/unsquashfs.c
+@@ -1811,7 +1811,7 @@ void initialise_threads(int fragment_buf
+                       processors = 1;
+               }
+ #else
+-              processors = get_nprocs();
++              processors = sysconf(_SC_NPROCESSORS_CONF);
+ #endif
+       }