446 |
|
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used]) |
447 |
|
fi |
448 |
|
|
449 |
+ |
dnl Check whether compiler supports byte bit-fields |
450 |
+ |
AC_CACHE_CHECK([whether compiler supports byte bit-fields], |
451 |
+ |
ac_cv_have_byte_bitfields, [ |
452 |
+ |
AC_LANG_SAVE |
453 |
+ |
AC_LANG_CPLUSPLUS |
454 |
+ |
AC_TRY_RUN([ |
455 |
+ |
struct A { |
456 |
+ |
unsigned char b1:4; |
457 |
+ |
unsigned char b2:4; |
458 |
+ |
unsigned char c; |
459 |
+ |
unsigned short s; |
460 |
+ |
unsigned char a[4]; |
461 |
+ |
}; |
462 |
+ |
|
463 |
+ |
int main(void) { |
464 |
+ |
A a; |
465 |
+ |
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1)); |
466 |
+ |
}], |
467 |
+ |
[ac_cv_have_byte_bitfields=yes], |
468 |
+ |
[ac_cv_have_byte_bitfields=no], |
469 |
+ |
dnl When cross-compiling, assume only GCC supports this |
470 |
+ |
[if [[ "$GCC" = "yes" ]]; then |
471 |
+ |
ac_cv_have_byte_bitfields="guessing yes" |
472 |
+ |
else |
473 |
+ |
ac_cv_have_byte_bitfields="guessing no" |
474 |
+ |
fi] |
475 |
+ |
) |
476 |
+ |
AC_LANG_RESTORE |
477 |
+ |
]) |
478 |
|
|
479 |
|
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
480 |
|
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
495 |
|
]) |
496 |
|
|
497 |
|
dnl Check for some MacOS X frameworks |
498 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
499 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
500 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
501 |
|
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
546 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
547 |
|
;; |
548 |
|
irix*) |
519 |
– |
ETHERSRC=ether_unix.cpp |
549 |
|
AUDIOSRC=Irix/audio_irix.cpp |
550 |
|
EXTRASYSSRCS=Irix/unaligned.c |
551 |
|
LIBS="$LIBS -laudio" |
578 |
|
esac |
579 |
|
|
580 |
|
dnl Is the slirp library supported? |
581 |
< |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
581 |
> |
case "$ac_cv_have_byte_bitfields" in |
582 |
> |
yes|"guessing yes") |
583 |
> |
CAN_SLIRP=yes |
584 |
> |
ETHERSRC=ether_unix.cpp |
585 |
> |
;; |
586 |
> |
esac |
587 |
> |
if [[ -n "$CAN_SLIRP" ]]; then |
588 |
|
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
589 |
|
SLIRP_SRCS="\ |
590 |
|
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
1097 |
|
dnl A dummy program that returns always true |
1098 |
|
AC_PATH_PROG([BLESS], "true") |
1099 |
|
|
1100 |
+ |
dnl Check for linker script support |
1101 |
+ |
case $target_os:$target_cpu in |
1102 |
+ |
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1103 |
+ |
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1104 |
+ |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1105 |
+ |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1106 |
+ |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1107 |
+ |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1108 |
+ |
esac |
1109 |
+ |
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1110 |
+ |
AC_CACHE_CHECK([whether linker script is usable], |
1111 |
+ |
ac_cv_linker_script_works, [ |
1112 |
+ |
AC_LANG_SAVE |
1113 |
+ |
AC_LANG_CPLUSPLUS |
1114 |
+ |
saved_LDFLAGS="$LDFLAGS" |
1115 |
+ |
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" |
1116 |
+ |
AC_TRY_RUN( |
1117 |
+ |
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}], |
1118 |
+ |
[ac_cv_linker_script_works=yes], |
1119 |
+ |
[ac_cv_linker_script_works=no], |
1120 |
+ |
dnl When cross-compiling, assume it works |
1121 |
+ |
[ac_cv_linker_script_works="guessing yes"] |
1122 |
+ |
) |
1123 |
+ |
AC_LANG_RESTORE |
1124 |
+ |
if [[ "$ac_cv_linker_script_works" = "no" ]]; then |
1125 |
+ |
LDFLAGS="$saved_LDFLAGS" |
1126 |
+ |
LINKER_SCRIPT_FLAGS="" |
1127 |
+ |
fi |
1128 |
+ |
]) |
1129 |
+ |
fi |
1130 |
+ |
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", |
1131 |
+ |
[Define if there is a linker script to relocate the executable above 0x70000000.]) |
1132 |
+ |
|
1133 |
|
dnl Determine the addressing mode to use |
1134 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1135 |
|
ADDRESSING_MODE="real" |