Skip to content

Commit 76b2cec

Browse files
authored
Get endianness into Makefile variable
1 parent 276c179 commit 76b2cec

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Makefile.system

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ export OSNAME
13281328
export ARCH
13291329
export CORE
13301330
export LIBCORE
1331+
export __BYTE_ORDER__
13311332
export PGCPATH
13321333
export CONFIG
13331334
export CC

getarch.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,13 @@ int main(int argc, char *argv[]){
12981298
#endif
12991299
#endif
13001300

1301+
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
1302+
printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
1303+
#endif
1304+
#if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ > 0
1305+
printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
1306+
#endif
1307+
13011308
#ifdef MAKE_NB_JOBS
13021309
#if MAKE_NB_JOBS > 0
13031310
printf("MAKE += -j %d\n", MAKE_NB_JOBS);

0 commit comments

Comments
 (0)