ygrek / mldonkey

cross-platform multi-network p2p daemon (previously at http://mldonkey.sourceforge.net/)
Other
258 stars 46 forks source link

NATIVEENDIAN is set to LittleEndian on a Big-endian platform #110

Open barracuda156 opened 3 months ago

barracuda156 commented 3 months ago

Maybe I misunderstand something, but why on a Big-endian system I get NATIVEENDIAN='LittleEndian' in configure status? Autoconf correctly determines the endianness and sets it here:

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=powerpc-apple-darwin10.0.0d2
ac_cv_c_bigendian=yes
ac_cv_c_compiler_gnu=yes

Yet, further down I see:

MD4ARCH='power'
MD4COMP='cc'
MINOR_VERSION='1'
MLDONKEY_VERSION='3.1.7'
MORE_SUBDIRS=''
MORE_TARGETS=' mldonkey_gui$(EXE)'
NATIVEENDIAN='LittleEndian'
NEWCXX='ccache /opt/local/bin/g++-mp-14'
ygrek commented 2 months ago

maybe because :thinking:

The default for action-if-true is to define ‘WORDS_BIGENDIAN’. The default for action-if-false is to do nothing. The default for action-if-unknown is to abort configure and tell the installer how to bypass this test. And finally, the default for action-if-universal is to ensure that ‘WORDS_BIGENDIAN’ is defined if and only if a universal build is detected and the current code is big-endian; this default works only if autoheader is used.

If you use this macro without specifying action-if-universal, you should also use AC_CONFIG_HEADERS; otherwise ‘WORDS_BIGENDIAN’ may be set incorrectly for Mac OS X universal binary files.

anyhow this check will go away with bitstring unbundling

barracuda156 commented 2 months ago

Just in case, that was a single-arch build (gcc does not support universal builds at all presently).