Browse Source

fix MesaLib compile with uclibc without locale

Waldemar Brodkorb 11 years ago
parent
commit
eca8f86406

+ 1 - 1
package/MesaLib/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		MesaLib
 PKG_VERSION:=		8.0.5
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		cda5d101f43b8784fa60bdeaca4056f2
 PKG_DESCR:=		MESA library
 PKG_SECTION:=		libs

+ 26 - 0
package/MesaLib/patches/patch-src_gallium_auxiliary_util_u_debug_symbol_c

@@ -0,0 +1,26 @@
+--- Mesa-8.0.5.orig/src/gallium/auxiliary/util/u_debug_symbol.c	2012-10-24 21:03:59.000000000 +0200
++++ Mesa-8.0.5/src/gallium/auxiliary/util/u_debug_symbol.c	2013-09-25 17:45:12.000000000 +0200
+@@ -151,23 +151,6 @@ debug_symbol_name_dbghelp(const void *ad
+ }
+ #endif
+ 
+-#ifdef __GLIBC__
+-#include <execinfo.h>
+-
+-/* This can only provide dynamic symbols, or binary offsets into a file.
+- *
+- * To fix this, post-process the output with tools/addr2line.sh
+- */
+-static INLINE void
+-debug_symbol_name_glibc(const void *addr, char* buf, unsigned size)
+-{
+-   char** syms = backtrace_symbols((void**)&addr, 1);
+-   strncpy(buf, syms[0], size);
+-   buf[size - 1] = 0;
+-   free(syms);
+-}
+-#endif
+-
+ void
+ debug_symbol_name(const void *addr, char* buf, unsigned size)
+ {

+ 32 - 0
package/MesaLib/patches/patch-src_glsl_strtod_c

@@ -0,0 +1,32 @@
+--- Mesa-8.0.5.orig/src/glsl/strtod.c	2012-10-24 21:03:59.000000000 +0200
++++ Mesa-8.0.5/src/glsl/strtod.c	2013-09-25 17:34:06.000000000 +0200
+@@ -25,14 +25,6 @@
+ 
+ 
+ #include <stdlib.h>
+-
+-#ifdef _GNU_SOURCE
+-#include <locale.h>
+-#ifdef __APPLE__
+-#include <xlocale.h>
+-#endif
+-#endif
+-
+ #include "strtod.h"
+ 
+ 
+@@ -44,14 +36,5 @@
+ double
+ glsl_strtod(const char *s, char **end)
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
+-   !defined(__HAIKU__)
+-   static locale_t loc = NULL;
+-   if (!loc) {
+-      loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+-   }
+-   return strtod_l(s, end, loc);
+-#else
+    return strtod(s, end);
+-#endif
+ }

+ 33 - 0
package/MesaLib/patches/patch-src_mesa_main_imports_c

@@ -0,0 +1,33 @@
+--- Mesa-8.0.5.orig/src/mesa/main/imports.c	2012-10-24 21:03:59.000000000 +0200
++++ Mesa-8.0.5/src/mesa/main/imports.c	2013-09-25 17:41:11.000000000 +0200
+@@ -49,14 +49,6 @@
+ #include "mtypes.h"
+ #include "version.h"
+ 
+-#ifdef _GNU_SOURCE
+-#include <locale.h>
+-#ifdef __APPLE__
+-#include <xlocale.h>
+-#endif
+-#endif
+-
+-
+ #define MAXSTRING 4000  /* for vsnprintf() */
+ 
+ #ifdef WIN32
+@@ -766,14 +758,7 @@ _mesa_strdup( const char *s )
+ float
+ _mesa_strtof( const char *s, char **end )
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
+-   !defined(ANDROID) && !defined(__HAIKU__)
+-   static locale_t loc = NULL;
+-   if (!loc) {
+-      loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+-   }
+-   return strtof_l(s, end, loc);
+-#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
++#if defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
+    return strtof(s, end);
+ #else
+    return (float)strtod(s, end);