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.20 by cebix, 2000-07-13T16:12:31Z vs.
Revision 1.28 by cebix, 2000-10-14T16:30:53Z

# Line 9 | Line 9 | dnl Options.
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=no]], [WANT_VOSF=$enableval], [WANT_VOSF=no])
13 + AC_ARG_ENABLE(16bit-vidmode, [  --enable-16bit-vidmode  enable 16-bit video if possible [default=yes]], [WANT_16BIT_VIDMODE=$enableval], [WANT_16BIT_VIDMODE=yes])
14 + AC_ARG_ENABLE(addressing,
15 + [  --enable-addressing=mode specify the addressing mode to use [default=fastest]],
16 + [ case "$enableval" in
17 +    real)       ADDRESSING_TEST_ORDER="real";;
18 +    direct)     ADDRESSING_TEST_ORDER="direct";;
19 +    banks)      ADDRESSING_TEST_ORDER="banks";;
20 + dnl fastest)    ADDRESSING_TEST_ORDER="real direct banks";; gb-- will enable later...
21 +    fastest)    ADDRESSING_TEST_ORDER="direct banks";;
22 +    *)          AC_MSG_ERROR([--enable-mem-addressing takes only one of the following values: fastest, real, direct, banks]);;
23 +  esac
24 + ],
25 + dnl [ ADDRESSING_TEST_ORDER="real direct banks" gb-- will probably reactivate later
26 + [ ADDRESSING_TEST_ORDER="direct banks"
27 + ])
28   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
29   AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
30   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
31  
32 + dnl Canonical system information.
33 + AC_CANONICAL_HOST
34 + AC_CANONICAL_TARGET
35 +
36 + dnl Target OS type (target is host if not cross-compiling).
37 + case "$target_os" in
38 +  linux*)       OS_TYPE=linux;;
39 +  netbsd*)      OS_TYPE=netbsd;;
40 +  freebsd*)     OS_TYPE=freebsd;;
41 +  solaris*)     OS_TYPE=solaris;;
42 +  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/' | sed -e 's/\./_/'`;;
43 + esac
44 + DEFINES="$DEFINES -DOS_$OS_TYPE"
45 +
46 + dnl Target CPU type.
47 + HAVE_I386=no
48 + HAVE_M68K=no
49 + HAVE_SPARC=no
50 + case "$target_cpu" in
51 +  i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;;
52 +  m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;;
53 +  sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;;
54 +  *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/'`;;
55 + esac
56 + DEFINES="$DEFINES -DCPU_$CPU_TYPE"
57 +
58   dnl Checks for programs.
59   AC_PROG_CC
60 + AC_PROG_CC_C_O
61   AC_PROG_CPP
62   AC_PROG_CXX
63   AC_PROG_MAKE_SET
64   AC_PROG_INSTALL
65  
23 dnl Check for i386 target CPU.
24 HAVE_I386=no
25 AC_MSG_CHECKING(for x86 target CPU)
26 AC_EGREP_CPP(yes,
27 [
28 #ifdef __i386__
29  yes
30 #endif
31 ], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no))
32
33 dnl Check for SPARC target CPU.
34 HAVE_SPARC=no
35 AC_MSG_CHECKING(for SPARC target CPU)
36 AC_EGREP_CPP(yes,
37 [
38 #ifdef __sparc__
39  yes
40 #endif
41 ], [AC_MSG_RESULT(yes); HAVE_SPARC=yes], AC_MSG_RESULT(no))
42
43 dnl Check for m68k target CPU.
44 HAVE_M68K=no
45 AC_MSG_CHECKING(for m68k target CPU)
46 AC_EGREP_CPP(yes,
47 [
48 #ifdef __m68k__
49  yes
50 #endif
51 ], [AC_MSG_RESULT(yes); HAVE_M68K=yes], AC_MSG_RESULT(no))
52
66   dnl We use mon if possible.
67   MONSRCS=
68   if [[ "x$WANT_MON" = "xyes" ]]; then
69    AC_MSG_CHECKING(for mon)
70 <  if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then
70 >  mon_srcdir=../../../mon/src
71 >  if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
72      AC_MSG_RESULT(yes)
73      AC_DEFINE(ENABLE_MON)
74 <    MONSRCS="../../../mon/src/mon.cpp ../../../mon/src/mon_6502.cpp ../../../mon/src/mon_68k.cpp ../../../mon/src/mon_8080.cpp ../../../mon/src/mon_cmd.cpp ../../../mon/src/mon_ppc.cpp ../../../mon/src/mon_x86.cpp"
75 <    CXXFLAGS="$CXXFLAGS -I../../../mon/src"
74 >    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_8080.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
75 >    CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
76      AC_CHECK_LIB(readline, readline)
77      AC_CHECK_LIB(termcap, tputs)
78      AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
# Line 98 | Line 112 | AC_CHECK_FUNCS(pthread_cancel)
112   dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
113   SEMSRC=
114   AC_CHECK_FUNCS(sem_init, , [
115 <  if [ "x$HAVE_PTHREADS" = "xyes" ]; then
115 >  if test "x$HAVE_PTHREADS" = "xyes"; then
116      SEMSRC=posix_sem.cpp
117    fi
118   ])
# Line 172 | Line 186 | AC_CHECK_SIZEOF(short, 2)
186   AC_CHECK_SIZEOF(int, 4)
187   AC_CHECK_SIZEOF(long, 4)
188   AC_CHECK_SIZEOF(long long, 8)
189 + AC_CHECK_SIZEOF(void *, 4)
190   AC_TYPE_OFF_T
191   AC_CHECK_TYPE(loff_t, off_t)
192   AC_TYPE_SIZE_T
193 + AC_TYPE_SIGNAL
194   AC_HEADER_TIME
195   AC_STRUCT_TM
196  
197   dnl Checks for library functions.
198   AC_CHECK_FUNCS(strdup cfmakeraw)
199 < AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
199 > AC_CHECK_FUNCS(clock_gettime timer_create)
200  
201   dnl Select system-dependant source files.
202   SERIALSRC=serial_unix.cpp
# Line 188 | Line 204 | ETHERSRC=../dummy/ether_dummy.cpp
204   SCSISRC=../dummy/scsi_dummy.cpp
205   AUDIOSRC=../dummy/audio_dummy.cpp
206   EXTRASYSSRCS=
207 < SUPPORTS_NATIVE_M68K=no
208 < if MACHINE=`uname -s 2>/dev/null`; then
209 <  case "$MACHINE" in
210 <  Linux*)
211 <    ETHERSRC=Linux/ether_linux.cpp
212 <    SCSISRC=Linux/scsi_linux.cpp
213 <    AUDIOSRC=audio_oss_esd.cpp
214 <    ;;
215 <  FreeBSD*3.*)
216 <    AUDIOSRC=audio_oss_esd.cpp
217 <    DEFINES="$DEFINES -DBSD_COMP"
218 <    dnl Check for the CAM library
219 <    AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
220 <    if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
221 <      AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
207 > CAN_NATIVE_M68K=no
208 > case "$target_os" in
209 > linux*)
210 >  ETHERSRC=Linux/ether_linux.cpp
211 >  SCSISRC=Linux/scsi_linux.cpp
212 >  AUDIOSRC=audio_oss_esd.cpp
213 >  ;;
214 > freebsd*3.*)
215 >  AUDIOSRC=audio_oss_esd.cpp
216 >  DEFINES="$DEFINES -DBSD_COMP"
217 >  dnl Check for the CAM library
218 >  AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
219 >  if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
220 >    AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
221 >  else
222 >    dnl Check for the sys kernel includes
223 >    AC_CHECK_HEADER(/sys/cam/cam.h)
224 >    if [[ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]]; then
225 >      dnl In this case I should fix this thing including a "patch"
226 >      dnl to access directly to the functions in the kernel :) --Orlando
227 >      AC_MSG_WARN([Cannot find kernel includes for CAM library, disabling SCSI support.])
228      else
229 <      dnl Check for the sys kernel includes
230 <      AC_CHECK_HEADER(/sys/cam/cam.h)
231 <      if [[ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]]; then
232 <        dnl In this case I should fix this thing including a "patch"
233 <        dnl to access directly to the functions in the kernel :) --Orlando
212 <        AC_MSG_WARN([Cannot find kernel includes for CAM library, disabling SCSI support.])
213 <      else
214 <        SCSISRC=FreeBSD/scsi_freebsd.cpp
215 <        CXXFLAGS="$CXXFLAGS -I/sys"
216 <        CFLAGS="$CFLAGS -I/sys"
217 <        LIBS="$LIBS -lcam"
218 <        DEFINES="$DEFINES -DCAM"
219 <      fi
229 >      SCSISRC=FreeBSD/scsi_freebsd.cpp
230 >      CXXFLAGS="$CXXFLAGS -I/sys"
231 >      CFLAGS="$CFLAGS -I/sys"
232 >      LIBS="$LIBS -lcam"
233 >      DEFINES="$DEFINES -DCAM"
234      fi
235 <    ;;
236 <  FreeBSD*)
237 <    DEFINES="$DEFINES -DBSD_COMP"
238 <    dnl Check for the SCSI library
239 <    AC_CHECK_LIB(scsi, scsi_open, HAVE_LIBSCSI=yes, HAVE_LIBSCSI=no)
240 <    if [[ "x$HAVE_LIBSCSI" = "xno" ]]; then
241 <      AC_MSG_WARN([Cannot find libscsi for SCSI management, disabling SCSI support.])
235 >  fi
236 >  ;;
237 > freebsd*)
238 >  DEFINES="$DEFINES -DBSD_COMP"
239 >  dnl Check for the SCSI library
240 >  AC_CHECK_LIB(scsi, scsi_open, HAVE_LIBSCSI=yes, HAVE_LIBSCSI=no)
241 >  if [[ "x$HAVE_LIBSCSI" = "xno" ]]; then
242 >    AC_MSG_WARN([Cannot find libscsi for SCSI management, disabling SCSI support.])
243 >  else
244 >    dnl Check for the sys kernel includes
245 >    AC_CHECK_HEADER(scsi.h sys/scsiio.h)
246 >    if [[ "x$ac_cv_header_scsi_h" = "xno" ]]; then
247 >      AC_MSG_WARN([Cannot find includes for the SCSI library, disabling SCSI support.])
248      else
249 <      dnl Check for the sys kernel includes
250 <      AC_CHECK_HEADER(scsi.h sys/scsiio.h)
231 <      if [[ "x$ac_cv_header_scsi_h" = "xno" ]]; then
232 <        AC_MSG_WARN([Cannot find includes for the SCSI library, disabling SCSI support.])
233 <      else
234 <        SCSISRC=FreeBSD/scsi_freebsd.cpp
235 <        LIBS="$LIBS -lscsi"
236 <      fi
249 >      SCSISRC=FreeBSD/scsi_freebsd.cpp
250 >      LIBS="$LIBS -lscsi"
251      fi
252 <    ;;
253 <  NetBSD*)
254 <    SUPPORTS_NATIVE_M68K=yes
255 <    ;;
256 <  SunOS*)
257 <    AUDIOSRC=Solaris/audio_solaris.cpp
258 <    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
259 <    ;;
260 <  IRIX*)
261 <    EXTRASYSSRCS=Irix/unaligned.c
262 <    DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200"
263 <    LIBS="$LIBS -lm"
264 <    ;;
265 <  esac
252 >  fi
253 >  ;;
254 > netbsd*)
255 >  CAN_NATIVE_M68K=yes
256 >  ;;
257 > solaris*)
258 >  AUDIOSRC=Solaris/audio_solaris.cpp
259 >  DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
260 >  ;;
261 > irix*)
262 >  EXTRASYSSRCS=Irix/unaligned.c
263 >  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
264 >  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
265 >  LIBS="$LIBS -lm"
266 >  ;;
267 > esac
268 >
269 > dnl Use 68k CPU natively?
270 > WANT_NATIVE_M68K=no
271 > if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
272 >  AC_DEFINE(ENABLE_NATIVE_M68K)
273 >  WANT_NATIVE_M68K=yes
274   fi
275 +
276   if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
277    dnl Serial, ethernet and audio support needs pthreads
278    AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.])
# Line 259 | Line 282 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
282   fi
283   SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
284  
285 + dnl Define a macro that translates a yesno-variable into a C macro definition
286 + dnl to be put into the config.h file
287 + dnl $1 -- the macro to define
288 + dnl $2 -- the value to translate
289 + AC_DEFUN(AC_TRANSLATE_DEFINE, [
290 +    if [[ "x$2" = "xyes" ]]; then
291 +        AC_DEFINE($1)
292 +    fi
293 + ])
294 +
295 + dnl Check if we can mmap 0x2000 bytes from 0x0000
296 + AC_CACHE_CHECK("whether we can map Low Memory area 0x0000-0x2000",
297 +  ac_cv_can_map_lm, [
298 +  AC_LANG_SAVE
299 +  AC_LANG_CPLUSPLUS
300 +  AC_TRY_RUN([
301 +    #include <unistd.h>
302 +    #include <fcntl.h>
303 +    #include <sys/mman.h>
304 +    
305 +    int main()
306 +    { int zero_fd; char * lm;
307 +      if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
308 +      if ((lm = (char *)mmap((caddr_t)0x0000, 0x2000, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, zero_fd, 0)) == MAP_FAILED) exit(1);
309 +      lm[0] = 0x12;
310 +          munmap(lm, 0x2000);
311 +      close(zero_fd);
312 +      exit(0);
313 +    }
314 +  ],
315 +  [ac_cv_can_map_lm=yes],
316 +  [ac_cv_can_map_lm=no]
317 +  )
318 +  AC_LANG_RESTORE
319 +  ]
320 + )
321 +
322 + dnl Check if extended signals are supported.
323 + AC_CACHE_CHECK("whether your system supports extended signal handlers",
324 +  ac_cv_have_extended_signals, [
325 +  AC_LANG_SAVE
326 +  AC_LANG_CPLUSPLUS
327 +  AC_TRY_RUN([
328 +    #include <unistd.h>
329 +    #include <stdlib.h>
330 +    #include <signal.h>
331 +    #include <fcntl.h>
332 +    #include <sys/mman.h>
333 +
334 +    static volatile caddr_t mem = 0;
335 +    static int zero_fd = -1;
336 +
337 +    static RETSIGTYPE segfault_handler(int, siginfo_t * sip, void *)
338 +    { if ((caddr_t)(sip->si_addr) != mem) exit(1);
339 +      munmap(mem, getpagesize()); close(zero_fd); exit(0); }
340 +
341 +    int main()
342 +    { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
343 +      if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
344 +      struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = SA_SIGINFO;
345 +      sigaction(SIGSEGV, &sa, 0);
346 +      mem[0] = 0;
347 +      exit(1); // should not be reached
348 +    }
349 +  ],
350 +  [ac_cv_have_extended_signals=yes],
351 +  [ac_cv_have_extended_signals=no]
352 +  )
353 +  AC_LANG_RESTORE
354 +  ]
355 + )
356 + AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals")
357 +
358 + dnl Otherwise, check for subterfuges.
359 + if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
360 +  case "$target_os" in
361 +    linux*)
362 +      if [[ "x$HAVE_I386" = "xyes" ]]; then
363 +        AC_CACHE_CHECK("whether we then have a subterfuge for your system",
364 +                  ac_cv_have_sigcontext_hack, [
365 +          AC_LANG_SAVE
366 +          AC_LANG_CPLUSPLUS
367 +          AC_TRY_RUN([
368 +            #include <unistd.h>
369 +            #include <signal.h>
370 +            #include <fcntl.h>
371 +            #include <sys/mman.h>
372 +
373 +            static volatile caddr_t mem = 0;
374 +            static int zero_fd = -1;
375 +
376 +            static RETSIGTYPE segfault_handler(int, struct sigcontext scs)
377 +            { if ((caddr_t)(scs.cr2) != mem) exit(1);
378 +              munmap(mem, getpagesize()); close(zero_fd); exit(0); }
379 +
380 +            int main()
381 +            { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
382 +              if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
383 +              struct sigaction sa; sa.sa_flags = 0;
384 +              sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler;
385 +              sigaction(SIGSEGV, &sa, 0);
386 +              mem[0] = 0;
387 +              exit(1); // should not be reached
388 +            }
389 +          ],
390 +          [ac_cv_have_sigcontext_hack=yes],
391 +          [ac_cv_have_sigcontext_hack=no]
392 +          )
393 +          AC_LANG_RESTORE
394 +        ])
395 +        AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
396 +      fi
397 +      ;;
398 +    netbsd*)
399 +      if [[ "x$HAVE_M68K" = "xyes" ]]; then
400 +        AC_CACHE_CHECK("whether we then have a subterfuge for your system",
401 +                  ac_cv_have_sigcontext_hack, [
402 +          AC_LANG_SAVE
403 +          AC_LANG_CPLUSPLUS
404 +          AC_TRY_RUN([
405 +            #include <unistd.h>
406 +            #include <signal.h>
407 +            #include <fcntl.h>
408 +            #include <sys/mman.h>
409 +
410 +            static volatile caddr_t mem = 0;
411 +            static int zero_fd = -1;
412 +
413 +            static RETSIGTYPE segfault_handler(int, int code)
414 +            { if ((caddr_t)code != mem) exit(1);
415 +              munmap(mem, getpagesize()); close(zero_fd); exit(0); }
416 +
417 +            int main()
418 +            { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
419 +              if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
420 +              struct sigaction sa; sa.sa_flags = 0;
421 +              sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler;
422 +              sigaction(SIGSEGV, &sa, 0);
423 +              mem[0] = 0;
424 +              exit(1); // should not be reached
425 +            }
426 +          ],
427 +          [ac_cv_have_sigcontext_hack=yes],
428 +          [ac_cv_have_sigcontext_hack=no]
429 +          )
430 +          AC_LANG_RESTORE
431 +        ])
432 +        AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
433 +      fi
434 +    ;;
435 +  esac
436 + fi
437 +
438 + dnl Can we do Video on SEGV Signals ?
439 + CAN_VOSF=no
440 + if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
441 +  CAN_VOSF=yes
442 + fi
443 +
444 + dnl Determine the addressing mode to use
445 + if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
446 +  ADDRESSING_MODE="real"
447 + else
448 +  ADDRESSING_MODE=""
449 +  AC_MSG_CHECKING([for the addressing mode to use])
450 +  for am in $ADDRESSING_TEST_ORDER; do
451 +    case $am in
452 +    real)
453 +      dnl Requires ability to mmap Low Memory globals.
454 +      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
455 +        continue
456 +      fi
457 +      if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then
458 +        dnl Requires only VOSF if 16-bit vidmode enable
459 +        if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then
460 +          if [[ "x$CAN_VOSF" = "xno" ]]; then
461 +            continue
462 +          fi
463 +        else
464 +          DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE"
465 +        fi
466 +      else
467 +        dnl Requires VOSF
468 +        if [[ "x$CAN_VOSF" = "xno" ]]; then
469 +          continue
470 +        fi
471 +      fi
472 +      dnl Real addressing will probably work
473 +      ADDRESSING_MODE="real"
474 +      WANT_VOSF=yes dnl we can use VOSF and we need it actually
475 +      DEFINES="$DEFINES -DREAL_ADDRESSING"
476 +      break
477 +      ;;
478 +    direct)
479 +      dnl Requires VOSF
480 +      if [[ "x$CAN_VOSF" = "xyes" ]]; then
481 +        ADDRESSING_MODE="direct"
482 +        WANT_VOSF=yes dnl we can use VOSF and we need it actually
483 +        DEFINES="$DEFINES -DDIRECT_ADDRESSING"
484 +        break
485 +      fi
486 +      ;;
487 +    banks)
488 +      dnl Default addressing mode
489 +      ADDRESSING_MODE="memory banks"
490 +      break
491 +      ;;
492 +    *)
493 +      AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
494 +    esac
495 +  done
496 +  AC_MSG_RESULT($ADDRESSING_MODE)
497 +  if [[ "x$ADDRESSING_MODE" = "x" ]]; then
498 +    AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
499 +    ADDRESSING_MODE="memory banks"
500 +  fi
501 + fi
502 +
503 + dnl Since real and direct addressing modes automatically activate VOSF,
504 + dnl I put this test here.
505 + if [[ "x$WANT_VOSF" = "xyes" ]]; then
506 +  if [[ "x$CAN_VOSF" = "xno" ]]; then
507 +    AC_MSG_WARN([Sorry, your system does not support Video on SEGV signals])
508 +    WANT_VOSF=no
509 +  else
510 +    AC_DEFINE(ENABLE_VOSF)
511 +  fi
512 + fi
513 +
514   dnl Check for GAS.
515   HAVE_GAS=no
516   AC_MSG_CHECKING(for GAS .p2align feature)
# Line 285 | Line 537 | if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE
537   fi
538  
539   dnl Select appropriate CPU source and REGPARAM define.
540 < WANT_X86_ASSEMBLY=no
289 < WANT_SPARC_V8_ASSEMBLY=no
290 < WANT_SPARC_V9_ASSEMBLY=no
291 < WANT_NATIVE_M68K=no
540 > ASM_OPTIMIZATIONS=none
541   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
542 + FPUSRCS="../uae_cpu/fpp.cpp"
543   if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
544    dnl i386 CPU
545    DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
546    if [[ "x$HAVE_GAS" = "xyes" ]]; then
547 <    WANT_X86_ASSEMBLY=yes
548 <    DEFINES="$DEFINES -DX86_ASSEMBLY"
547 >    ASM_OPTIMIZATIONS=i386
548 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTFLAGS"
549      CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
550 +    FPUSRCS="../uae_cpu/fpu_x86.cpp"
551    fi
552   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
553    dnl SPARC CPU
554 <  case "$MACHINE" in
555 <  SunOS*)
554 >  case "$target_os" in
555 >  solaris*)
556      AC_MSG_CHECKING(SPARC CPU architecture)
557      SPARC_TYPE=`Solaris/which_sparc`
558      AC_MSG_RESULT($SPARC_TYPE)
559      case "$SPARC_TYPE" in
560      SPARC_V8)
561 <      WANT_SPARC_V8_ASSEMBLY=yes
562 <      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY"
561 >      ASM_OPTIMIZATIONS="SPARC V8 architecture"
562 >      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS"
563        CFLAGS="$CFLAGS -Wa,-Av8"
564        CXXFLAGS="$CXXFLAGS -Wa,-Av8"
565        ;;
566      SPARC_V9)
567 <      WANT_SPARC_V9_ASSEMBLY=yes
568 <      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY"
567 >      ASM_OPTIMIZATIONS="SPARC V9 architecture"
568 >      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS"
569        CFLAGS="$CFLAGS -Wa,-Av9"
570        CXXFLAGS="$CXXFLAGS -Wa,-Av9"
571        ;;
572      esac
573      ;;
574    esac
575 < elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then
575 > elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
576    dnl Native m68k, no emulation
577 <  CPUSRCS=""
578 <  AC_DEFINE(ENABLE_NATIVE_M68K)
328 <  WANT_NATIVE_M68K=yes
577 >  CPUINCLUDES="-I../native_cpu"
578 >  CPUSRCS="asm_support.s"
579   fi
580  
581   dnl UAE CPU sources for all non-m68k-native architectures.
582   if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
583    CPUINCLUDES="-I../uae_cpu"
584 <  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 $CPUSRCS"
585 < else
586 <  CPUINCLUDES="-I../native_cpu"
587 <  CPUSRCS="asm_support.s"
584 >  CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS"
585 > fi
586 >
587 > dnl Remove the "-g" option if set for GCC.
588 > if [[ "x$HAVE_GCC27" = "xyes" ]]; then
589 >  dnl gb-- Probably not the cleanest way to take
590 >  CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
591 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
592   fi
593  
594   dnl Generate Makefile.
# Line 351 | Line 605 | echo
605   echo XFree86 DGA support .............. : $WANT_XF86_DGA
606   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
607   echo fbdev DGA support ................ : $WANT_FBDEV_DGA
608 + echo Enable video on SEGV signals ..... : $WANT_VOSF
609   echo ESD sound support ................ : $WANT_ESD
610   echo GTK user interface ............... : $WANT_GTK
611   echo mon debugger support ............. : $WANT_MON
357 echo i386 assembly optimizations ...... : $WANT_X86_ASSEMBLY
358 echo SPARC V8 assembly optimizations .. : $WANT_SPARC_V8_ASSEMBLY
359 echo SPARC V9 assembly optimizations .. : $WANT_SPARC_V9_ASSEMBLY
612   echo Running m68k code natively ....... : $WANT_NATIVE_M68K
613 + echo Assembly optimizations ........... : $ASM_OPTIMIZATIONS
614 + echo Addressing mode .................. : $ADDRESSING_MODE
615   echo
616   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines