ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/configure.ac
(Generate patch)

Comparing SheepShaver/src/Unix/configure.ac (file contents):
Revision 1.21 by gbeauche, 2005-03-27T19:05:18Z vs.
Revision 1.32 by gbeauche, 2005-07-03T13:05:36Z

# Line 19 | Line 19 | AC_ARG_ENABLE(jit,          [  --enable-
19   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
20   AC_ARG_ENABLE(fbdev-dga,    [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb0 [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
21   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
22 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
22 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
23   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
24   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
25   AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
# Line 123 | Line 123 | dnl Do we need SDL?
123   WANT_SDL=no
124   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
125    WANT_SDL=yes
126  WANT_FBDEV_DGA=no
126    WANT_XF86_DGA=no
127    WANT_XF86_VIDMODE=no
128    WANT_FBDEV_DGA=no
# Line 186 | Line 185 | no:linux*|no:netbsd*)
185    AC_CHECK_LIB(pthread, pthread_create, , [
186      AC_CHECK_LIB(c_r, pthread_create, , [
187        AC_CHECK_LIB(PTL, pthread_create, , [
188 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
188 >        dnl XXX remove when no pthreads case is merged
189 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
190 >        HAVE_PTHREADS=no
191        ])
192      ])
193    ])
194    AC_CHECK_FUNCS(pthread_cancel)
195 +  AC_CHECK_FUNCS(pthread_cond_init)
196    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
197    AC_CHECK_FUNCS(pthread_mutexattr_settype)
198    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
197  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
198    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
199  fi
199    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
200    SEMSRC=
201    AC_CHECK_FUNCS(sem_init, , [
# Line 206 | Line 205 | no:linux*|no:netbsd*)
205    ])
206    ;;
207   esac
208 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
209 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
210 + fi
211  
212   dnl We use FBDev DGA if possible.
213   if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
# Line 296 | Line 298 | AC_SYS_LARGEFILE
298   dnl Checks for header files.
299   AC_HEADER_STDC
300   AC_HEADER_SYS_WAIT
301 < AC_CHECK_HEADERS(malloc.h)
301 > AC_CHECK_HEADERS(malloc.h stdint.h)
302   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
301 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
303   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
304 < AC_CHECK_HEADERS(linux/if.h, [], [], [
305 < #if HAVE_SYS_SOCKET_H
306 < # include <sys/socket.h>
304 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
305 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
306 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
307 > #ifdef HAVE_SYS_TYPES_H
308 > #include <sys/types.h>
309 > #endif
310 > #ifdef HAVE_SYS_SOCKET_H
311 > #include <sys/socket.h>
312   #endif
313   ])
314 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
314 > AC_CHECK_HEADERS(AvailabilityMacros.h)
315 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
316   AC_CHECK_HEADERS(fenv.h)
317  
318   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 342 | Line 349 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
349   fi
350  
351   dnl Checks for library functions.
352 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
352 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
353   AC_CHECK_FUNCS(nanosleep)
354   AC_CHECK_FUNCS(sigaction signal)
355   AC_CHECK_FUNCS(mmap mprotect munmap)
356   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
357 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
358 < AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
357 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
358 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
359 > AC_CHECK_FUNCS(poll inet_aton)
360  
361   dnl Darwin seems to define mach_task_self() instead of task_self().
362   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 439 | Line 447 | EXTFSSRC=extfs_unix.cpp
447   EXTRASYSSRCS=
448   case "$target_os" in
449   linux*)
450 <  ETHERSRC=Linux/ether_linux.cpp
450 >  ETHERSRC=ether_unix.cpp
451    AUDIOSRC=audio_oss_esd.cpp
452    SCSISRC=Linux/scsi_linux.cpp
453    if [[ "x$EMULATED_PPC" = "xno" ]]; then
454      EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
455    fi
456    ;;
457 + freebsd*)
458 +  ETHERSRC=ether_unix.cpp
459 +  ;;
460   netbsd*)
461 +  ETHERSRC=ether_unix.cpp
462    if [[ "x$EMULATED_PPC" = "xno" ]]; then
463      EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
464    fi
465    ;;
466   darwin*)
467 +  ETHERSRC=ether_unix.cpp
468    if [[ "x$EMULATED_PPC" = "xno" ]]; then
469      EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
470    fi
# Line 467 | Line 480 | cygwin*)
480    ;;
481   esac
482  
483 + dnl Is the slirp library supported?
484 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
485 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
486 +  SLIRP_SRCS="\
487 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
488 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
489 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
490 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
491 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
492 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
493 + fi
494 + AC_SUBST(SLIRP_SRCS)
495 +
496   dnl SDL overrides
497   if [[ "x$WANT_SDL" = "xyes" ]]; then
498    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 1000 | Line 1026 | EOF
1026   fi
1027   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1028  
1029 + dnl Utility macro used by next two tests.
1030 + dnl AC_EXAMINE_OBJECT(C source code,
1031 + dnl     commands examining object file,
1032 + dnl     [commands to run if compile failed]):
1033 + dnl
1034 + dnl Compile the source code to an object file; then convert it into a
1035 + dnl printable representation.  All unprintable characters and
1036 + dnl asterisks (*) are replaced by dots (.).  All white space is
1037 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1038 + dnl output, but runs of newlines are compressed to a single newline.
1039 + dnl Finally, line breaks are forcibly inserted so that no line is
1040 + dnl longer than 80 columns and the file ends with a newline.  The
1041 + dnl result of all this processing is in the file conftest.dmp, which
1042 + dnl may be examined by the commands in the second argument.
1043 + dnl
1044 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1045 + [AC_LANG_SAVE
1046 + AC_LANG_C
1047 + dnl Next bit cribbed from AC_TRY_COMPILE.
1048 + cat > conftest.$ac_ext <<EOF
1049 + [#line __oline__ "configure"
1050 + #include "confdefs.h"
1051 + $1
1052 + ]EOF
1053 + if AC_TRY_EVAL(ac_compile); then
1054 +  od -c conftest.o |
1055 +    sed ['s/^[0-7]*[    ]*/ /
1056 +          s/\*/./g
1057 +          s/ \\n/*/g
1058 +          s/ [0-9][0-9][0-9]/./g
1059 +          s/  \\[^ ]/./g'] |
1060 +    tr -d '
1061 + ' | tr -s '*' '
1062 + ' | fold | sed '$a\
1063 + ' > conftest.dmp
1064 +  $2
1065 + ifelse($3, , , else
1066 +  $3
1067 + )dnl
1068 + fi
1069 + rm -rf conftest*
1070 + AC_LANG_RESTORE])
1071 +
1072 + dnl Floating point format probe.
1073 + dnl The basic concept is the same as the above: grep the object
1074 + dnl file for an interesting string.  We have to watch out for
1075 + dnl rounding changing the values in the object, however; this is
1076 + dnl handled by ignoring the least significant byte of the float.
1077 + dnl
1078 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1079 + dnl It does know about PDP-10 idiosyncratic format, but this is
1080 + dnl not presently supported by GCC.  S/390 "binary floating point"
1081 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1082 + dnl as ASCII?)
1083 + dnl
1084 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1085 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1086 + [gcc_AC_EXAMINE_OBJECT(
1087 + [/* This will not work unless sizeof(double) == 8.  */
1088 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1089 +
1090 + /* This structure must have no internal padding.  */
1091 + struct possibility {
1092 +  char prefix[8];
1093 +  double candidate;
1094 +  char postfix[8];
1095 + };
1096 +
1097 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1098 + struct possibility table [] =
1099 + {
1100 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1101 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1102 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1103 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1104 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1105 + };],
1106 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1107 +    ac_cv_c_float_format='IEEE (big-endian)'
1108 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1109 +    ac_cv_c_float_format='IEEE (big-endian)'
1110 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1111 +    ac_cv_c_float_format='IEEE (little-endian)'
1112 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1113 +    ac_cv_c_float_format='IEEE (little-endian)'
1114 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1115 +    ac_cv_c_float_format='VAX D-float'
1116 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1117 +    ac_cv_c_float_format='PDP-10'
1118 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1119 +    ac_cv_c_float_format='IBM 370 hex'
1120 +  else
1121 +    AC_MSG_ERROR(Unknown floating point format)
1122 +  fi],
1123 +  [AC_MSG_ERROR(compile failed)])
1124 + ])
1125 + # IEEE is the default format.  If the float endianness isn't the same
1126 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1127 + # (which is a tristate: yes, no, default).  This is only an issue with
1128 + # IEEE; the other formats are only supported by a few machines each,
1129 + # all with the same endianness.
1130 + format=IEEE_FLOAT_FORMAT
1131 + fbigend=
1132 + case $ac_cv_c_float_format in
1133 +    'IEEE (big-endian)' )
1134 +        if test $ac_cv_c_bigendian = no; then
1135 +            fbigend=1
1136 +        fi
1137 +        ;;
1138 +    'IEEE (little-endian)' )
1139 +        if test $ac_cv_c_bigendian = yes; then
1140 +            fbigend=0
1141 +        fi
1142 +        ;;
1143 +    'VAX D-float' )
1144 +        format=VAX_FLOAT_FORMAT
1145 +        ;;
1146 +    'PDP-10' )
1147 +        format=PDP10_FLOAT_FORMAT
1148 +        ;;
1149 +    'IBM 370 hex' )
1150 +        format=IBM_FLOAT_FORMAT
1151 +        ;;
1152 + esac
1153 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1154 +  [Define to the floating point format of the host machine.])
1155 + if test -n "$fbigend"; then
1156 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1157 +  [Define to 1 if the host machine stores floating point numbers in
1158 +   memory with the word containing the sign bit at the lowest address,
1159 +   or to 0 if it does it the other way around.
1160 +
1161 +   This macro should not be defined if the ordering is the same as for
1162 +   multi-word integers.])
1163 + fi
1164 + ])
1165 +
1166 + dnl Check for host float format
1167 + gcc_AC_C_FLOAT_FORMAT
1168 +
1169   dnl Platform specific binary postprocessor
1170   AC_PATH_PROG(BLESS, "true")
1171   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 1034 | Line 1200 | fi
1200   AC_MSG_RESULT($HAVE_ICC)
1201  
1202   dnl Determine the generated object format
1203 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1203 > AC_CACHE_CHECK([the format of compiler generated objects],
1204    ac_cv_object_format, [
1205    echo 'int i;' > conftest.$ac_ext
1206    ac_cv_object_format=no
# Line 1043 | Line 1209 | AC_CACHE_CHECK([whether the compiler can
1209      *"ELF"*)
1210        ac_cv_object_format=elf
1211        ;;
1212 +    *"Mach-O"*)
1213 +      ac_cv_object_format=mach
1214 +      ;;
1215      *)
1216        ac_cv_object_format=unknown
1217        ;;
# Line 1051 | Line 1220 | AC_CACHE_CHECK([whether the compiler can
1220    rm -rf conftest*
1221   ])
1222  
1223 + dnl Add -fno-strict-aliasing for slirp sources
1224 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1225 +  SAVED_CFLAGS="$CFLAGS"
1226 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1227 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1228 +    ac_cv_gcc_no_strict_aliasing, [
1229 +    AC_TRY_COMPILE([],[],
1230 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1231 +      [ac_cv_gcc_no_strict_aliasing=no])
1232 +  ])
1233 +  CFLAGS="$SAVED_CFLAGS"
1234 + fi
1235 +
1236 + dnl Add -mdynamic-no-pic for MacOS X
1237 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1238 +  SAVED_CFLAGS="$CFLAGS"
1239 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1240 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1241 +    ac_cv_gcc_mdynamic_no_pic, [
1242 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1243 +  ])
1244 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1245 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1246 +  else
1247 +    CFLAGS="$SAVED_CFLAGS"
1248 +  fi
1249 + fi
1250 +
1251   dnl CPU emulator sources
1252   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1253    CPUSRCS="\
1254      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1255 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1256      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1257      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1258      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1075 | Line 1273 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1273        i?86:elf)
1274          ac_cv_use_dyngen=yes
1275          ;;
1276 +      powerpc:mach)
1277 +        ac_cv_use_dyngen=yes
1278 +        ;;
1279        *:*)
1280          ac_cv_use_dyngen=no
1281          ;;
# Line 1092 | Line 1293 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1293            done
1294          fi
1295        fi
1296 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1296 >      if [[ -z "$DYNGEN_CC" ]]; then
1297          ac_cv_use_dyngen=no
1298        fi
1299      ])
# Line 1100 | Line 1301 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1301        case $host_cpu in
1302        i?86)
1303          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1304 <        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1305 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1306 <        else
1307 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1304 >        ;;
1305 >      powerpc)
1306 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1307 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1308          fi
1309          ;;
1310        esac
1311 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1311 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1312 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1313 >      else
1314 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1315 >      fi
1316 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1317        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1318          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1319        fi
# Line 1133 | Line 1339 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1339    AC_CACHE_CHECK([whether static data regions are executable],
1340      ac_cv_have_static_data_exec, [
1341      AC_TRY_RUN([int main(void) {
1342 < #if defined(__powerpc__)
1342 > #if defined(__powerpc__) || defined(__ppc__)
1343        static unsigned int p[8] = {0x4e800020,};
1344        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1345        asm volatile("sync" : : : "memory");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines