summaryrefslogtreecommitdiffstats
path: root/meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff')
-rw-r--r--meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff103
1 files changed, 103 insertions, 0 deletions
diff --git a/meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff b/meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff
new file mode 100644
index 0000000000..90718d4976
--- /dev/null
+++ b/meta/packages/cairo/cairo-1.2.4/0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.diff
@@ -0,0 +1,103 @@
1From nobody Mon Sep 17 00:00:00 2001
2From: Dan Amelang <dan@amelang.net>
3Date: Sun Oct 29 21:30:08 2006 -0800
4Subject: [PATCH] Add autoconf macro AX_C_FLOAT_WORDS_BIGENDIAN
5
6The symbol that this macro defines (FLOAT_WORDS_BIGENDIAN) can be used
7to make double arithmetic tricks portable.
8
9---
10
11 acinclude.m4 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 configure.in | 1 +
13 2 files changed, 66 insertions(+), 0 deletions(-)
14
153231d91b59a6c2e1c40bbaa8b143694b6c693662
16diff --git a/acinclude.m4 b/acinclude.m4
17index af73800..a0eb13a 100644
18--- a/acinclude.m4
19+++ b/acinclude.m4
20@@ -51,3 +51,68 @@ ifelse([$1],[],,
21 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
22 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
23 ])
24+
25+# AX_C_FLOAT_WORDS_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE],
26+# [ACTION-IF-UNKNOWN])
27+#
28+# Checks the ordering of words within a multi-word float. This check
29+# is necessary because on some systems (e.g. certain ARM systems), the
30+# float word ordering can be different from the byte ordering. In a
31+# multi-word float context, "big-endian" implies that the word containing
32+# the sign bit is found in the memory location with the lowest address.
33+# This implemenation was inspired by the AC_C_BIGENDIAN macro in autoconf.
34+# -------------------------------------------------------------------------
35+AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
36+ [AC_CACHE_CHECK(whether float word ordering is bigendian,
37+ ax_cv_c_float_words_bigendian, [
38+
39+# The endianess is detected by first compiling C code that contains a special
40+# double float value, then grepping the resulting object file for certain
41+# strings of ascii values. The double is specially crafted to have a
42+# binary representation that corresponds with a simple string. In this
43+# implementation, the string "noonsees" was selected because the individual
44+# word values ("noon" and "sees") are palindromes, thus making this test
45+# byte-order agnostic. If grep finds the string "noonsees" in the object
46+# file, the target platform stores float words in big-endian order. If grep
47+# finds "seesnoon", float words are in little-endian order. If neither value
48+# is found, the user is instructed to specify the ordering.
49+
50+ax_cv_c_float_words_bigendian=unknown
51+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
52+
53+double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
54+
55+]])], [
56+
57+if grep noonsees conftest.$ac_objext >/dev/null ; then
58+ ax_cv_c_float_words_bigendian=yes
59+fi
60+if grep seesnoon conftest.$ac_objext >/dev/null ; then
61+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
62+ ax_cv_c_float_words_bigendian=no
63+ else
64+ ax_cv_c_float_words_bigendian=unknown
65+ fi
66+fi
67+
68+])])
69+
70+case $ax_cv_c_float_words_bigendian in
71+ yes)
72+ m4_default([$1],
73+ [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
74+ [Define to 1 if your system stores words within floats
75+ with the most significant word first])]) ;;
76+ no)
77+ $2 ;;
78+ *)
79+ m4_default([$3],
80+ [AC_MSG_ERROR([
81+
82+Unknown float word ordering. You need to manually preset
83+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
84+
85+ ])]) ;;
86+esac
87+
88+])# AX_C_FLOAT_WORDS_BIGENDIAN
89diff --git a/configure.in b/configure.in
90index 2d2bf9f..797c7ce 100644
91--- a/configure.in
92+++ b/configure.in
93@@ -55,6 +55,7 @@ AC_PROG_CPP
94 AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE!
95 AC_STDC_HEADERS
96 AC_C_BIGENDIAN
97+AX_C_FLOAT_WORDS_BIGENDIAN
98
99 dnl ===========================================================================
100 dnl === Local macros
101--
1021.2.6
103