diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2023-04-05 14:28:49 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2023-04-05 14:28:49 +0900 |
commit | 630f3f73f62a121abb1af5b215d193aec4e0053c (patch) | |
tree | fa1d55325306f5e26de8df0115ede50ae69d3d9c | |
parent | 9553dbf12ec42a58beb671a7039827fbd652e14d (diff) | |
download | ibus-630f3f73f62a121abb1af5b215d193aec4e0053c.tar.gz |
configure: Use AC_C_BIGENDIAN for BSD systems
NetBSD does not define __BYTE_ORDER and use AC_C_BIGENDIAN instead.
BUG=https://github.com/ibus/ibus/pull/2477
-rw-r--r-- | configure.ac | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac index ece1d9ee..b3eacbcb 100644 --- a/configure.ac +++ b/configure.ac @@ -152,35 +152,12 @@ AC_CHECK_LIB(c, dlclose, LIBDL="", [AC_CHECK_LIB(dl, dlclose, LIBDL="-ldl")]) AC_SUBST(LIBDL) # Check endianness. -AC_MSG_CHECKING([build system endianness]) -ENDIAN=unknown -AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[ - #include <endian.h> - #if __BYTE_ORDER != __LITTLE_ENDIAN - #error - #endif - ]] - )], - [ENDIAN=little] -) -AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[ - #include <endian.h> - #if __BYTE_ORDER != __BIG_ENDIAN - #error - #endif - ]] - )], - [ENDIAN=big] -) +AC_C_BIGENDIAN([ENDIAN=big], [ENDIAN=little], [ENDIAN=unknown], [ENDIAN=big]) if test x"$ENDIAN" != xlittle -a x"$ENDIAN" != xbig; then - AC_MSG_ERROR([Cannot deermine endianness without endian.h]) + AC_MSG_ERROR([Cannot determine endianness. Use ac_cv_c_bigendian to yes or no]) fi -AC_MSG_RESULT($ENDIAN) AC_SUBST(ENDIAN) +ENDIAN_MSG="$ENDIAN (ac_cv_c_bigendian=$ac_cv_c_bigendian)" # Check packages. # Check glib2. @@ -902,7 +879,7 @@ Build options: Install prefix $prefix Build shared libs $enable_shared Build static libs $enable_static - Build endianness $ENDIAN + Build endianness $ENDIAN_MSG CFLAGS $CFLAGS PYTHON $PYTHON PYTHON2 $PYTHON2 |