bump version
[buildroot.git] / package / cairo / 0001-Add-autoconf-macro-AX_C_FLOAT_WORDS_BIGENDIAN.patch
blob90718d4976298ba864faa11f49a236b6f8e272d1
1 From nobody Mon Sep 17 00:00:00 2001
2 From: Dan Amelang <dan@amelang.net>
3 Date: Sun Oct 29 21:30:08 2006 -0800
4 Subject: [PATCH] Add autoconf macro AX_C_FLOAT_WORDS_BIGENDIAN
6 The symbol that this macro defines (FLOAT_WORDS_BIGENDIAN) can be used
7 to make double arithmetic tricks portable.
9 ---
11 acinclude.m4 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 configure.in | 1 +
13 2 files changed, 66 insertions(+), 0 deletions(-)
15 3231d91b59a6c2e1c40bbaa8b143694b6c693662
16 diff --git a/acinclude.m4 b/acinclude.m4
17 index 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")
25 +# AX_C_FLOAT_WORDS_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE],
26 +# [ACTION-IF-UNKNOWN])
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, [
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.
50 +ax_cv_c_float_words_bigendian=unknown
51 +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
53 +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
55 +]])], [
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
68 +])])
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([
82 +Unknown float word ordering. You need to manually preset
83 +ax_cv_c_float_words_bigendian=no (or yes) according to your system.
85 + ])]) ;;
86 +esac
88 +])# AX_C_FLOAT_WORDS_BIGENDIAN
89 diff --git a/configure.in b/configure.in
90 index 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
99 dnl ===========================================================================
100 dnl === Local macros
102 1.2.6