]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Adapt AC_C_BIGENDIAN invocation to autoconf 2.62.
authorBruno Haible <bruno@clisp.org>
Sun, 17 Aug 2008 09:51:31 +0000 (09:51 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:47 +0000 (12:15 +0200)
gettext-tools/ChangeLog
gettext-tools/configure.ac

index ecb8a3dd8f91a125f19fbf60786a25412ee6cd43..34b0dff1e742bf6f5b038fed33fc60725946ef7e 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-17  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac: Adapt AC_C_BIGENDIAN invocation to autoconf 2.62: make
+       it work for universal binary builds on MacOS X.
+
 2008-04-20  Bruno Haible  <bruno@clisp.org>
 
        * configure.ac: Use LT_INIT instead of AC_PROG_LIBTOOL.
index 307ade9b92297b29cc21a23a5d520d6dcb728512..1d1f56dd802bf30f81bd3e7153215864f2410676 100644 (file)
@@ -169,12 +169,28 @@ AC_FUNC_VFORK
 gt_SIGINFO
 gt_SETLOCALE
 gt_LIBGREP
+
 AC_C_BIGENDIAN([endianness=1], [endianness=0],
   [echo "AC-C-BIGENDIAN fails to work on your system." | sed -e 's,-,_,g' 1>&2
    echo "Please report this as a bug to bug-autoconf@gnu.org" 1>&2
-   exit 1])
-AC_DEFINE_UNQUOTED([ENDIANNESS], [$endianness],
-  [Define according to the byte order of the target machine: 1 for big endian, 0 for little endian.])
+   exit 1],
+  [endianness=universal])
+if test $endianness != universal; then
+  AC_DEFINE_UNQUOTED([ENDIANNESS], [$endianness],
+    [Define according to the byte order of the target machine: 1 for big endian, 0 for little endian.])
+fi
+dnl For possibly universal binaries, it's not possible to determine the
+dnl endianness at configure time. So determine it at compile time.
+AH_BOTTOM([
+#ifndef ENDIANNESS
+# if defined __BIG_ENDIAN__
+#  define ENDIANNESS 1
+# endif
+# if defined __LITTLE_ENDIAN__
+#  define ENDIANNESS 0
+# endif
+#endif
+])
 
 gt_PREREQ_HOSTNAME