mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-07 04:30:58 +00:00
Check whether compiler supports byte bit-fields. If so, we can enable slirp
emulation code since it pure C+sockets code.
This commit is contained in:
parent
9d984b3b34
commit
d4210ef902
@ -456,6 +456,36 @@ if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
|
||||
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
|
||||
fi
|
||||
|
||||
dnl Check whether compiler supports byte bit-fields
|
||||
AC_CACHE_CHECK([whether compiler supports byte bit-fields],
|
||||
ac_cv_have_byte_bitfields, [
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_RUN([
|
||||
struct A {
|
||||
unsigned char b1:4;
|
||||
unsigned char b2:4;
|
||||
unsigned char c;
|
||||
unsigned short s;
|
||||
unsigned char a[4];
|
||||
};
|
||||
|
||||
int main(void) {
|
||||
A a;
|
||||
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
|
||||
}],
|
||||
[ac_cv_have_byte_bitfields=yes],
|
||||
[ac_cv_have_byte_bitfields=no],
|
||||
dnl When cross-compiling, assume only GCC supports this
|
||||
[if [[ "$GCC" = "yes" ]]; then
|
||||
ac_cv_have_byte_bitfields="guessing yes"
|
||||
else
|
||||
ac_cv_have_byte_bitfields="guessing no"
|
||||
fi]
|
||||
)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
|
||||
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
|
||||
AC_DEFUN(AC_CHECK_FRAMEWORK, [
|
||||
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
|
||||
@ -517,7 +547,6 @@ darwin*)
|
||||
fi
|
||||
;;
|
||||
irix*)
|
||||
ETHERSRC=ether_unix.cpp
|
||||
AUDIOSRC=Irix/audio_irix.cpp
|
||||
LIBS="$LIBS -laudio"
|
||||
WANT_ESD=no
|
||||
@ -536,7 +565,13 @@ irix*)
|
||||
esac
|
||||
|
||||
dnl Is the slirp library supported?
|
||||
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
|
||||
case "$ac_cv_have_byte_bitfields" in
|
||||
yes|"guessing yes")
|
||||
CAN_SLIRP=yes
|
||||
ETHERSRC=ether_unix.cpp
|
||||
;;
|
||||
esac
|
||||
if [[ -n "$CAN_SLIRP" ]]; then
|
||||
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
|
||||
SLIRP_SRCS="\
|
||||
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \
|
||||
|
Loading…
x
Reference in New Issue
Block a user