configure.ac: reject 'universal' builds
authorRyan Lortie <desrt@desrt.ca>
Wed, 7 Jan 2015 21:15:22 +0000 (16:15 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sat, 10 Jan 2015 23:00:02 +0000 (18:00 -0500)
AC_C_BIGENDIAN can return 'universal' as the result in the case that we
are trying to do a universal build on Mac OS.  This has to be opted into
explicitly by using multiple -arch CFLAGS.

Previously, we detected this result and fell back to doing our own check
based on the endianness of the build machine, hardcoding that.  This
means that universal builds might successfully build, but the binaries
would never actually run correctly on the 'opposite' arch.

This check was added because of a bug in the intial implementation of
this detection in autoconf, which was inappropriately identifying
non-macos compilers as 'universal'.  That was hitting ppc64 systems.
See https://bugzilla.redhat.com/show_bug.cgi?id=449944 for more info.

Commit b0e687ef42e21b1eb7af18c4eaebcd41b0bd5632 in autoconf ("Limit
AC_C_BIGENDIAN univeral checks to Mac OS X") solved this issue in 2008,
so let's remove our workaround.  For good measure, if we detect
"universal" in the result, error out.

https://bugzilla.gnome.org/show_bug.cgi?id=742548

configure.ac

index b0929d0..4c2fc45 100644 (file)
@@ -762,17 +762,7 @@ AM_CONDITIONAL(HAVE_SUNSTUDIO_VISIBILITY, [test x$g_have_sunstudio_visibility =
 # check for bytesex stuff
 AC_C_BIGENDIAN
 if test x$ac_cv_c_bigendian = xuniversal ; then
-AC_TRY_COMPILE([#include <endian.h>], [#if __BYTE_ORDER == __BIG_ENDIAN
-#else
-#error Not a big endian. 
-#endif],
-    ac_cv_c_bigendian=yes
-    ,AC_TRY_COMPILE([#include <endian.h>], [#if __BYTE_ORDER == __LITTLE_ENDIAN
-#else
-#error Not a little endian. 
-#endif],
-    ac_cv_c_bigendian=no
-    ,AC_MSG_WARN([Could not determine endianness.])))
+  AC_MSG_ERROR([Universal builds not supported: see https://bugs.gnome.org/742548])
 fi