* configure.ac: Improved --disable-endian-check that doesn't involve
authorDavid Shaw <dshaw@jabberwocky.com>
Mon, 20 Mar 2006 16:13:52 +0000 (16:13 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Mon, 20 Mar 2006 16:13:52 +0000 (16:13 +0000)
changing #ifdefs in the rest of the code.

ChangeLog
configure.ac

index 61be84a..580015f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-20  David Shaw  <dshaw@jabberwocky.com>
+
+       * configure.ac: Improved --disable-endian-check that doesn't
+       involve changing #ifdefs in the rest of the code.
+
 2006-03-19  David Shaw  <dshaw@jabberwocky.com>
 
        * configure.ac: Add --disable-endian-check for building fat
index 9c6928e..06d9cb0 100644 (file)
@@ -405,6 +405,18 @@ AH_TOP([
 ])
 
 AH_BOTTOM([
+/* We didn't define endianness above, so get it from OS macros.  This
+is intended for making fat binary builds on OS X. */
+#if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
+#if defined(__BIG_ENDIAN__)
+#define BIG_ENDIAN_HOST 1
+#elif defined(__LITTLE_ENDIAN__)
+#define LITTLE_ENDIAN_HOST 1
+#else
+#error "No endianness found"
+#endif
+#endif
+
 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
 #define EXEC_TEMPFILE_ONLY
 #endif
@@ -824,15 +836,11 @@ AC_TYPE_SIGNAL
 AC_DECL_SYS_SIGLIST
 
 AC_ARG_ENABLE(endian-check,
-              AC_HELP_STRING([--disable-endian-check],[disable the endian check and trust the OS provided macros]),
+              AC_HELP_STRING([--disable-endian-check],
+             [disable the endian check and trust the OS provided macros]),
              endiancheck=$enableval,endiancheck=yes)
 
-if test x"$endiancheck" = xno ; then
-   # don't do an endian check so we can build universal ("fat")
-   # binaries on OS X.
-   AC_DEFINE_UNQUOTED(LITTLE_ENDIAN_HOST,__LITTLE_ENDIAN__)
-   AC_DEFINE_UNQUOTED(BIG_ENDIAN_HOST,__BIG_ENDIAN__)
-else
+if test x"$endiancheck" = xyes ; then
    GNUPG_CHECK_ENDIAN
 fi