diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-06-03 22:16:16 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-06-03 22:16:16 +0400 |
commit | 3c86930e4596948c4f814e1f5fa3cc79b849ea1f (patch) | |
tree | 02dcd958c574e84baf2058c79e8d839c287f26c7 | |
parent | 8c19583244b87a08661c37ae372777423b44bee1 (diff) | |
download | mesa-3c86930e4596948c4f814e1f5fa3cc79b849ea1f.tar.gz |
Fixed POSIX.1-2008 newlocale(), etc. detection
-rw-r--r-- | debian/patches/dyson-newlocale.patch | 87 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 88 insertions, 0 deletions
diff --git a/debian/patches/dyson-newlocale.patch b/debian/patches/dyson-newlocale.patch new file mode 100644 index 0000000000..60c49615e1 --- /dev/null +++ b/debian/patches/dyson-newlocale.patch @@ -0,0 +1,87 @@ +Index: mesa/configure.ac +=================================================================== +--- mesa.orig/configure.ac 2014-06-03 21:22:02.222174464 +0400 ++++ mesa/configure.ac 2014-06-03 21:22:02.609600235 +0400 +@@ -71,6 +71,18 @@ + + AC_PROG_INSTALL + ++ ++AC_CHECK_HEADERS([locale.h xlocale.h]) ++AC_CHECK_TYPES([locale_t], [], [], [ ++#ifdef HAVE_LOCALE_H ++#include <locale.h> ++#ifdef HAVE_XLOCALE_H ++#include <xlocale.h> ++#endif ++#endif ++]) ++AC_CHECK_FUNCS(strtod_l strtof_l strtof newlocale) ++ + dnl We need a POSIX shell for parts of the build. Assume we have one + dnl in most cases. + case "$host_os" in +Index: mesa/src/glsl/strtod.c +=================================================================== +--- mesa.orig/src/glsl/strtod.c 2014-06-03 21:20:26.252558211 +0400 ++++ mesa/src/glsl/strtod.c 2014-06-03 21:22:02.616000290 +0400 +@@ -26,9 +26,9 @@ + + #include <stdlib.h> + +-#ifdef _GNU_SOURCE ++#ifdef HAVE_LOCALE_H + #include <locale.h> +-#ifdef __APPLE__ ++#ifdef HAVE_XLOCALE_H + #include <xlocale.h> + #endif + #endif +@@ -44,7 +44,7 @@ + double + glsl_strtod(const char *s, char **end) + { +-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ ++#if defined(HAVE_NEWLOCALE) && defined(HAVE_STRTOD_L) && defined(HAVE_LOCALE_T) + !defined(__HAIKU__) && !defined(__UCLIBC__) + static locale_t loc = NULL; + if (!loc) { +@@ -64,14 +64,13 @@ + float + glsl_strtof(const char *s, char **end) + { +-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ +- !defined(__HAIKU__) && !defined(__UCLIBC__) ++#if defined(HAVE_NEWLOCALE) && defined(HAVE_STRTOF_L) && defined(HAVE_LOCALE_T) + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); + } + return strtof_l(s, end, loc); +-#elif _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE ++#elif defined(HAVE_STRTOF) + return strtof(s, end); + #else + return (float) strtod(s, end); +Index: mesa/src/mesa/main/imports.c +=================================================================== +--- mesa.orig/src/mesa/main/imports.c 2014-06-03 14:51:54.619369286 +0400 ++++ mesa/src/mesa/main/imports.c 2014-06-03 21:38:06.612762310 +0400 +@@ -569,15 +569,13 @@ + float + _mesa_strtof( const char *s, char **end ) + { +-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ +- !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) && \ +- !defined(__NetBSD__) ++#if defined(HAVE_LOCALE_T) && defined(HAVE_NEWLOCALE) && defined(HAVE_STRTOF_L) + 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) ++#elif defined(HAVE_STRTOF) + return strtof(s, end); + #else + return (float)strtod(s, end); diff --git a/debian/patches/series b/debian/patches/series index 25648507a9..339c873e2b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 04_osmesa_version.diff 07_gallium-fix-build-failure-on-powerpcspe.diff dyson-use-system-extensions.patch +dyson-newlocale.patch |