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

Comparing BasiliskII/src/Unix/configure.in (file contents):
Revision 1.7 by cebix, 1999-10-18T16:15:44Z vs.
Revision 1.62 by gbeauche, 2002-09-13T12:51:24Z

# Line 1 | Line 1
1   dnl Process this file with autoconf to produce a configure script.
2 < dnl Written in 1999 by Christian Bauer et al.
2 > dnl Written in 2002 by Christian Bauer et al.
3  
4   AC_INIT(main_unix.cpp)
5   AC_PREREQ(2.12)
6   AC_CONFIG_HEADER(config.h)
7  
8   dnl Options.
9 < WANT_DGA=yes
10 < WANT_UI=yes
11 < AC_ARG_ENABLE(dga, [  --enable-dga            use the DGA extension (default)], [WANT_DGA=$enableval], [])
12 < AC_ARG_ENABLE(ui,  [  --enable-ui             use GTK user interface (default)], [WANT_UI=$enableval], [])
9 > AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
10 > AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
11 > AC_ARG_ENABLE(fbdev-dga,     [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
12 > AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
13 >
14 > dnl FPU emulation core.
15 > AC_ARG_ENABLE(fpe,
16 > [  --enable-fpe=which      specify which fpu emulator to use [default=opt]],
17 > [ case "$enableval" in
18 >    dnl default is fpu_x86.cpp if i386 architecture, fpu_uae.cpp otherwise
19 >    default)    FPE_CORE="default";;
20 >    ieee)               FPE_CORE="ieee";;
21 >        uae)            FPE_CORE="uae";;
22 >        *)                      AC_MSG_ERROR([--enable-fpe takes only one of the following values: default, uae, ieee]);;
23 >  esac
24 > ],
25 > [ FPE_CORE="default"
26 > ])
27 >
28 > dnl Addressing modes.
29 > AC_ARG_ENABLE(addressing,
30 > [  --enable-addressing=AM  specify the addressing mode to use [default=fastest]],
31 > [ case "$enableval" in
32 >    real)       ADDRESSING_TEST_ORDER="real";;
33 >    direct)     ADDRESSING_TEST_ORDER="direct";;
34 >    banks)      ADDRESSING_TEST_ORDER="banks";;
35 >    fastest)ADDRESSING_TEST_ORDER="direct banks";;
36 >    *)          AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);;
37 >  esac
38 > ],
39 > [ ADDRESSING_TEST_ORDER="direct banks"
40 > ])
41 >
42 > dnl External packages.
43 > AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
44 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
45 > AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
46 >
47 > dnl Canonical system information.
48 > AC_CANONICAL_HOST
49 > AC_CANONICAL_TARGET
50 >
51 > dnl Target OS type (target is host if not cross-compiling).
52 > case "$target_os" in
53 >  linux*)       OS_TYPE=linux;;
54 >  netbsd*)      OS_TYPE=netbsd;;
55 >  freebsd*)     OS_TYPE=freebsd;;
56 >  solaris*)     OS_TYPE=solaris;;
57 >  darwin*)      OS_TYPE=darwin;;
58 >  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/g' | sed -e 's/\./_/g'`;;
59 > esac
60 > DEFINES="$DEFINES -DOS_$OS_TYPE"
61 >
62 > dnl Target CPU type.
63 > HAVE_I386=no
64 > HAVE_M68K=no
65 > HAVE_SPARC=no
66 > HAVE_POWERPC=no
67 > case "$target_cpu" in
68 >  i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;;
69 >  m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;;
70 >  sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;;
71 >  powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;;
72 >  *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;;
73 > esac
74 > DEFINES="$DEFINES -DCPU_$CPU_TYPE"
75  
76   dnl Checks for programs.
77   AC_PROG_CC
78 + AC_PROG_CC_C_O
79   AC_PROG_CPP
80   AC_PROG_CXX
81   AC_PROG_MAKE_SET
82   AC_PROG_INSTALL
83  
84 + dnl We use mon if possible.
85 + MONSRCS=
86 + if [[ "x$WANT_MON" = "xyes" ]]; then
87 +  AC_MSG_CHECKING(for mon)
88 +  mon_srcdir=../../../mon/src
89 +  if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
90 +    AC_MSG_RESULT(yes)
91 +    AC_DEFINE(ENABLE_MON)
92 +    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
93 +    CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
94 +    AC_CHECK_LIB(ncurses, tgetent, ,
95 +      AC_CHECK_LIB(termcap, tgetent, ,
96 +        AC_CHECK_LIB(termlib, tgetent, ,
97 +          AC_CHECK_LIB(terminfo, tgetent, ,
98 +            AC_CHECK_LIB(Hcurses, tgetent, ,
99 +              AC_CHECK_LIB(curses, tgetent))))))
100 +    AC_CHECK_LIB(readline, readline)
101 +    AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
102 +  else
103 +    AC_MSG_RESULT(no)
104 +    AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
105 +    WANT_MON=no
106 +  fi
107 + fi
108 +
109   dnl Checks for libraries.
110 + AC_CHECK_LIB(posix4, sem_init)
111 + AC_CHECK_LIB(rt, timer_create)
112 +
113 + dnl We need X11.
114   AC_PATH_XTRA
115   if [[ "x$no_x" = "xyes" ]]; then
116    AC_MSG_ERROR([You need X11 to run Basilisk II.])
117   fi
26
118   CFLAGS="$CFLAGS $X_CFLAGS"
119   CXXFLAGS="$CXXFLAGS $X_CFLAGS"
120   LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
30 STATICLIBS=
121  
122 < dnl We need pthreads.
123 < AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no)
124 < if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
125 <  dnl Check even the libc_r (FreeBSD)
126 <  AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no)
127 <  if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
128 <    dnl Or maybe the user has PTL (NetBSD)
129 <    AC_CHECK_LIB(PTL, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no)
130 <    if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
131 <      AC_MSG_ERROR([You need pthreads to run Basilisk II.])
132 <    else
43 <      LIBS="$LIBS -lPTL"
44 <    fi
45 <  else
46 <     LIBS="$LIBS -lc_r"
47 <  fi
48 < else
49 <  LIBS="$LIBS -lpthread"
122 > dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
123 > HAVE_PTHREADS=yes
124 > AC_CHECK_LIB(pthread, pthread_create, , [
125 >  AC_CHECK_LIB(c_r, pthread_create, , [
126 >    AC_CHECK_LIB(PTL, pthread_create, , [
127 >      HAVE_PTHREADS=no
128 >    ])
129 >  ])
130 > ])
131 > if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
132 >  AC_DEFINE(HAVE_PTHREADS)
133   fi
134   AC_CHECK_FUNCS(pthread_cancel)
135 + AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
136 + AC_CHECK_FUNCS(pthread_mutexattr_settype)
137  
138 < dnl We use DGA if possible.
139 < if [[ "x$WANT_DGA" = "xyes" ]]; then
140 <  AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no)
141 <  if [[ "x$HAVE_DGA" = "xno" ]]; then
142 <    AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga.])
58 <  else
59 <    DEFINES="$DEFINES -DENABLE_DGA=1"
60 <    LIBS="$LIBS -lXxf86dga"
138 > dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
139 > SEMSRC=
140 > AC_CHECK_FUNCS(sem_init, , [
141 >  if test "x$HAVE_PTHREADS" = "xyes"; then
142 >    SEMSRC=posix_sem.cpp
143    fi
144 + ])
145 +
146 + dnl We use DGA (XFree86 or fbdev) if possible.
147 + if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
148 +  AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
149 +    AC_DEFINE(ENABLE_XF86_DGA)
150 +    LIBS="$LIBS -lXxf86dga"
151 +    if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
152 +      AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.])
153 +      WANT_FBDEV_DGA=no
154 +    fi
155 +  ], [
156 +    AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.])
157 +    WANT_XF86_DGA=no
158 +  ])
159 + fi
160 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
161 +  AC_DEFINE(ENABLE_FBDEV_DGA)
162 + fi
163 +
164 + dnl We use XFree86 VidMode if possible.
165 + if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then
166 +  AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [
167 +    AC_DEFINE(ENABLE_XF86_VIDMODE)
168 +    LIBS="$LIBS -lXxf86vm"
169 +  ], [
170 +    AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.])
171 +    WANT_XF86_VIDMODE=no
172 +  ])
173   fi
174  
175   dnl We use GTK+ if possible.
176 < if [[ "x$WANT_UI" = "xyes" ]]; then
177 <  AM_PATH_GTK(1.2.0)
178 <  if [[ "x$no_gtk" = "xyes" ]]; then
179 <    echo "Did not find gtk+, disabling user interface."
180 <    WANT_UI=no
181 <    GTK_CFLAGS=
182 <    GTK_LIBS=
183 <  else
184 <    DEFINES="$DEFINES -DENABLE_GTK=1"
185 <  fi
186 <  CFLAGS="$CFLAGS $GTK_CFLAGS"
187 <  CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
188 <  LIBS="$LIBS $GTK_LIBS"
176 > UISRCS=../dummy/prefs_editor_dummy.cpp
177 > if [[ "x$WANT_GTK" = "xyes" ]]; then
178 >  AM_PATH_GTK(1.2.0, [
179 >    AC_DEFINE(ENABLE_GTK)
180 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
181 >    LIBS="$LIBS $GTK_LIBS"
182 >    UISRCS=prefs_editor_gtk.cpp
183 >    B2_PATH_GNOMEUI([
184 >      AC_DEFINE(HAVE_GNOMEUI)
185 >      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
186 >      LIBS="$LIBS $GNOMEUI_LIBS"
187 >    ], [])
188 >  ], [
189 >    AC_MSG_WARN([Could not find GTK+, disabling user interface.])
190 >    WANT_GTK=no
191 >  ])
192   fi
193  
194 < dnl We need POSIX.4 semaphores (and other POSIX.4 blessings).
195 < SEMSRCS=
196 < AC_CHECK_FUNCS(sem_init)
197 < if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then
198 <  AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no)
199 <  if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then
200 <    dnl Emulate semaphores with pthread mutexes
201 <    SEMSRCS="posix_sem.cpp"
202 <  else
203 <    LIBS="$LIBS -lposix4"
204 <  fi
194 > dnl We use ESD if possible.
195 > if [[ "x$WANT_ESD" = "xyes" ]]; then
196 >  AM_PATH_ESD(0.2.8, [
197 >    AC_DEFINE(ENABLE_ESD)
198 >    CFLAGS="$CFLAGS $ESD_CFLAGS"
199 >    CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
200 >    LIBS="$LIBS $ESD_LIBS"
201 >  ], [
202 >    AC_MSG_WARN([Could not find ESD, disabling ESD support.])
203 >    WANT_ESD=no
204 >  ])
205 > fi
206 >
207 > dnl We use 64-bit file size support if possible.
208 > dnl FIXME: Use AC_SYS_LARGEFILE from autoconf 2.5+
209 > if [[ "x$OS_TYPE" = "xlinux" ]]; then
210 >  AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for correct standard I/O])
211 >  AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support])
212   fi
213  
214   dnl Checks for header files.
215   AC_HEADER_STDC
216 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h)
216 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
217  
218   dnl Checks for typedefs, structures, and compiler characteristics.
219   AC_C_BIGENDIAN
# Line 102 | Line 223 | AC_CHECK_SIZEOF(short, 2)
223   AC_CHECK_SIZEOF(int, 4)
224   AC_CHECK_SIZEOF(long, 4)
225   AC_CHECK_SIZEOF(long long, 8)
226 + AC_CHECK_SIZEOF(float, 4)
227 + AC_CHECK_SIZEOF(double, 8)
228 + AC_CHECK_SIZEOF(long double, 12)
229 + AC_CHECK_SIZEOF(void *, 4)
230   AC_TYPE_OFF_T
231   AC_CHECK_TYPE(loff_t, off_t)
232 + AC_CHECK_TYPE(caddr_t, [char *])
233   AC_TYPE_SIZE_T
234 + AC_TYPE_SIGNAL
235   AC_HEADER_TIME
236   AC_STRUCT_TM
237  
238 + dnl Check whether sys/socket.h defines type socklen_t.
239 + dnl (extracted from ac-archive/Miscellaneous)
240 + AC_CACHE_CHECK("for socklen_t",
241 +  ac_cv_type_socklen_t, [
242 +  AC_TRY_COMPILE([
243 +    #include <sys/types.h>
244 +    #include <sys/socket.h>
245 +  ], [socklen_t len = 42; return 0;],
246 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
247 +  dnl When cross-compiling, do not assume anything.
248 +  ac_cv_type_socklen_t="guessing no"
249 +  )
250 + ])
251 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
252 +  AC_DEFINE(socklen_t, int)
253 + fi
254 +
255   dnl Checks for library functions.
256   AC_CHECK_FUNCS(strdup cfmakeraw)
257 < AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
257 > AC_CHECK_FUNCS(clock_gettime timer_create)
258 > AC_CHECK_FUNCS(sigaction signal)
259 > AC_CHECK_FUNCS(mmap mprotect munmap)
260 > AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
261 >
262 > dnl Darwin seems to define mach_task_self() instead of task_self().
263 > AC_CHECK_FUNCS(mach_task_self task_self)
264 >
265 > dnl Check for headers and functions related to pty support (sshpty.c)
266 > dnl From openssh-3.2.2p1 configure.ac
267 >
268 > AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
269 > AC_CHECK_FUNCS(_getpty vhangup strlcpy)
270 >
271 > case "$host" in
272 > *-*-hpux10.26)
273 >        disable_ptmx_check=yes
274 >        ;;
275 > *-*-linux*)
276 >        no_dev_ptmx=1
277 >        ;;
278 > mips-sony-bsd|mips-sony-newsos4)
279 >        AC_DEFINE(HAVE_NEWS4)
280 >        ;;
281 > *-*-sco3.2v4*)
282 >        no_dev_ptmx=1
283 >        ;;
284 > *-*-sco3.2v5*)
285 >        no_dev_ptmx=1
286 >        ;;
287 > esac
288 >
289 > if test -z "$no_dev_ptmx" ; then
290 >        if test "x$disable_ptmx_check" != "xyes" ; then
291 >                AC_CHECK_FILE("/dev/ptmx",
292 >                        [
293 >                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
294 >                                have_dev_ptmx=1
295 >                        ]
296 >                )
297 >        fi
298 > fi
299 > AC_CHECK_FILE("/dev/ptc",
300 >        [
301 >                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
302 >                have_dev_ptc=1
303 >        ]
304 > )
305 >
306 > dnl (end of code from openssh-3.2.2p1 configure.ac)
307 >
308  
309   dnl Select system-dependant source files.
310 < SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp"
311 < if MACHINE=`uname -a 2>/dev/null`; then
312 <  case "$MACHINE" in
313 <  Linux*)
314 <    SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp"
315 <    ;;
316 <  FreeBSD*3.*)
317 <    dnl Check for the CAM library
318 <    AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
319 <    if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
320 <      AC_MSG_ERROR([Cannot find libcam for SCSI management.])
310 > SERIALSRC=serial_unix.cpp
311 > ETHERSRC=../dummy/ether_dummy.cpp
312 > SCSISRC=../dummy/scsi_dummy.cpp
313 > AUDIOSRC=../dummy/audio_dummy.cpp
314 > EXTRASYSSRCS=
315 > CAN_NATIVE_M68K=no
316 > case "$target_os" in
317 > linux*)
318 >  ETHERSRC=ether_unix.cpp
319 >  AUDIOSRC=audio_oss_esd.cpp
320 >  SCSISRC=Linux/scsi_linux.cpp
321 >  ;;
322 > freebsd*)
323 >  ETHERSRC=ether_unix.cpp
324 >  AUDIOSRC=audio_oss_esd.cpp
325 >  DEFINES="$DEFINES -DBSD_COMP"
326 >  CXXFLAGS="$CXXFLAGS -fpermissive"
327 >  dnl Check for the CAM library
328 >  AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
329 >  if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
330 >    AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
331 >  else
332 >    dnl Check for the sys kernel includes
333 >    AC_CHECK_HEADER(camlib.h)
334 >    if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then
335 >      dnl In this case I should fix this thing including a "patch"
336 >      dnl to access directly to the functions in the kernel :) --Orlando
337 >      AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.])
338      else
339 <      dnl Check for the sys kernel includes
129 <      AC_CHECK_HEADER(/sys/cam/cam.h)
130 <      if [[ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]]; then
131 <        dnl In this case I should fix this thing including a "patch"
132 <        dnl to access directly to the functions in the kernel :) --Orlando
133 <        AC_MSG_ERROR([Cannot find kernel includes for CAM library.])
134 <      fi
135 <      SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp"
136 <      CXXFLAGS="$CXXFLAGS -I/sys"
137 <      CFLAGS="$CFLAGS -I/sys"
339 >      SCSISRC=FreeBSD/scsi_freebsd.cpp
340        LIBS="$LIBS -lcam"
341 <      DEFINES="$DEFINES -DBSD_COMP -DCAM"
341 >      DEFINES="$DEFINES -DCAM"
342      fi
343 <    ;;
344 <  FreeBSD*)
345 <    dnl Check for the SCSI library
346 <    AC_CHECK_LIB(scsi, scsi_open, HAVE_LIBSCSI=yes, HAVE_LIBSCSI=no)
347 <    if [[ "x$HAVE_LIBSCSI" = "xno" ]]; then
348 <      AC_MSG_ERROR([Cannot find libscsi for SCSI management.])
349 <    else
350 <      dnl Check for the sys kernel includes
351 <      AC_CHECK_HEADER(scsi.h sys/scsiio.h)
352 <      if [[ "x$ac_cv_header_scsi_h" = "xno" ]]; then
353 <        AC_MSG_ERROR([Cannot find includes for the SCSI library.])
354 <      fi
355 <      SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp"
356 <      LIBS="$LIBS -lscsi"
357 <      DEFINES="$DEFINES -DBSD_COMP"
343 >  fi
344 >  ;;
345 > netbsd*)
346 >  CAN_NATIVE_M68K=yes
347 >  ;;
348 > solaris*)
349 >  AUDIOSRC=Solaris/audio_solaris.cpp
350 >  DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
351 >  ;;
352 > irix*)
353 >  ETHERSRC=ether_unix.cpp
354 >  AUDIOSRC=Irix/audio_irix.cpp
355 >  EXTRASYSSRCS=Irix/unaligned.c
356 >  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
357 >  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
358 >  LIBS="$LIBS -laudio"
359 >  WANT_ESD=no
360 >
361 >  dnl Check if our compiler supports -Ofast (MIPSPro)
362 >  HAVE_OFAST=no
363 >  ocflags="$CFLAGS"
364 >  CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'`
365 >  AC_MSG_CHECKING(if "-Ofast" works)
366 >  dnl Do a test compile of an empty function
367 >  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no))
368 >  CFLAGS="$ocflags"
369 >
370 >  ;;
371 > esac
372 >
373 > dnl Use 68k CPU natively?
374 > WANT_NATIVE_M68K=no
375 > if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
376 >  AC_DEFINE(ENABLE_NATIVE_M68K)
377 >  WANT_NATIVE_M68K=yes
378 > fi
379 >
380 > if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
381 >  dnl Serial, ethernet and audio support needs pthreads
382 >  AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.])
383 >  SERIALSRC=../dummy/serial_dummy.cpp
384 >  ETHERSRC=../dummy/ether_dummy.cpp
385 >  AUDIOSRC=../dummy/audio_dummy.cpp
386 > fi
387 > SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
388 >
389 > dnl Define a macro that translates a yesno-variable into a C macro definition
390 > dnl to be put into the config.h file
391 > dnl $1 -- the macro to define
392 > dnl $2 -- the value to translate
393 > AC_DEFUN(AC_TRANSLATE_DEFINE, [
394 >    if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
395 >        AC_DEFINE($1)
396      fi
397 <    ;;
398 <  SunOS*)
399 <    SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp Solaris/audio_solaris.cpp"
400 <    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
401 <    ;;
402 <  IRIX*)
403 <    SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp Irix/unaligned.c"
404 <    DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200"
405 <    LIBS="$LIBS -lm"
406 <    ;;
397 > ])
398 >
399 > dnl Various checks if the system supports vm_allocate() and the like functions.
400 > have_mach_vm=no
401 > if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
402 >      "x$ac_cv_func_vm_protect" = "xyes" ]]; then
403 >  have_mach_vm=yes
404 > fi
405 > AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm")
406 >
407 > dnl Check that vm_allocate(), vm_protect() work
408 > if [[ "x$have_mach_vm" = "xyes" ]]; then
409 >
410 > AC_CACHE_CHECK("whether vm_protect works",
411 >  ac_cv_vm_protect_works, [
412 >  AC_LANG_SAVE
413 >  AC_LANG_CPLUSPLUS
414 >  ac_cv_vm_protect_works=yes
415 >  dnl First the tests that should segfault
416 >  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
417 >    AC_TRY_RUN([
418 >      #define CONFIGURE_TEST_VM_MAP
419 >      #define TEST_VM_PROT_$test_def
420 >      #include "vm_alloc.cpp"
421 >    ], ac_cv_vm_protect_works=no, rm -f core,
422 >    dnl When cross-compiling, do not assume anything
423 >    ac_cv_vm_protect_works="guessing no"
424 >    )
425 >  done
426 >  AC_TRY_RUN([
427 >    #define CONFIGURE_TEST_VM_MAP
428 >    #define TEST_VM_PROT_RDWR_WRITE
429 >    #include "vm_alloc.cpp"
430 >  ], , ac_cv_vm_protect_works=no,
431 >  dnl When cross-compiling, do not assume anything
432 >  ac_cv_vm_protect_works="guessing no"
433 >  )
434 >  AC_LANG_RESTORE
435 >  ]
436 > )
437 >
438 > dnl Remove support for vm_allocate() if vm_protect() does not work
439 > if [[ "x$have_mach_vm" = "xyes" ]]; then
440 >  case $ac_cv_vm_protect_works in
441 >    *yes) have_mach_vm=yes;;
442 >    *no) have_mach_vm=no;;
443    esac
444 <  if [[ "x$WANT_UI" = "xyes" ]]; then
445 <    SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp"
446 <  else
447 <    SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp"
444 > fi
445 > AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm")
446 >
447 > fi dnl HAVE_MACH_VM
448 >
449 > dnl Various checks if the system supports mmap() and the like functions.
450 > dnl ... and Mach memory allocators are not supported
451 > have_mmap_vm=no
452 > if [[ "x$ac_cv_func_mmap" = "xyes" -a "x$ac_cv_func_munmap" = "xyes" -a \
453 >      "x$ac_cv_func_mprotect" = "xyes" ]]; then
454 >  if [[ "x$have_mach_vm" = "xno" ]]; then
455 >    have_mmap_vm=yes
456    fi
457   fi
458 < if [[ "x$SEMSRCS" != "x" ]]; then
459 <  SYSSRCS="$SYSSRCS $SEMSRCS"
458 > AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, "$have_mmap_vm")
459 >
460 > dnl Check that mmap() and associated functions work.
461 > if [[ "x$have_mmap_vm" = "xyes" ]]; then
462 >
463 > dnl Check if we have a working anonymous mmap()
464 > AC_CACHE_CHECK("whether mmap supports MAP_ANON",
465 >  ac_cv_mmap_anon, [
466 >  AC_LANG_SAVE
467 >  AC_LANG_CPLUSPLUS
468 >  AC_TRY_RUN([
469 >    #define HAVE_MMAP_ANON
470 >    #define CONFIGURE_TEST_VM_MAP
471 >    #define TEST_VM_MMAP_ANON
472 >    #include "vm_alloc.cpp"
473 >  ], ac_cv_mmap_anon=yes, ac_cv_mmap_anon=no,
474 >  dnl When cross-compiling, do not assume anything.
475 >  ac_cv_mmap_anon="guessing no"
476 >  )
477 >  AC_LANG_RESTORE
478 >  ]
479 > )
480 > AC_TRANSLATE_DEFINE(HAVE_MMAP_ANON, "$ac_cv_mmap_anon")
481 >
482 > AC_CACHE_CHECK("whether mmap supports MAP_ANONYMOUS",
483 >  ac_cv_mmap_anonymous, [
484 >  AC_LANG_SAVE
485 >  AC_LANG_CPLUSPLUS
486 >  AC_TRY_RUN([
487 >    #define HAVE_MMAP_ANONYMOUS
488 >    #define CONFIGURE_TEST_VM_MAP
489 >    #define TEST_VM_MMAP_ANON
490 >    #include "vm_alloc.cpp"
491 >  ], ac_cv_mmap_anonymous=yes, ac_cv_mmap_anonymous=no,
492 >  dnl When cross-compiling, do not assume anything.
493 >  ac_cv_mmap_anonymous="guessing no"
494 >  )
495 >  AC_LANG_RESTORE
496 >  ]
497 > )
498 > AC_TRANSLATE_DEFINE(HAVE_MMAP_ANONYMOUS, "$ac_cv_mmap_anonymous")
499 >
500 > AC_CACHE_CHECK("whether mprotect works",
501 >  ac_cv_mprotect_works, [
502 >  AC_LANG_SAVE
503 >  AC_LANG_CPLUSPLUS
504 >  ac_cv_mprotect_works=yes
505 >  dnl First the tests that should segfault
506 >  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
507 >    AC_TRY_RUN([
508 >      #define CONFIGURE_TEST_VM_MAP
509 >      #define TEST_VM_PROT_$test_def
510 >      #include "vm_alloc.cpp"
511 >    ], ac_cv_mprotect_works=no, rm -f core,
512 >    dnl When cross-compiling, do not assume anything
513 >    ac_cv_mprotect_works="guessing no"
514 >    )
515 >  done
516 >  AC_TRY_RUN([
517 >    #define CONFIGURE_TEST_VM_MAP
518 >    #define TEST_VM_PROT_RDWR_WRITE
519 >    #include "vm_alloc.cpp"
520 >  ], , ac_cv_mprotect_works=no,
521 >  dnl When cross-compiling, do not assume anything
522 >  ac_cv_mprotect_works="guessing no"
523 >  )
524 >  AC_LANG_RESTORE
525 >  ]
526 > )
527 >
528 > dnl Remove support for mmap() if mprotect() does not work
529 > if [[ "x$have_mmap_vm" = "xyes" ]]; then
530 >  case $ac_cv_mprotect_works in
531 >    *yes) have_mmap_vm=yes;;
532 >    *no) have_mmap_vm=no;;
533 >  esac
534   fi
535 + AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm)
536  
537 < dnl Defaults for UAE CPU.
179 < CPUINCLUDES="-I../uae_cpu"
180 < CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp ../uae_cpu/fpp.cpp cpustbl.cpp cpudefs.cpp"
537 > fi dnl HAVE_MMAP_VM
538  
539 < dnl Check for i386.
540 < HAVE_I386=no
541 < AC_MSG_CHECKING(for x86 target CPU)
542 < AC_EGREP_CPP(yes,
543 < [
544 < #ifdef __i386__
545 <  yes
546 < #endif
547 < ], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no))
539 > dnl Check if we can mmap 0x2000 bytes from 0x0000
540 > AC_CACHE_CHECK("whether we can map Low Memory area 0x0000-0x2000",
541 >  ac_cv_can_map_lm, [
542 >  AC_LANG_SAVE
543 >  AC_LANG_CPLUSPLUS
544 >  AC_TRY_RUN([
545 >    #include "vm_alloc.cpp"
546 >    int main(void) { /* returns 0 if we could map the lowmem globals */
547 >      volatile char * lm;
548 >      if (vm_init() < 0) exit(1);
549 >      if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1);
550 >      lm[0] = 'z';
551 >      if (vm_release((char *)lm, 0x2000) < 0) exit(1);
552 >      vm_exit(); exit(0);
553 >    }
554 >  ], ac_cv_can_map_lm=yes, ac_cv_can_map_lm=no,
555 >  dnl When cross-compiling, do not assume anything.
556 >  ac_cv_can_map_lm="guessing no"
557 >  )
558 >  AC_LANG_RESTORE
559 >  ]
560 > )
561 >
562 > dnl Check signal handlers need to be reinstalled
563 > AC_CACHE_CHECK("whether signal handlers need to be reinstalled",
564 >  ac_cv_signal_need_reinstall, [
565 >  AC_LANG_SAVE
566 >  AC_LANG_CPLUSPLUS
567 >  AC_TRY_RUN([
568 >    #include <stdlib.h>
569 >    #ifdef HAVE_UNISTD_H
570 >    #include <unistd.h>
571 >    #endif
572 >    #include <signal.h>
573 >    static int handled_signal = 0;
574 >    RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
575 >    int main(void) { /* returns 0 if signals need not to be reinstalled */
576 >      signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
577 >      exit(handled_signal == 2);
578 >    }
579 >  ], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
580 >  dnl When cross-compiling, do not assume anything.
581 >  ac_cv_signal_need_reinstall="guessing yes"
582 >  )
583 >  AC_LANG_RESTORE
584 >  ]
585 > )
586 > AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall")
587 >
588 > dnl Check if sigaction handlers need to be reinstalled
589 > AC_CACHE_CHECK("whether sigaction handlers need to be reinstalled",
590 >  ac_cv_sigaction_need_reinstall, [
591 >  AC_LANG_SAVE
592 >  AC_LANG_CPLUSPLUS
593 >  AC_TRY_RUN([
594 >    #include <stdlib.h>
595 >    #ifdef HAVE_UNISTD_H
596 >    #include <unistd.h>
597 >    #endif
598 >    #include <signal.h>
599 >    static int handled_signal = 0;
600 >    RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
601 >    typedef RETSIGTYPE (*signal_handler)(int);
602 >    static signal_handler mysignal(int sig, signal_handler handler) {
603 >      struct sigaction old_sa;
604 >      struct sigaction new_sa;
605 >      new_sa.sa_handler = handler;
606 >      return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
607 >    }
608 >    int main(void) { /* returns 0 if signals need not to be reinstalled */
609 >      mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
610 >      exit(handled_signal == 2);
611 >    }
612 >  ], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
613 >  dnl When cross-compiling, do not assume anything.
614 >  ac_cv_sigaction_need_reinstall="guessing yes"
615 >  )
616 >  AC_LANG_RESTORE
617 >  ]
618 > )
619 > AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall")
620 >
621 > dnl Check if extended signals are supported.
622 > AC_CACHE_CHECK("whether your system supports extended signal handlers",
623 >  ac_cv_have_extended_signals, [
624 >  AC_LANG_SAVE
625 >  AC_LANG_CPLUSPLUS
626 >  AC_TRY_RUN([
627 >    #define HAVE_SIGINFO_T 1
628 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
629 >    #include "vm_alloc.cpp"
630 >    #include "sigsegv.cpp"
631 >  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
632 >  dnl When cross-compiling, do not assume anything.
633 >  ac_cv_have_extended_signals=no
634 >  )
635 >  AC_LANG_RESTORE
636 >  ]
637 > )
638 > AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals")
639 >
640 > dnl Otherwise, check for subterfuges.
641 > if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
642 >  AC_CACHE_CHECK("whether we then have a subterfuge for your system",
643 >  ac_cv_have_sigcontext_hack, [
644 >    AC_LANG_SAVE
645 >    AC_LANG_CPLUSPLUS
646 >    AC_TRY_RUN([
647 >      #define HAVE_SIGCONTEXT_SUBTERFUGE 1
648 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
649 >      #include "vm_alloc.cpp"
650 >      #include "sigsegv.cpp"
651 >    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
652 >    dnl When cross-compiling, do not assume anything.
653 >    ac_cv_have_sigcontext_hack=no
654 >    )
655 >    AC_LANG_RESTORE
656 >  ])
657 >  AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack")
658 > fi
659 >
660 > dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
661 > AC_CACHE_CHECK("whether we can skip instruction in SIGSEGV handler",
662 >  ac_cv_have_skip_instruction, [
663 >  AC_LANG_SAVE
664 >  AC_LANG_CPLUSPLUS
665 >  AC_TRY_RUN([
666 >    #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
667 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
668 >    #include "vm_alloc.cpp"
669 >    #include "sigsegv.cpp"
670 >  ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
671 >  dnl When cross-compiling, do not assume anything.
672 >  ac_cv_have_skip_instruction=no
673 >  )
674 >  AC_LANG_RESTORE
675 >  ]
676 > )
677 > AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction")
678 >
679 > dnl Can we do Video on SEGV Signals ?
680 > CAN_VOSF=no
681 > if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
682 >  CAN_VOSF=yes
683 > fi
684 >
685 > dnl Determine the addressing mode to use
686 > if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
687 >  ADDRESSING_MODE="real"
688 > else
689 >  ADDRESSING_MODE=""
690 >  AC_MSG_CHECKING([for the addressing mode to use])
691 >  for am in $ADDRESSING_TEST_ORDER; do
692 >    case $am in
693 >    real)
694 >      dnl Requires ability to mmap() Low Memory globals
695 >      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
696 >        continue
697 >      fi
698 >          dnl Requires VOSF screen updates
699 >      if [[ "x$CAN_VOSF" = "xno" ]]; then
700 >        continue
701 >      fi
702 >      dnl Real addressing will probably work.
703 >      ADDRESSING_MODE="real"
704 >      WANT_VOSF=yes dnl we can use VOSF and we need it actually
705 >      DEFINES="$DEFINES -DREAL_ADDRESSING"
706 >      break
707 >      ;;
708 >    direct)
709 >      dnl Requires VOSF screen updates
710 >      if [[ "x$CAN_VOSF" = "xyes" ]]; then
711 >        ADDRESSING_MODE="direct"
712 >        WANT_VOSF=yes dnl we can use VOSF and we need it actually
713 >        DEFINES="$DEFINES -DDIRECT_ADDRESSING"
714 >        break
715 >      fi
716 >      ;;
717 >    banks)
718 >      dnl Default addressing mode
719 >      ADDRESSING_MODE="memory banks"
720 >      break
721 >      ;;
722 >    *)
723 >      AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
724 >    esac
725 >  done
726 >  AC_MSG_RESULT($ADDRESSING_MODE)
727 >  if [[ "x$ADDRESSING_MODE" = "x" ]]; then
728 >    AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
729 >    ADDRESSING_MODE="memory banks"
730 >  fi
731 > fi
732 >
733 > dnl Enable VOSF screen updates with this feature is requested and feasible
734 > if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
735 >    AC_DEFINE(ENABLE_VOSF)
736 > else
737 >    WANT_VOSF=no
738 > fi
739  
740   dnl Check for GAS.
741   HAVE_GAS=no
# Line 208 | Line 756 | AC_EGREP_CPP(yes,
756   #endif
757   ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
758  
759 < dnl Set "-fomit-frame-pointer" on GCC.
760 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
759 > dnl Check for GCC 3.0 or higher.
760 > HAVE_GCC30=no
761 > AC_MSG_CHECKING(for GCC 3.0 or higher)
762 > AC_EGREP_CPP(yes,
763 > [#if __GNUC__ >= 3
764 >  yes
765 > #endif
766 > ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
767 >
768 > dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
769 > dnl Also set "-fno-exceptions" for C++ because exception handling requires
770 > dnl the frame pointer.
771 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
772    CFLAGS="$CFLAGS -fomit-frame-pointer"
773 <  CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
773 >  CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions"
774 > fi
775 >
776 > dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp.
777 > dnl As of 2001/08/02, this affects the following compilers:
778 > dnl Official: probably gcc-3.1 (mainline CVS)
779 > dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
780 > dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
781 > if [[ "x$HAVE_GCC27" = "xyes" ]]; then
782 >  SAVED_CXXFLAGS="$CXXFLAGS"
783 >  CXXFLAGS="$CXXFLAGS -fno-merge-constants"
784 >  AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
785 >    AC_LANG_SAVE
786 >    AC_LANG_CPLUSPLUS
787 >    AC_TRY_COMPILE([],[],[ac_cv_gcc_constants_merging=yes],[ac_cv_gcc_constants_merging=no])
788 >    AC_LANG_RESTORE
789 >  ])
790 >  if [[ "x$ac_cv_gcc_constants_merging" != "xyes" ]]; then
791 >    CXXFLAGS="$SAVED_CXXFLAGS"
792 >  fi
793   fi
794  
795   dnl Select appropriate CPU source and REGPARAM define.
796 < if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
796 > ASM_OPTIMIZATIONS=none
797 > CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
798 > FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
799 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then
800 >  dnl i386 CPU
801    DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
802    if [[ "x$HAVE_GAS" = "xyes" ]]; then
803 <    DEFINES="$DEFINES -DX86_ASSEMBLY"
804 <    CPUSRCS="$CPUSRCS cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
803 >    ASM_OPTIMIZATIONS=i386
804 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS"
805 >    CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
806 >    FPUSRCS="../uae_cpu/fpu_x86.cpp"
807 >  fi
808 > elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
809 >  dnl SPARC CPU
810 >  case "$target_os" in
811 >  solaris*)
812 >    AC_MSG_CHECKING(SPARC CPU architecture)
813 >    SPARC_TYPE=`Solaris/which_sparc`
814 >    AC_MSG_RESULT($SPARC_TYPE)
815 >    case "$SPARC_TYPE" in
816 >    SPARC_V8)
817 >      ASM_OPTIMIZATIONS="SPARC V8 architecture"
818 >      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
819 >      CFLAGS="$CFLAGS -Wa,-Av8"
820 >      CXXFLAGS="$CXXFLAGS -Wa,-Av8"
821 >      ;;
822 >    SPARC_V9)
823 >      ASM_OPTIMIZATIONS="SPARC V9 architecture"
824 >      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
825 >      CFLAGS="$CFLAGS -Wa,-Av9"
826 >      CXXFLAGS="$CXXFLAGS -Wa,-Av9"
827 >      ;;
828 >    esac
829 >    ;;
830 >  esac
831 > elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
832 >  dnl Native m68k, no emulation
833 >  CPUINCLUDES="-I../native_cpu"
834 >  CPUSRCS="asm_support.s"
835 > fi
836 >
837 > dnl Select appropriate FPU source.
838 > dnl 1. Optimized X86 assembly core if target is i386 architecture.
839 > SAVED_DEFINES=$DEFINES
840 > if [[ "x$FPE_CORE" = "xdefault" ]]; then
841 >  if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
842 >    DEFINES="$DEFINES -DFPU_X86"
843 >    FPE_CORE_STR="i386 optimized core"
844 >    FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
845 >    FPE_CORE="i386"
846    else
847 <    CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
847 >    FPE_CORE="uae"
848    fi
849 < else
850 <  CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
849 > fi
850 >
851 > dnl 2. JIT-FPU only supports IEEE-based implementation.
852 > if [[ "x$WANT_JIT_FPU" = "xyes" -a "x$FPE_CORE" != "xieee" ]]; then
853 >  AC_MSG_WARN([Sorry, JIT-FPU supports only the "ieee" FPE implementation])
854 >  FPE_CORE="ieee"
855 >  dnl Restore previous variables. FPE_CORE_STR and FPUSRCS are overwritten
856 >  DEFINES=$SAVED_DEFINES
857 > fi
858 >
859 > dnl 3. Choose either IEEE-based implementation or the old UAE core.
860 > if [[ "x$FPE_CORE" = "xieee" ]]; then
861 >  AC_CHECK_HEADERS(fenv.h)
862 >  AC_CHECK_FUNCS(feclearexcept fegetexceptflag feraiseexcept fesetexceptflag fetestexcept)
863 >  AC_CHECK_FUNCS(fegetround fesetround)
864 >  DEFINES="$DEFINES -DFPU_IEEE"
865 >  FPE_CORE_STR="ieee-based fpu core"
866 >  FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
867 > elif [[ "x$FPE_CORE" = "xuae" ]]; then
868 >  DEFINES="$DEFINES -DFPU_UAE"
869 >  FPE_CORE_STR="original uae core"
870 >  FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
871 > fi
872 >
873 > dnl Check for certain math functions
874 > AC_CHECK_FUNCS(atanh)
875 > AC_CHECK_FUNCS(isnan isinf)             dnl C99
876 > AC_CHECK_FUNCS(isnanl isinfl)   dnl IEEE ?
877 >
878 > dnl UAE CPU sources for all non-m68k-native architectures.
879 > if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
880 >  CPUINCLUDES="-I../uae_cpu"
881 >  CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS"
882 > fi
883 >
884 > dnl Remove the "-g" option if set for GCC.
885 > if [[ "x$HAVE_GCC27" = "xyes" ]]; then
886 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
887 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
888 > fi
889 >
890 > dnl Or if we have -Ofast
891 > if [[ "x$HAVE_OFAST" = "xyes" ]]; then
892 >  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast"
893 >  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast"
894 >  CXXFLAGS="-LANG:std $CXXFLAGS"
895 >  LDFLAGS="$LDFLAGS -ipa"
896   fi
897  
898   dnl Generate Makefile.
899   AC_SUBST(DEFINES)
232 AC_SUBST(STATICLIBS)
900   AC_SUBST(SYSSRCS)
901   AC_SUBST(CPUINCLUDES)
902   AC_SUBST(CPUSRCS)
903   AC_OUTPUT(Makefile)
904 < echo "Configuration done. Now type \"make\"."
904 >
905 > dnl Print summary.
906 > echo
907 > echo Basilisk II configuration summary:
908 > echo
909 > echo XFree86 DGA support .................... : $WANT_XF86_DGA
910 > echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
911 > echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
912 > echo Enable video on SEGV signals ........... : $WANT_VOSF
913 > echo ESD sound support ...................... : $WANT_ESD
914 > echo GTK user interface ..................... : $WANT_GTK
915 > echo mon debugger support ................... : $WANT_MON
916 > echo Running m68k code natively ............. : $WANT_NATIVE_M68K
917 > echo Floating-Point emulation core .......... : $FPE_CORE_STR
918 > echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
919 > echo Addressing mode ........................ : $ADDRESSING_MODE
920 > echo
921 > echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines