diff options
author | Zack Weinberg <zackw@panix.com> | 2018-10-31 17:08:39 -0400 |
---|---|---|
committer | Björn Esser <besser82@fedoraproject.org> | 2018-10-31 23:57:30 +0100 |
commit | 298d7d06df4f527cc2e530cbe4c1e394d39f5b0e (patch) | |
tree | 2b8e3e4e21e5e3691e785cb1f37c18812a465899 /configure.ac | |
parent | a1d03229cbdb34a97e4e53ae74601ed25e038374 (diff) | |
download | libxcrypt-298d7d06df4f527cc2e530cbe4c1e394d39f5b0e.tar.gz libxcrypt-298d7d06df4f527cc2e530cbe4c1e394d39f5b0e.tar.bz2 libxcrypt-298d7d06df4f527cc2e530cbe4c1e394d39f5b0e.zip |
Replace AC_C_BIGENDIAN with a new, fat-binary friendly macro.
AC_C_BIGENDIAN tries to determine the endianness of the host
architecture at configure time. This isn’t always possible. For
instance, when compiling “fat” binaries for MacOS, the compiler may be
simultaneously producing (big-endian) PowerPC and (little-endian) x86
machine code, so there’s no right answer at configure time. But there
_is_ a right answer at compile time, because the compiler’s going to
set appropriate predefined macros for each side of the fat
compilation.
The new zw_C_ENDIANNESS only figures out _what macros to use_ at
configure time; the actual decision of big- or little-endian is
deferred to when crypt-port.h is preprocessed. There is still a
regrettably long list of macros to check, but it’s hidden away in
m4/zw_endianness.m4 and shouldn’t need to concern people most of the
time.
As a side effect, limits.h is now included by crypt-port.h and
therefore does not need to be directly included anymore.
Note that zw_C_ENDIANNESS is prepared for the possibility of a
“PDP-endian” architecture (bytes ordered 3, 4, 1, 2 within a 32-bit
word, where 1 is the lowest-order byte and 4 the highest) but
crypt-port.h will #error out if that case turns out to be true.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index bc5817c..682cafa 100644 --- a/configure.ac +++ b/configure.ac @@ -49,14 +49,6 @@ AC_SYS_LARGEFILE zw_SIMPLE_ENABLE_WARNINGS LT_INIT -# Check for system's endianness -AC_C_BIGENDIAN( - AC_DEFINE(XCRYPT_BE_ARCH, 1, [System is bigendian.]), - AC_DEFINE(XCRYPT_LE_ARCH, 1, [System is littleendian.]), - AC_MSG_WARN([Relying on macros defined in "crypt-port.h" to detect system's endianness.]), - AC_MSG_WARN([Relying on macros defined in "crypt-port.h" to detect system's endianness.]) -) - # One of the test scripts needs to use -dD. AC_CACHE_CHECK([whether the preprocessor ($CPP) supports -dD], [ac_cv_prog_cc_dD], @@ -127,6 +119,7 @@ fi zw_C_ALIGNAS zw_C_ALIGNOF zw_C_MAX_ALIGN_T +zw_C_ENDIANNESS zw_C_STATIC_ASSERT zw_PROG_LD_WRAP AX_CHECK_VSCRIPT |