-intel_macosx_word_size() {
- ensure_program_installed sysctl
- $ECHO -n "Testing if your Intel Mac supports 64bit binaries..."
- sysctl machdep.cpu.extfeatures | grep EM64T >/dev/null
- if [[ $? -eq 0 ]] ; then
- WORD=64
- $ECHO "yes!"
- else
- WORD=32
- $ECHO "no."
- fi
-}
-
-find_word_size() {
- if [[ -n $WORD ]] ; then return; fi
- if [[ $OS == macosx && $ARCH == x86 ]] ; then
- intel_macosx_word_size
- else
- WORD=$(find_word_size_cpp || c_find_word_size)
- fi
-}
-
-find_word_size_cpp() {
- SIXTY_FOUR='defined(__aarch64__) || defined(__x86_64__) || defined(_M_AMD64) || defined(__PPC64__) || defined(__64BIT__)'
- THIRTY_TWO='defined(i386) || defined(__i386) || defined(__i386__) || defined(_MIX86)'
- cc -E -xc <(echo -e "#if ${SIXTY_FOUR}\n64\n#elif ${THIRTY_TWO}\n32\n#endif") | tail -1
-}
-