Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41529 - ebuild command to return endianness of architecture
Summary: ebuild command to return endianness of architecture
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-13 22:00 UTC by Jeremy Huddleston (RETIRED)
Modified: 2004-02-13 22:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-13 22:00:09 UTC
It'd be nice to have a command available to ebuild authors which returned the endianness (big or little endian) of the architecture... so we could do something like:

if eisbigendian; then
  CFLAGS="${CFLAGS} -DBIGENDIAN"
fi

or similar rather than doing a switch statement and trying to remember which arch is which endianness... 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 SpanKY gentoo-dev 2004-02-13 22:05:33 UTC
if your only need is for .c code then

#include <sys/types.h>
#if BYTE_ORDER == LITTLE_ENDIAN
#warn little !
#endif
#if BYTE_ORDER == BIG_ENDIAN
#warn big !
#endif