275 |
|
AC_HEADER_STDC |
276 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
277 |
|
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
278 |
< |
AC_CHECK_HEADERS(sys/socket.h) |
278 |
> |
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h sys/select.h) |
279 |
> |
AC_CHECK_HEADERS(arpa/inet.h) |
280 |
|
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
281 |
|
#ifdef HAVE_SYS_SOCKET_H |
282 |
|
#include <sys/socket.h> |
322 |
|
fi |
323 |
|
|
324 |
|
dnl Checks for library functions. |
325 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
325 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
326 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
327 |
|
AC_CHECK_FUNCS(sigaction signal) |
328 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
329 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
330 |
+ |
AC_CHECK_FUNCS(inet_aton) |
331 |
|
|
332 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
333 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
1065 |
|
#endif |
1066 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1067 |
|
|
1068 |
+ |
dnl Check for ICC. |
1069 |
+ |
AC_MSG_CHECKING(for ICC) |
1070 |
+ |
HAVE_ICC=no |
1071 |
+ |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1072 |
+ |
HAVE_ICC=yes |
1073 |
+ |
fi |
1074 |
+ |
AC_MSG_RESULT($HAVE_ICC) |
1075 |
+ |
|
1076 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1077 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1078 |
|
dnl the frame pointer. |
1086 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1087 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1088 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1089 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1089 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1090 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1091 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1092 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1102 |
|
|
1103 |
|
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1104 |
|
dnl However, there are some corner cases exposed on x86-64 |
1105 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1105 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1106 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1107 |
|
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1108 |
|
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1116 |
|
fi |
1117 |
|
fi |
1118 |
|
|
1119 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1120 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1121 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1122 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1123 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1124 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1125 |
+ |
AC_TRY_COMPILE([],[], |
1126 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "$CFLAGS")], |
1127 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1128 |
+ |
]) |
1129 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1130 |
+ |
fi |
1131 |
+ |
|
1132 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1133 |
|
ASM_OPTIMIZATIONS=none |
1134 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |