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.25 by cebix, 2000-10-08T18:41:34Z vs.
Revision 1.33 by cebix, 2001-02-10T15:29:01Z

# 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=yes]], [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])
12 > AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=no]], [WANT_VOSF=$enableval], [WANT_VOSF=no])
13 >
14 > dnl Addressing modes.
15   AC_ARG_ENABLE(addressing,
16 < [  --enable-addressing=mode specify the addressing mode to use [default=fastest]],
16 > [  --enable-addressing=AM  specify the addressing mode to use [default=fastest]],
17   [ case "$enableval" in
18      real)       ADDRESSING_TEST_ORDER="real";;
19      direct)     ADDRESSING_TEST_ORDER="direct";;
20      banks)      ADDRESSING_TEST_ORDER="banks";;
21 < dnl fastest)    ADDRESSING_TEST_ORDER="real direct banks";; gb-- will enable later...
22 <    fastest)    ADDRESSING_TEST_ORDER="direct banks";;
22 <    *)          AC_MSG_ERROR([--enable-mem-addressing takes only one of the following values: fastest, real, direct, banks]);;
21 >    fastest)ADDRESSING_TEST_ORDER="direct banks";;
22 >    *)          AC_MSG_ERROR([--enable-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
25   [ ADDRESSING_TEST_ORDER="direct banks"
26   ])
27 +
28 + dnl External packages.
29   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
30   AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
31   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
# Line 39 | Line 40 | case "$target_os" in
40    netbsd*)      OS_TYPE=netbsd;;
41    freebsd*)     OS_TYPE=freebsd;;
42    solaris*)     OS_TYPE=solaris;;
43 <  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/'`;;
43 >  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/' | sed -e 's/\./_/'`;;
44   esac
45   DEFINES="$DEFINES -DOS_$OS_TYPE"
46  
# Line 47 | Line 48 | dnl Target CPU type.
48   HAVE_I386=no
49   HAVE_M68K=no
50   HAVE_SPARC=no
51 + HAVE_POWERPC=no
52   case "$target_cpu" in
53    i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;;
54    m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;;
55    sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;;
56 +  powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;;
57    *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/'`;;
58   esac
59   DEFINES="$DEFINES -DCPU_$CPU_TYPE"
# Line 71 | Line 74 | if [[ "x$WANT_MON" = "xyes" ]]; then
74    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
75      AC_MSG_RESULT(yes)
76      AC_DEFINE(ENABLE_MON)
77 <    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"
77 >    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/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
78      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
79      AC_CHECK_LIB(readline, readline)
80      AC_CHECK_LIB(termcap, tputs)
# Line 112 | Line 115 | AC_CHECK_FUNCS(pthread_cancel)
115   dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
116   SEMSRC=
117   AC_CHECK_FUNCS(sem_init, , [
118 <  if [ "x$HAVE_PTHREADS" = "xyes" ]; then
118 >  if test "x$HAVE_PTHREADS" = "xyes"; then
119      SEMSRC=posix_sem.cpp
120    fi
121   ])
# Line 204 | Line 207 | ETHERSRC=../dummy/ether_dummy.cpp
207   SCSISRC=../dummy/scsi_dummy.cpp
208   AUDIOSRC=../dummy/audio_dummy.cpp
209   EXTRASYSSRCS=
210 < SUPPORTS_NATIVE_M68K=no
210 > CAN_NATIVE_M68K=no
211   case "$target_os" in
212   linux*)
213    ETHERSRC=Linux/ether_linux.cpp
# Line 252 | Line 255 | freebsd*)
255    fi
256    ;;
257   netbsd*)
258 <  SUPPORTS_NATIVE_M68K=yes
258 >  CAN_NATIVE_M68K=yes
259    ;;
260   solaris*)
261    AUDIOSRC=Solaris/audio_solaris.cpp
262    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
263    ;;
264   irix*)
265 +  AUDIOSRC=Irix/audio_irix.cpp
266    EXTRASYSSRCS=Irix/unaligned.c
267 <  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200"
268 <  LIBS="$LIBS -lm"
267 >  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
268 >  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
269 >  LIBS="$LIBS -laudio"
270    ;;
271   esac
272  
273 + dnl Use 68k CPU natively?
274 + WANT_NATIVE_M68K=no
275 + if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
276 +  AC_DEFINE(ENABLE_NATIVE_M68K)
277 +  WANT_NATIVE_M68K=yes
278 + fi
279 +
280   if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
281    dnl Serial, ethernet and audio support needs pthreads
282    AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.])
# Line 385 | Line 397 | if [[ "x$ac_cv_have_extended_signals" =
397            AC_LANG_RESTORE
398          ])
399          AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
400 +      elif [[ "x$HAVE_POWERPC" = "xyes" ]]; then
401 +        AC_CACHE_CHECK("whether we then have a subterfuge for your system",
402 +                  ac_cv_have_sigcontext_hack, [
403 +          AC_LANG_SAVE
404 +          AC_LANG_CPLUSPLUS
405 +          AC_TRY_RUN([
406 +            #include <unistd.h>
407 +            #include <signal.h>
408 +            #include <fcntl.h>
409 +            #include <sys/mman.h>
410 +
411 +            static volatile caddr_t mem = 0;
412 +            static int zero_fd = -1;
413 +
414 +            static RETSIGTYPE segfault_handler(int, struct sigcontext_struct *scs)
415 +            { if ((caddr_t)(scs->regs->dar) != mem) exit(1);
416 +              munmap(mem, getpagesize()); close(zero_fd); exit(0); }
417 +
418 +            int main()
419 +            { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
420 +              if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
421 +              struct sigaction sa; sa.sa_flags = 0;
422 +              sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler;
423 +              sigaction(SIGSEGV, &sa, 0);
424 +              mem[0] = 0;
425 +              exit(1); // should not be reached
426 +            }
427 +          ],
428 +          [ac_cv_have_sigcontext_hack=yes],
429 +          [ac_cv_have_sigcontext_hack=no]
430 +          )
431 +          AC_LANG_RESTORE
432 +        ])
433 +        AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
434 +      fi
435 +      ;;
436 +    netbsd*)
437 +      if [[ "x$HAVE_M68K" = "xyes" ]]; then
438 +        AC_CACHE_CHECK("whether we then have a subterfuge for your system",
439 +                  ac_cv_have_sigcontext_hack, [
440 +          AC_LANG_SAVE
441 +          AC_LANG_CPLUSPLUS
442 +          AC_TRY_RUN([
443 +            #include <unistd.h>
444 +            #include <signal.h>
445 +            #include <fcntl.h>
446 +            #include <sys/mman.h>
447 +
448 +            static volatile caddr_t mem = 0;
449 +            static int zero_fd = -1;
450 +
451 +            static RETSIGTYPE segfault_handler(int, int code)
452 +            { if ((caddr_t)code != mem) exit(1);
453 +              munmap(mem, getpagesize()); close(zero_fd); exit(0); }
454 +
455 +            int main()
456 +            { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
457 +              if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
458 +              struct sigaction sa; sa.sa_flags = 0;
459 +              sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler;
460 +              sigaction(SIGSEGV, &sa, 0);
461 +              mem[0] = 0;
462 +              exit(1); // should not be reached
463 +            }
464 +          ],
465 +          [ac_cv_have_sigcontext_hack=yes],
466 +          [ac_cv_have_sigcontext_hack=no]
467 +          )
468 +          AC_LANG_RESTORE
469 +        ])
470 +        AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
471        fi
472      ;;
473    esac
# Line 397 | Line 480 | if [[ "$ac_cv_have_extended_signals" = "
480   fi
481  
482   dnl Determine the addressing mode to use
483 < ADDRESSING_MODE=""
484 < AC_MSG_CHECKING([for the addressing mode to use])
485 < for am in $ADDRESSING_TEST_ORDER; do
486 <  case $am in
487 <  real)
488 <    dnl Requires ability to mmap Low Memory globals.
489 <    if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
490 <      continue
491 <    fi
492 <    if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then
493 <      dnl Requires only VOSF if 16-bit vidmode enable
411 <      if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then
412 <        if [[ "x$CAN_VOSF" = "xno" ]]; then
413 <          continue
414 <        fi
415 <      else
416 <        DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE"
483 > if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
484 >  ADDRESSING_MODE="real"
485 > else
486 >  ADDRESSING_MODE=""
487 >  AC_MSG_CHECKING([for the addressing mode to use])
488 >  for am in $ADDRESSING_TEST_ORDER; do
489 >    case $am in
490 >    real)
491 >      dnl Requires ability to mmap() Low Memory globals
492 >      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
493 >        continue
494        fi
495 <    else
419 <      dnl Requires VOSF
495 >          dnl Requires VOSF screen updates
496        if [[ "x$CAN_VOSF" = "xno" ]]; then
497          continue
498        fi
499 <    fi
500 <    dnl Real addressing will probably work
425 <    ADDRESSING_MODE="real"
426 <    WANT_VOSF=yes dnl we can use VOSF and we need it actually
427 <    DEFINES="$DEFINES -DREAL_ADDRESSING"
428 <    break
429 <    ;;
430 <  direct)
431 <    dnl Requires VOSF
432 <    if [[ "x$CAN_VOSF" = "xyes" ]]; then
433 <      ADDRESSING_MODE="direct"
499 >      dnl Real addressing will probably work.
500 >      ADDRESSING_MODE="real"
501        WANT_VOSF=yes dnl we can use VOSF and we need it actually
502 <      DEFINES="$DEFINES -DDIRECT_ADDRESSING"
502 >      DEFINES="$DEFINES -DREAL_ADDRESSING"
503        break
504 <    fi
505 <    ;;
506 <  banks)
507 <    dnl Default addressing mode
504 >      ;;
505 >    direct)
506 >      dnl Requires VOSF screen updates
507 >      if [[ "x$CAN_VOSF" = "xyes" ]]; then
508 >        ADDRESSING_MODE="direct"
509 >        WANT_VOSF=yes dnl we can use VOSF and we need it actually
510 >        DEFINES="$DEFINES -DDIRECT_ADDRESSING"
511 >        break
512 >      fi
513 >      ;;
514 >    banks)
515 >      dnl Default addressing mode
516 >      ADDRESSING_MODE="memory banks"
517 >      break
518 >      ;;
519 >    *)
520 >      AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
521 >    esac
522 >  done
523 >  AC_MSG_RESULT($ADDRESSING_MODE)
524 >  if [[ "x$ADDRESSING_MODE" = "x" ]]; then
525 >    AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
526      ADDRESSING_MODE="memory banks"
527 <    break
443 <    ;;
444 <  *)
445 <    AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
446 <  esac
447 < done
448 < AC_MSG_RESULT($ADDRESSING_MODE)
449 < if [[ "x$ADDRESSING_MODE" = "x" ]]; then
450 <  AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
451 <  ADDRESSING_MODE="memory banks"
527 >  fi
528   fi
529  
530 < dnl Since real and direct addressing modes automatically activate VOSF,
531 < dnl I put this test here.
456 < if [[ "x$WANT_VOSF" = "xyes" ]]; then
457 <  if [[ "x$CAN_VOSF" = "xno" ]]; then
458 <    AC_MSG_WARN([Sorry, your system does not support Video on SEGV signals])
459 <    WANT_VOSF=no
460 <  else
530 > dnl Enable VOSF screen updates with this feature is requested and feasible
531 > if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
532      AC_DEFINE(ENABLE_VOSF)
533 <  fi
533 > else
534 >    WANT_VOSF=no
535   fi
536  
537   dnl Check for GAS.
# Line 489 | Line 561 | fi
561  
562   dnl Select appropriate CPU source and REGPARAM define.
563   ASM_OPTIMIZATIONS=none
492 WANT_NATIVE_M68K=no
564   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
565   FPUSRCS="../uae_cpu/fpp.cpp"
566   if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
# Line 497 | Line 568 | if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE
568    DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
569    if [[ "x$HAVE_GAS" = "xyes" ]]; then
570      ASM_OPTIMIZATIONS=i386
571 <    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTFLAGS"
571 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS"
572      CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
573      FPUSRCS="../uae_cpu/fpu_x86.cpp"
574    fi
# Line 510 | Line 581 | elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HA
581      AC_MSG_RESULT($SPARC_TYPE)
582      case "$SPARC_TYPE" in
583      SPARC_V8)
584 <          ASM_OPTIMIZATIONS="SPARC V8 architecture"
585 <      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS"
584 >      ASM_OPTIMIZATIONS="SPARC V8 architecture"
585 >      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
586        CFLAGS="$CFLAGS -Wa,-Av8"
587        CXXFLAGS="$CXXFLAGS -Wa,-Av8"
588        ;;
589      SPARC_V9)
590 <          ASM_OPTIMIZATIONS="SPARC V9 architecture"
591 <      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS"
590 >      ASM_OPTIMIZATIONS="SPARC V9 architecture"
591 >      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
592        CFLAGS="$CFLAGS -Wa,-Av9"
593        CXXFLAGS="$CXXFLAGS -Wa,-Av9"
594        ;;
595      esac
596      ;;
597    esac
598 < elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then
598 > elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
599    dnl Native m68k, no emulation
600 <  CPUSRCS=""
601 <  AC_DEFINE(ENABLE_NATIVE_M68K)
531 <  WANT_NATIVE_M68K=yes
600 >  CPUINCLUDES="-I../native_cpu"
601 >  CPUSRCS="asm_support.s"
602   fi
603  
604   dnl UAE CPU sources for all non-m68k-native architectures.
605   if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
606    CPUINCLUDES="-I../uae_cpu"
607    CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS"
538 else
539  CPUINCLUDES="-I../native_cpu"
540  CPUSRCS="asm_support.s"
608   fi
609  
610   dnl Remove the "-g" option if set for GCC.
611   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
612 <        dnl gb-- Probably not the cleanest way to take
613 <        CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
614 <        CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
612 >  dnl gb-- Probably not the cleanest way to take
613 >  CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
614 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
615   fi
616  
617   dnl Generate Makefile.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines