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.3 by cebix, 1999-10-05T15:29:04Z vs.
Revision 1.55 by gbeauche, 2002-03-16T10:51:17Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines