14 |
|
dnl cores for the configure tests since some are intended to dump core. |
15 |
|
ulimit -c 0 |
16 |
|
|
17 |
+ |
AC_ARG_ENABLE(standalone-gui,[ --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no]) |
18 |
+ |
|
19 |
|
dnl Video options. |
20 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
21 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
138 |
|
AC_CHECK_LIB(posix4, sem_init) |
139 |
|
AC_CHECK_LIB(rt, timer_create) |
140 |
|
AC_CHECK_LIB(rt, shm_open) |
141 |
+ |
AC_CHECK_LIB(m, cos) |
142 |
|
|
143 |
|
dnl Do we need SDL? |
144 |
|
WANT_SDL=no |
294 |
|
]) |
295 |
|
fi |
296 |
|
|
297 |
+ |
dnl Enable standalone GUI? |
298 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
299 |
+ |
WANT_STANDALONE_GUI=no |
300 |
+ |
fi |
301 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
302 |
+ |
WANT_STANDALONE_GUI=no |
303 |
+ |
fi |
304 |
+ |
if [[ "$WANT_STANDALONE_GUI" = "yes" ]]; then |
305 |
+ |
UISRCS="" |
306 |
+ |
AC_DEFINE(STANDALONE_GUI, 1, [Define to use build a standalone GUI prefs editor.]) |
307 |
+ |
fi |
308 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
309 |
+ |
|
310 |
|
dnl We use ESD if possible. |
311 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
312 |
|
AM_PATH_ESD(0.2.8, [ |
437 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
438 |
|
|
439 |
|
|
440 |
+ |
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK) |
441 |
+ |
dnl doesn't work or is unimplemented. On these systems (mostly older |
442 |
+ |
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4] |
443 |
+ |
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O], |
444 |
+ |
ac_cv_nonblocking_io, [ |
445 |
+ |
case "$host" in |
446 |
+ |
*-*-osf*) |
447 |
+ |
ac_cv_nonblocking_io=FIONBIO |
448 |
+ |
;; |
449 |
+ |
*-*-sunos4*) |
450 |
+ |
ac_cv_nonblocking_io=FIONBIO |
451 |
+ |
;; |
452 |
+ |
*-*-ultrix*) |
453 |
+ |
ac_cv_nonblocking_io=FIONBIO |
454 |
+ |
;; |
455 |
+ |
*) |
456 |
+ |
ac_cv_nonblocking_io=O_NONBLOCK |
457 |
+ |
;; |
458 |
+ |
esac |
459 |
+ |
]) |
460 |
+ |
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then |
461 |
+ |
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used]) |
462 |
+ |
fi |
463 |
+ |
|
464 |
+ |
dnl Check whether compiler supports byte bit-fields |
465 |
+ |
AC_CACHE_CHECK([whether compiler supports byte bit-fields], |
466 |
+ |
ac_cv_have_byte_bitfields, [ |
467 |
+ |
AC_LANG_SAVE |
468 |
+ |
AC_LANG_CPLUSPLUS |
469 |
+ |
AC_TRY_RUN([ |
470 |
+ |
struct A { |
471 |
+ |
unsigned char b1:4; |
472 |
+ |
unsigned char b2:4; |
473 |
+ |
unsigned char c; |
474 |
+ |
unsigned short s; |
475 |
+ |
unsigned char a[4]; |
476 |
+ |
}; |
477 |
+ |
|
478 |
+ |
int main(void) { |
479 |
+ |
A a; |
480 |
+ |
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1)); |
481 |
+ |
}], |
482 |
+ |
[ac_cv_have_byte_bitfields=yes], |
483 |
+ |
[ac_cv_have_byte_bitfields=no], |
484 |
+ |
dnl When cross-compiling, assume only GCC supports this |
485 |
+ |
[if [[ "$GCC" = "yes" ]]; then |
486 |
+ |
ac_cv_have_byte_bitfields="guessing yes" |
487 |
+ |
else |
488 |
+ |
ac_cv_have_byte_bitfields="guessing no" |
489 |
+ |
fi] |
490 |
+ |
) |
491 |
+ |
AC_LANG_RESTORE |
492 |
+ |
]) |
493 |
+ |
|
494 |
|
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
495 |
|
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
496 |
|
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
499 |
|
saved_LIBS="$LIBS" |
500 |
|
LIBS="$LIBS -framework $1" |
501 |
|
AC_TRY_LINK( |
502 |
< |
[$2], [int main(void) { return 0; }], |
502 |
> |
[$2], [], |
503 |
|
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
504 |
|
) |
505 |
|
]) |
510 |
|
]) |
511 |
|
|
512 |
|
dnl Check for some MacOS X frameworks |
513 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
514 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
515 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
516 |
|
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
561 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
562 |
|
;; |
563 |
|
irix*) |
493 |
– |
ETHERSRC=ether_unix.cpp |
564 |
|
AUDIOSRC=Irix/audio_irix.cpp |
565 |
|
EXTRASYSSRCS=Irix/unaligned.c |
496 |
– |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
497 |
– |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
566 |
|
LIBS="$LIBS -laudio" |
567 |
|
WANT_ESD=no |
568 |
|
|
572 |
|
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
573 |
|
AC_MSG_CHECKING(if "-IPA" works) |
574 |
|
dnl Do a test compile of an empty function |
575 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
575 |
> |
AC_TRY_COMPILE([#if defined __GNUC__ |
576 |
> |
# error GCC does not support IPA yet |
577 |
> |
#endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
578 |
|
CFLAGS="$ocflags" |
579 |
|
;; |
580 |
|
darwin*) |
593 |
|
esac |
594 |
|
|
595 |
|
dnl Is the slirp library supported? |
596 |
< |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
596 |
> |
case "$ac_cv_have_byte_bitfields" in |
597 |
> |
yes|"guessing yes") |
598 |
> |
CAN_SLIRP=yes |
599 |
> |
ETHERSRC=ether_unix.cpp |
600 |
> |
;; |
601 |
> |
esac |
602 |
> |
if [[ -n "$CAN_SLIRP" ]]; then |
603 |
|
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
604 |
|
SLIRP_SRCS="\ |
605 |
|
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
1112 |
|
dnl A dummy program that returns always true |
1113 |
|
AC_PATH_PROG([BLESS], "true") |
1114 |
|
|
1115 |
+ |
dnl Check for linker script support |
1116 |
+ |
case $target_os:$target_cpu in |
1117 |
+ |
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1118 |
+ |
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1119 |
+ |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1120 |
+ |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1121 |
+ |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1122 |
+ |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1123 |
+ |
esac |
1124 |
+ |
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1125 |
+ |
AC_CACHE_CHECK([whether linker script is usable], |
1126 |
+ |
ac_cv_linker_script_works, [ |
1127 |
+ |
AC_LANG_SAVE |
1128 |
+ |
AC_LANG_CPLUSPLUS |
1129 |
+ |
saved_LDFLAGS="$LDFLAGS" |
1130 |
+ |
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" |
1131 |
+ |
AC_TRY_RUN( |
1132 |
+ |
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}], |
1133 |
+ |
[ac_cv_linker_script_works=yes], |
1134 |
+ |
[ac_cv_linker_script_works=no], |
1135 |
+ |
dnl When cross-compiling, assume it works |
1136 |
+ |
[ac_cv_linker_script_works="guessing yes"] |
1137 |
+ |
) |
1138 |
+ |
AC_LANG_RESTORE |
1139 |
+ |
if [[ "$ac_cv_linker_script_works" = "no" ]]; then |
1140 |
+ |
LDFLAGS="$saved_LDFLAGS" |
1141 |
+ |
LINKER_SCRIPT_FLAGS="" |
1142 |
+ |
fi |
1143 |
+ |
]) |
1144 |
+ |
fi |
1145 |
+ |
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", |
1146 |
+ |
[Define if there is a linker script to relocate the executable above 0x70000000.]) |
1147 |
+ |
|
1148 |
|
dnl Determine the addressing mode to use |
1149 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1150 |
|
ADDRESSING_MODE="real" |
1222 |
|
dnl Check for GCC 2.7 or higher. |
1223 |
|
HAVE_GCC27=no |
1224 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1225 |
< |
AC_EGREP_CPP(xyes, |
1226 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1227 |
< |
xyes |
1228 |
< |
#endif |
1229 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1225 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1226 |
> |
# error gcc < 2.7 |
1227 |
> |
#endif |
1228 |
> |
]])], |
1229 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1230 |
> |
[AC_MSG_RESULT(no)]) |
1231 |
|
|
1232 |
|
dnl Check for GCC 3.0 or higher. |
1233 |
|
HAVE_GCC30=no |
1234 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1235 |
< |
AC_EGREP_CPP(xyes, |
1236 |
< |
[#if __GNUC__ >= 3 |
1237 |
< |
xyes |
1238 |
< |
#endif |
1239 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1235 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1236 |
> |
# error gcc < 3 |
1237 |
> |
#endif |
1238 |
> |
]])], |
1239 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1240 |
> |
[AC_MSG_RESULT(no)]) |
1241 |
|
|
1242 |
|
dnl Check for ICC. |
1243 |
|
AC_MSG_CHECKING(for ICC) |
1303 |
|
CFLAGS="$SAVED_CFLAGS" |
1304 |
|
fi |
1305 |
|
|
1306 |
< |
dnl Add -mdynamic-no-pic for MacOS X |
1307 |
< |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1306 |
> |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1307 |
> |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1308 |
|
SAVED_CFLAGS="$CFLAGS" |
1309 |
|
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1310 |
|
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |