New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure: Use AC_C_BIGENDIAN macro to check endianness. #2477
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -152,34 +152,10 @@ 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],[]) | ||||||
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]) | ||||||
fi | ||||||
AC_MSG_RESULT($ENDIAN) | ||||||
AC_SUBST(ENDIAN) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think to append There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand what the statement you suggested means. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change will effect the configure result. E.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry I committed multiple revisions and github UI doesn't quote commentted lines exactly. If you meant If you meant 'the change' is to set/update Line 905 in a4007f7
an actual value of $ENDIAN is already set byAC_C_BIGENDIAN([ENDIAN=big],[ENDIAN=little],[ENDIAN=unknown],[]) line and this new one will be overwritten the value. I wonder what happens on reference of $ENDIAN in and it's also referred in src/Makefile.am Line 271 in a4007f7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's why I asked to update ENDIAN after AC_SUBST(ENDIAN)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, even if ENDIAN is updated after AC_SUBST(ENDIAN), the overriding ENDIAN reflects the Makefile recursively. ENDIAN_MSG="$ENDIAN ($ac_cv_c_bigendian, use ac_cv_c_bigendian to yes or no)" and
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you fine to update the configure result? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No problem for me. |
||||||
|
||||||
# Check packages. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space char by comma char.
Probably I think "[ENDIAN=big]" can be applied to the 4th argument for the universal case at the moment.