Annotation of uae/configure.in, revision 1.1.1.12

1.1       root        1: dnl Process this file with autoconf to produce a configure script.
1.1.1.4   root        2: dnl Written 1996, 1997, 1998 Bernd Schmidt
                      3: 
                      4: dnl If you can use anything from this file, feel free to steal it. I put
                      5: dnl this into the public domain.
                      6: 
                      7: dnl There are still many uncaught errors (e.g. --enable-dga on an Amiga)
                      8: dnl I didn't have the nerve to track them all down.
1.1       root        9: 
1.1.1.2   root       10: AC_INIT(amiga/source/transdisk.c)
1.1.1.4   root       11: AC_PREREQ(2.12)
                     12: 
1.1       root       13: dnl Checks for programs.
                     14: AC_PROG_CC
                     15: 
                     16: AC_PROG_CPP
                     17: AC_PROG_MAKE_SET
1.1.1.11  root       18: AC_PATH_PROG(MAKEDEPPRG, makedepend, not-found)
1.1.1.4   root       19: AC_PATH_PROG(FILEPRG, file, not-found)
1.1.1.6   root       20: AC_PATH_PROG(WRCPRG, wrc, not-found)
                     21: AC_PATH_PROG(RCLPRG, rcl, not-found)
1.1       root       22: 
                     23: AC_AIX
                     24: AC_ISC_POSIX
                     25: 
1.1.1.6   root       26: AC_MSG_CHECKING(for Watcom C)
                     27: AC_EGREP_CPP(yes,
                     28: [#ifdef __WATCOMC__
                     29:   yes
                     30: #endif
                     31: ], [uae_cv_prog_cc_watcom=yes], [uae_cv_prog_cc_watcom=no])
                     32: AC_MSG_RESULT($uae_cv_prog_cc_watcom)
                     33: 
                     34: AM_CYGWIN32
                     35: AM_MINGW32
                     36: AM_EXEEXT
                     37: 
1.1.1.4   root       38: NR_WARNINGS=0
                     39: NR_ERRORS=0
                     40: 
1.1.1.6   root       41: tmp_save_dir=`pwd`
                     42: cd $srcdir
                     43: abssrcdir=`pwd`
                     44: cd $tmp_save_dir
                     45: 
1.1.1.4   root       46: NEED_THREAD_SUPPORT=no
                     47: 
                     48: ADDITIONAL_CFLAGS=
                     49: OPTIMIZE_CFLAGS=
                     50: WARNING_CFLAGS=
                     51: DEBUG_CFLAGS=
                     52: NO_SCHED_CFLAGS=
                     53: 
1.1       root       54: dnl Checks for libraries.
1.1.1.4   root       55: HAVE_BEOS=no
                     56: HAVE_POS=no
1.1       root       57: dnl Replace `main' with a function in -lMedia_s: (Ian!)
1.1.1.4   root       58: AC_CHECK_LIB(Media_s, main, HAVE_MEDIA_LIB=yes, HAVE_MEDIA_LIB=no)
1.1       root       59: dnl Replace `main' with a function in -lNeXT_s:
1.1.1.4   root       60: AC_CHECK_LIB(NeXT_s, main, HAVE_NEXT_LIB=yes, HAVE_NEXT_LIB=no)
1.1.1.11  root       61: AC_CHECK_LIB(moto, cos, HAVE_MOTO_LIB=yes, HAVE_MOTO_LIB=no)
1.1.1.4   root       62: AC_CHECK_LIB(amiga, OpenLibrary, HAVE_AMIGA_LIB=yes, HAVE_AMIGA_LIB=n)
                     63: AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=yes, HAVE_SVGA_LIB=no)
                     64: AC_CHECK_LIB(AF, AFOpenAudioConn, HAVE_AF_LIB=yes, HAVE_AF_LIB=no)
1.1.1.6   root       65: AC_CHECK_LIB(mme, waveOutGetNumDevs, HAVE_MME_LIB=yes, HAVE_MME_LIB=no)
1.1.1.4   root       66: AC_CHECK_LIB(ncurses, waddch, HAVE_NCURSES_LIB=yes, HAVE_NCURSES_LIB=no)
                     67: AC_CHECK_LIB(posix4, sem_init, HAVE_POSIX4_LIB=yes, HAVE_POSIX4_LIB=no)
1.1.1.6   root       68: AC_CHECK_LIB(rt, sem_init, HAVE_RT_LIB=yes, HAVE_RT_LIB=no)
1.1.1.4   root       69: AC_CHECK_LIB(ggi, ggiInit, HAVE_GGI_LIB=yes, HAVE_GGI_LIB=no)
1.1.1.8   root       70: AC_CHECK_LIB(audio, alOpenPort, HAVE_SGIAUDIO_LIB=yes, HAVE_SGIAUDIO_LIB=no)
1.1.1.4   root       71: 
                     72: AC_PATH_XTRA
                     73: AC_CONFIG_HEADER(src/sysconfig.h)
1.1.1.3   root       74: 
1.1       root       75: AC_HEADER_DIRENT
                     76: AC_HEADER_STDC
                     77: 
1.1.1.4   root       78: dnl @@@ Is <sys/termios.h> the right way or is it <termios.h>?
                     79: AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h ncurses.h curses.h)
                     80: AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h sun/audioio.h sys/audioio.h getopt.h features.h sys/termios.h)
1.1.1.10  root       81: AC_CHECK_HEADERS(scsi/sg.h)
1.1.1.6   root       82: AC_CHECK_HEADERS(posix_opt.h sys/ioctl.h sys/ipc.h sys/shm.h sys/stat.h sys/utime.h)
1.1.1.4   root       83: AC_CHECK_HEADERS(ggi/libggi.h)
1.1.1.6   root       84: AC_CHECK_HEADERS(windows.h ddraw.h)
1.1.1.4   root       85: AC_CHECK_HEADER(be_math.h, HAVE_BEOS=yes, HAVE_BEOS=no)
1.1.1.6   root       86: AC_CHECK_HEADERS(machine/joystick.h)
                     87: AC_CHECK_HEADERS(devices/ahi.h)
1.1.1.8   root       88: AC_CHECK_HEADERS(dmedia/audio.h)
1.1.1.6   root       89: AC_CHECK_HEADERS(libraries/cybergraphics.h cybergraphx/cybergraphics.h)
1.1.1.4   root       90: 
                     91: AC_CHECK_SIZEOF(char, 1)
                     92: AC_CHECK_SIZEOF(short, 2)
                     93: AC_CHECK_SIZEOF(int, 4)
                     94: AC_CHECK_SIZEOF(long, 4)
                     95: AC_CHECK_SIZEOF(long long, 8)
1.1.1.6   root       96: AC_CHECK_SIZEOF(__int64, 8)
1.1       root       97: 
                     98: dnl Checks for typedefs, structures, and compiler characteristics.
                     99: AC_C_CONST
                    100: AC_C_INLINE
1.1.1.4   root      101: if [[ "x$ac_cv_c_inline" = "xno" ]]; then
                    102:   ac_cv_c_inline=
                    103: fi
1.1       root      104: AC_TYPE_MODE_T
                    105: AC_TYPE_OFF_T
                    106: AC_TYPE_PID_T
                    107: AC_STRUCT_ST_BLOCKS
                    108: AC_HEADER_TIME
                    109: AC_STRUCT_TM
                    110: 
                    111: dnl Checks for library functions.
                    112: AC_PROG_GCC_TRADITIONAL
                    113: AC_FUNC_MEMCMP
                    114: AC_TYPE_SIGNAL
                    115: AC_FUNC_UTIME_NULL
1.1.1.6   root      116: AC_CHECK_FUNCS(getcwd getopt strdup gettimeofday sigaction mkdir rmdir select strerror strstr)
                    117: AC_CHECK_FUNCS(tcgetattr cfmakeraw readdir_r vprintf vsprintf vfprintf)
1.1       root      118: 
1.1.1.6   root      119: dnl GNOME_FILEUTILS_CHECKS will fail for native Win32 compilers like Watcom C
                    120: dnl So don't use that macro if we know it will fail
                    121: DO_FILEUTILS_CHECK=yes
                    122: if test $uae_cv_prog_cc_watcom = yes -o $am_cv_mingw32 = yes; then
                    123:   DO_FILEUTILS_CHECK=no
                    124: fi
                    125: if test $DO_FILEUTILS_CHECK = yes; then
                    126:   GNOME_FILEUTILS_CHECKS
1.1       root      127: fi
                    128: 
1.1.1.6   root      129: dnl Check for pOS or -target=p.os
                    130: if [[ $target = "p.os" ]]; then
                    131:     HAVE_POS=yes
                    132: else
                    133:   AC_MSG_CHECKING(for pOS)
                    134:   AC_EGREP_CPP(yes,
                    135:   [#ifdef __POS__
                    136:     yes
                    137:   #endif
                    138:   ], [AC_MSG_RESULT(yes); HAVE_POS=yes], AC_MSG_RESULT(no); HAVE_POS=no)
1.1       root      139: fi
                    140: 
1.1.1.4   root      141: dnl Verify that the ncurses installation makes some sense.
                    142: 
                    143: if [[ "x$HAVE_NCURSES_LIB" = "xyes" ]]; then
                    144:   if [[ "x$ac_cv_header_ncurses_h" = "xno" -a "x$ac_cv_header_curses_h" = "xno" ]]; then
                    145:     echo "Installation problem, found libncurses but neither curses.h nor ncurses.h!"
                    146:     HAVE_NCURSES_LIB=no
                    147:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    148:   else
                    149:     if [[ "x$ac_cv_header_ncurses_h" = "xno" ]]; then
                    150:       AC_MSG_CHECKING(for attr_t in curses.h)
                    151:       AC_TRY_COMPILE([#include <curses.h>],[{ attr_t a; a = A_NORMAL; }], AC_MSG_RESULT(yes),
                    152:       [
                    153:         ADDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DDONT_HAVE_ATTR_T"
                    154:         AC_MSG_RESULT(no)
                    155:        NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    156:        echo "Please install a newer version of libncurses if you can."
                    157:       ])
                    158:     else
                    159:       AC_MSG_CHECKING(for attr_t in ncurses.h)
                    160:       AC_TRY_COMPILE([#include <ncurses.h>],[{ attr_t a; a = A_NORMAL; }], AC_MSG_RESULT(yes),
                    161:       [
                    162:         ADDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DDONT_HAVE_ATTR_T"
                    163:         AC_MSG_RESULT(no)
                    164:        NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    165:        echo "Please install a newer version of libncurses if you can."
                    166:       ])
                    167:     fi
                    168:   fi
                    169: fi
                    170: 
1.1.1.6   root      171: 
                    172: AC_MSG_CHECKING(for pthread library)
                    173: TMP_SAVE_CFLAGS=$CFLAGS
                    174: TMP_SAVE_LIBS=$LIBS
                    175: LIBS="$LIBS -lpthread"
                    176: AC_TRY_LINK([
                    177: #include "confdefs.h"
                    178: #ifdef HAVE_SYS_TYPES_H
                    179: #include <sys/types.h>
                    180: #endif
                    181: #include <pthread.h>],[
                    182: pthread_exit (0);
1.1.1.9   root      183: ],
1.1.1.6   root      184: HAVE_PTHREAD_LIB=yes
                    185: AC_MSG_RESULT(yes),
                    186: HAVE_PTHREAD_LIB=no
                    187: AC_MSG_RESULT(no))
                    188: CFLAGS=$TMP_SAVE_CFLAGS
                    189: LIBS=$TMP_SAVE_LIBS
                    190: 
                    191: AC_MSG_CHECKING(for DirectX)
                    192: TMP_SAVE_CFLAGS=$CFLAGS
                    193: TMP_SAVE_LIBS=$LIBS
                    194: CFLAGS="$CFLAGS $X_CFLAGS"
                    195: LIBS="$LIBS -lddraw"
                    196: AC_TRY_LINK([
                    197: #include "confdefs.h"
                    198: #ifdef HAVE_SYS_TYPES_H
                    199: #include <sys/types.h>
                    200: #endif
                    201: #include <windows.h>
                    202: #include <ddraw.h>],[
                    203: LPDIRECTDRAW lpDD;
                    204: IDirectDraw_CreateSurface(lpDD, 0, 0, 0);
                    205: ],
                    206: HAVE_DIRECTX=yes
                    207: AC_MSG_RESULT(yes),
                    208: HAVE_DIRECTX=no
                    209: AC_MSG_RESULT(no))
                    210: CFLAGS=$TMP_SAVE_CFLAGS
                    211: LIBS=$TMP_SAVE_LIBS
                    212: 
1.1.1.4   root      213: DO_PROFILING=no
                    214: WANT_GGI=dunno
                    215: WANT_SVGALIB=dunno
                    216: WANT_ASCIIART=dunno
                    217: WANT_UI=dunno
                    218: WANT_NCURSES_UI=no
                    219: WANT_DGA=no
                    220: WANT_VIDMODE=no
                    221: SYSTEM_IS_ELF=dunno
                    222: 
                    223: AC_ARG_ENABLE(profiling,[  --enable-profiling      Build a profiling (SLOW!) version],[DO_PROFILING=$enableval],[])
                    224: AC_ARG_WITH(svgalib,[  --with-svgalib          Use SVGAlib for graphics output],[WANT_SVGALIB=$withval],[])
                    225: AC_ARG_WITH(ggi,[  --with-ggi              Use GGI for graphics output],[WANT_GGI=$withval],[])
                    226: AC_ARG_WITH(asciiart,[  --with-asciiart         Use ncurses ascii art for graphics output],[WANT_ASCIIART=$withval],[])
                    227: AC_ARG_ENABLE(dga,[  --enable-dga            X11 version: Use the DGA extension],[WANT_DGA=$enableval],[])
                    228: AC_ARG_ENABLE(vidmode,[  --enable-vidmode        X11 version: Use the XF86VidMode extension],[WANT_VIDMODE=$enableval],[])
                    229: AC_ARG_ENABLE(ui,[  --enable-ui             Use a user interface if possible (default on)],[WANT_UI=$enableval],[])
                    230: AC_ARG_WITH(elf,[  --with-elf              Explicitly state that this system is ELF],[SYSTEM_IS_ELF=$withval],[])
                    231: 
                    232: dnl Some simple plausibility tests...
                    233: 
                    234: if [[ "x$WANT_DGA" = "xyes" ]]; then
                    235:   if [[ "x$WANT_SVGALIB" = "xyes" -o "x$WANT_GGI" = "xyes" -o "x$WANT_ASCIIART" = "xyes" ]]; then
                    236:     echo "You can't enable DGA for SVGAlib, GGI and ncurses targets!"
                    237:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    238:     WANT_DGA=no
                    239:   fi
                    240: fi
                    241: 
                    242: if [[ "x$WANT_DGA" = "xyes" -a "x$no_x" = "xyes" ]]; then
                    243:   echo "Ignoring --enable-dga, since X was disabled or not found."
                    244:   NR_ERRORS=`expr $NR_ERRORS + 1`
                    245:   WANT_DGA=no
                    246: fi
                    247: 
                    248: if [[ "x$WANT_DGA" = "xno" -a "x$WANT_VIDMODE" = "xyes" ]]; then
                    249:   echo "The XF86VidMode extension can only be used in DGA mode. Disabling it."
                    250:   NR_ERRORS=`expr $NR_ERRORS + 1`
                    251:   WANT_VIDMODE=no
                    252: fi
                    253: 
                    254: dnl Check if we have the libraries needed for the user's selection.
                    255: 
                    256: if [[ "x$WANT_SVGALIB" = "xyes" ]]; then
                    257:   if [[ "x$HAVE_SVGA_LIB" = "xno" ]]; then
                    258:     echo "Could not find libsvga, disabling svgalib support."
                    259:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    260:     WANT_SVGALIB=no
                    261:   else
                    262:     no_x=yes
                    263:   fi
                    264: fi
                    265: 
                    266: if [[ "x$WANT_GGI" = "xyes" ]]; then
                    267:   if [[ "x$HAVE_GGI_LIB" = "xno" ]]; then
                    268:     echo "Could not find libggi, disabling GGI support."
                    269:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    270:     WANT_GGI=no
                    271:   else if [[ "x$WANT_SVGALIB" = "xyes" ]]; then
                    272:     echo "You can't configure for both SVGAlib and GGI. Disabling GGI."
                    273:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    274:     WANT_GGI=no
                    275:   else
                    276:     no_x=yes
                    277:   fi
                    278:   fi
                    279: fi
                    280: 
                    281: if [[ "x$WANT_ASCIIART" = "xyes" ]]; then
                    282:   if [[ "x$HAVE_NCURSES_LIB" = "xno" ]]; then
                    283:     echo "Could not find libncurses, disabling ascii art support."
                    284:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    285:     WANT_ASCIIART=no
                    286:   else if [[ "x$WANT_SVGALIB" = "xyes" -o "x$WANT_GGI" = "xyes" ]]; then
                    287:     echo "You can't configure for both ncurses and another target. Disabling ncurses."
                    288:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    289:     WANT_ASCIIART=no
                    290:   else
                    291:     no_x=yes
                    292:   fi
                    293:   fi
                    294: fi
                    295: 
                    296: dnl If the user wants DGA, see if we have it.
                    297: dnl This must come after we checked for X11.
                    298: 
                    299: if [[ "x$WANT_DGA" = "xyes" ]]; then
                    300:   TMP_SAVE_LIBS=$LIBS
                    301:   LIBS="$X_LIBS $LIBS"
                    302:   AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no, [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
                    303:   LIBS=$TMP_SAVE_LIBS
                    304:   if [[ "x$HAVE_DGA" = "xno" ]]; then
                    305:     echo "Could not find DGA extension, ignoring --enable-dga."
                    306:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    307:     WANT_DGA=no
                    308:   fi
                    309: fi
                    310: 
                    311: if [[ "x$WANT_VIDMODE" = "xyes" ]]; then
                    312:   TMP_SAVE_LIBS=$LIBS
                    313:   LIBS="$X_LIBS $LIBS"
                    314:   AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, HAVE_VIDMODE=yes, HAVE_VIDMODE=no, [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
                    315:   LIBS=$TMP_SAVE_LIBS
                    316:   if [[ "x$HAVE_VIDMODE" = "xno" ]]; then
                    317:     echo "Could not find VidMode extension, ignoring --enable-vidmode."
                    318:     NR_ERRORS=`expr $NR_ERRORS + 1`
                    319:     WANT_VIDMODE=no
                    320:   fi
                    321: fi
                    322: 
                    323: AM_PATH_GTK
                    324: 
                    325: dnl See if we can at least compile SHM support
                    326: 
                    327: SHM_SUPPORT_LINKS=0
1.1.1.6   root      328: if [[ "x$no_x" != "xyes" -a "x$ac_cv_header_sys_ipc_h" = "xyes" -a "x$ac_cv_header_sys_shm_h" = "xyes" ]]; then
1.1.1.4   root      329:   AC_MSG_CHECKING(whether the X11 MIT-SHM extension can be compiled in)
                    330:   TMP_SAVE_CFLAGS=$CFLAGS
                    331:   TMP_SAVE_LIBS=$LIBS
                    332:   CFLAGS="$CFLAGS $X_CFLAGS"
                    333:   LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"
                    334:   AC_TRY_LINK([
                    335: #include "confdefs.h"
                    336: #ifdef HAVE_SYS_TYPES_H
                    337: #include <sys/types.h>
                    338: #endif
                    339: #include <X11/Xlib.h>
                    340: #include <X11/Xutil.h>
                    341: #include <X11/keysym.h>
                    342: #include <X11/cursorfont.h>
                    343: #include <sys/ipc.h>
                    344: #include <sys/shm.h>
                    345: #include <X11/extensions/XShm.h>],[
                    346: static XShmSegmentInfo shminfo;
                    347: static Display *display;
                    348: XShmAttach(display, &shminfo);
                    349: XSync(display,0);
                    350: shmctl(shminfo.shmid, IPC_RMID, 0);
1.1.1.9   root      351: ],
1.1.1.4   root      352: SHM_SUPPORT_LINKS=1
                    353: AC_MSG_RESULT(yes),
                    354: SHM_SUPPORT_LINKS=0
                    355: AC_MSG_RESULT(no))
                    356:   CFLAGS=$TMP_SAVE_CFLAGS
                    357:   LIBS=$TMP_SAVE_LIBS
1.1.1.2   root      358: fi
                    359: 
1.1.1.3   root      360: MATHLIB=-lm
1.1.1.4   root      361: DEBUGOBJS="debug.o"
1.1.1.3   root      362: 
1.1       root      363: AC_MSG_CHECKING(which target to use)
1.1.1.4   root      364: 
1.1.1.6   root      365: if [[ "x$HAVE_DIRECTX" = "xyes" ]]; then
                    366:   AC_MSG_RESULT(Win32/DirectX)
                    367:   MATHLIB=
                    368:   TARGET=win32
                    369:   TARGETDEP=t-win32.h
                    370:   GFXOBJS="osdep/win32.o osdep/win32gui.o osdep/parser.o osdep/keyboard.o osdep/posixemu.o"
                    371:   RESOBJS="osdep/winuae.res"
                    372: else if [[ "x$HAVE_BEOS" = "xyes" ]]; then
1.1.1.4   root      373:   AC_MSG_RESULT(BeOS)
                    374:   MATHLIB=
                    375:   TARGET=beos
                    376:   TARGETDEP=t-beos.h
                    377:   GFXOBJS=osdep/beos.o
                    378:   GUIOBJS=
                    379:   OPTIMIZE_CFLAGS=-O7
                    380: else if [[ "x$HAVE_POS" = "xyes" ]]; then
                    381:   AC_MSG_RESULT(p.OS)
                    382:   TARGET=p_os
                    383:   TARGETDEP=t-pos.h
                    384:   GFXOBJS="osdep/pos-win.o osdep/pos-disk.o osdep/pos-rexx.o"
                    385:   GUIOBJS="osdep/pos-gui.o"
                    386: else if [[ "x$HAVE_AMIGA_LIB" = "xyes" ]]; then
1.1.1.3   root      387:   AC_MSG_RESULT(AmigaOS)
                    388:   TARGET=amigaos
1.1.1.4   root      389:   TARGETDEP=t-amiga.h
                    390:   GFXOBJS="osdep/ami-win.o osdep/ami-disk.o osdep/ami-rexx.o osdep/ami-appw.o"
                    391:   GUIOBJS="osdep/ami-gui.o"
                    392: else if [[ "x$HAVE_NEXT_LIB" = "xyes" ]]; then
1.1.1.3   root      393:   AC_MSG_RESULT(NeXTStep)
                    394:   MATHLIB=
                    395:   TARGET=next
                    396:   GFXOBJS="NeXTwin.o"
1.1.1.4   root      397:   GUIOBJS=
                    398:   TARGETDEP=t-next.h
1.1.1.3   root      399:   LIBRARIES="-sectcreate __ICON __header ../Uae.app/Uae.iconheader -segprot __ICON r r -sectcreate __ICON app ../Uae.app/Uae.tiff -lMedia_s -lNeXT_s"
                    400: else
1.1.1.4   root      401:   dnl Unix system
                    402:   dnl If we don't have X, see what else we have and/or want.
1.1.1.3   root      403: 
1.1.1.4   root      404:   if [[ "x$no_x" = "xyes" ]]; then
                    405:     if [[ "x$WANT_SVGALIB" != "xyes" -a "x$WANT_GGI" != "xyes" -a "x$WANT_ASCIIART" != "xyes" ]]; then
                    406:       if [[ "x$WANT_SVGALIB" != "xno" -a "x$HAVE_SVGA_LIB" = "xyes" ]]; then
                    407:         WANT_SVGALIB=yes
                    408:       else if [[ "x$WANT_GGI" != "xno" -a "x$HAVE_GGI_LIB" = "xyes" ]]; then
                    409:         WANT_GGI=yes
                    410:       else if [[ "x$WANT_ASCIIART" != "xno" -a "x$HAVE_NCURSES_LIB" = "xyes" ]]; then
                    411:         WANT_ASCIIART=yes
                    412:       fi
                    413:       fi
                    414:       fi
1.1.1.3   root      415:     fi
                    416:   fi
                    417: 
1.1.1.4   root      418:   if [[ "x$WANT_GGI" = "xyes" ]]; then
                    419:     AC_MSG_RESULT(GGI)
                    420:     TARGET=ggilib
                    421:     TARGETDEP=t-ggi.h
                    422:     WANT_NCURSES_UI=yes
                    423:     GFXOBJS=ggi.o
                    424:     LIBRARIES="-ldl -lggi"
                    425:     LDFLAGS="-rdynamic $LDFLAGS"
                    426:   else if [[ "x$WANT_SVGALIB" = "xyes" ]]; then
                    427:     AC_MSG_RESULT(SVGAlib)
                    428:     TARGET=svgalib
                    429:     TARGETDEP=t-svgalib.h
                    430:     GFXOBJS=svga.o
                    431:     LIBRARIES="-lvga"
                    432:     WANT_NCURSES_UI=yes
                    433:   else if [[ "x$WANT_ASCIIART" = "xyes" ]]; then
                    434:     AC_MSG_RESULT(ncurses ASCII art)
                    435:     TARGET=asciiart
                    436:     TARGETDEP=t-ascii.h
                    437:     GFXOBJS="ncurses.o"
                    438:     GUIOBJS="tui.o svgancui.o"
                    439:     LIBRARIES="-lncurses"
                    440:   else if [[ "x$no_x" = "xyes" ]]; then
                    441:     AC_MSG_RESULT(Ummm....)
                    442:     echo "Fatal error: No graphics system found, don't know what target to use."
                    443:     exit 1
1.1.1.3   root      444:   else
1.1.1.4   root      445:     AC_MSG_RESULT(X11)
                    446:     TARGET=x11
                    447:     TARGETDEP=t-x11.h
                    448:     GFXOBJS=xwin.o
                    449:     GUIOBJS=nogui.o
                    450: 
                    451:     LIBRARIES="$X_LIBS $X_PRE_LIBS"
                    452:     dnl If we still think we want DGA, set it up.
                    453:     if [[ "x$WANT_DGA" = "xyes" ]]; then
                    454:       LIBRARIES="$LIBRARIES -lXxf86dga"
                    455:       X_CFLAGS="$X_CFLAGS -DUSE_DGA_EXTENSION"
                    456:       if [[ "x$WANT_VIDMODE" = "xyes" ]]; then
                    457:         LIBRARIES="$LIBRARIES -lXxf86vm"
                    458:        X_CFLAGS="$X_CFLAGS -DUSE_VIDMODE_EXTENSION"
                    459:       fi
                    460:     fi
                    461:     LIBRARIES="$LIBRARIES -lXext -lX11 $X_EXTRA_LIBS"
1.1.1.3   root      462: 
1.1.1.4   root      463:     if [[ "x$WANT_UI" != "xno" ]]; then
                    464:       if [[ "x$no_gtk" = "xyes" ]]; then
                    465:        echo "Did not find gtk+, disabling user interface"
                    466:        GTK_CFLAGS=
                    467:        GTK_LIBS=
                    468:        if [[ "x$WANT_UI" = "xyes" ]]; then
                    469:          NR_ERRORS=`expr $NR_ERRORS + 1`
                    470:        fi
1.1       root      471:       else
1.1.1.4   root      472:         echo "Using gtk+ GUI."
                    473:        NEED_THREAD_SUPPORT=yes
                    474:        ADDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DUSING_GTK_GUI"
                    475:        GUIOBJS=gtkui.o
1.1       root      476:       fi
                    477:     fi
1.1.1.4   root      478:   fi
                    479:   fi
                    480:   fi
1.1       root      481:   fi
                    482: fi
1.1.1.3   root      483: fi
                    484: fi
                    485: fi
1.1.1.6   root      486: fi
1.1       root      487: 
1.1.1.4   root      488: if [[ "x$WANT_NCURSES_UI" = "xyes" ]]; then
                    489:   if [[ "x$HAVE_NCURSES_LIB" = "xno" ]]; then
                    490:     if [[ "x$WANT_UI" = "xyes" ]]; then
                    491:       echo "ncurses is unavailable, can't provide a user interface"
                    492:       NR_ERRORS=`expr $NR_ERRORS + 1`      
                    493:     fi
                    494:     WANT_UI=no
                    495:   fi
                    496:   if [[ "x$WANT_UI" != "xno" ]]; then
                    497:     GUIOBJS="tui.o svgancui.o"
                    498:     LIBRARIES="$LIBRARIES -lncurses"
                    499:     ADDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DUSING_CURSES_UI"
                    500:     if [[ "x$ac_cv_header_ncurses_h" = "xno" ]]; then
                    501:       echo "Found libncurses, but no ncurses.h. This is normal with recent versions"
                    502:       echo "of ncurses, but it might indicate a problem with older versions."
                    503:       NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    504:     fi
                    505:   else
                    506:     GUIOBJS=nogui.o
                    507:   fi
1.1.1.3   root      508: fi
                    509:  
1.1.1.4   root      510: GFXOBJS="$GFXOBJS $GUIOBJS"
                    511:  
1.1.1.3   root      512: dnl Find out some things about the system 
                    513: dnl  - whether we have GCC 2.7 or better.
                    514: dnl  - what CPU we have (to use some assembly hacks on the x86)
                    515: dnl  - whether we are on a Linux system
1.1.1.4   root      516: dnl  - whether that is an ELF system
                    517: dnl  - whether it's running glibc-2.0
                    518: 
                    519: MACHDEP=md-generic
                    520: OSDEP=od-generic
                    521: THREADDEP=td-none
                    522: SOUNDDEP=od-generic
                    523: 
1.1.1.11  root      524: FPP_H=fpp-unknown.h
1.1.1.4   root      525: USE_THREADS=no
                    526: USE_FILE_SOUND=no
1.1.1.10  root      527: USE_SCSI_DEVICE=no
1.1.1.4   root      528: 
1.1.1.6   root      529: USE_UNDERSCORE=dunno
                    530: 
1.1.1.4   root      531: HAVELINUX=no
1.1.1.6   root      532: HAVEBSD=no
1.1.1.4   root      533: HAVEGCC27=no
1.1.1.6   root      534: HAVEGAS=no
1.1.1.4   root      535: HAVEI386=no
                    536: HAVE68K=no
1.1.1.11  root      537: HAVEPPC=no
1.1.1.4   root      538: HAVEGLIBC2=no
1.1.1.3   root      539: 
1.1       root      540: ASMOBJS=
1.1.1.4   root      541: CPUOBJS=cpuemu.o
1.1.1.3   root      542: 
1.1.1.4   root      543: AC_MSG_CHECKING(for GCC 2.7 or higher)
1.1.1.6   root      544: AC_EGREP_CPP(yes,
                    545: [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
                    546:   yes
1.1.1.3   root      547: #endif
1.1.1.6   root      548: ], [AC_MSG_RESULT(yes); HAVEGCC27=yes], AC_MSG_RESULT(no))
1.1.1.3   root      549: 
1.1.1.6   root      550: if test $ac_cv_prog_gcc = yes; then
                    551:   if test $HAVEGCC27 != yes; then
1.1.1.3   root      552:     echo "I suggest you upgrade to at least version 2.7 of GCC"
1.1.1.6   root      553:   fi
                    554: else
                    555:   if test $uae_cv_prog_cc_watcom != yes; then
1.1.1.3   root      556:     echo "Couldn't find GCC. UAE may or may not compile and run correctly."
1.1.1.4   root      557:     NR_WARNINGS=`expr $NR_WARNINGS + 1`
1.1.1.3   root      558:   fi
                    559: fi
                    560: 
1.1.1.4   root      561: if [[ "x$ac_cv_header_features_h" = "xyes" ]]; then
1.1.1.6   root      562:   AC_MSG_CHECKING(for glibc-2.0 or higher)
                    563:   AC_EGREP_CPP(yes,
                    564: [#include <features.h>
                    565: #if __GLIBC__ - 1 >= 1
                    566:   yes
1.1.1.4   root      567: #endif
1.1.1.6   root      568: ], [AC_MSG_RESULT(yes); HAVEGLIBC2=yes], AC_MSG_RESULT(no))
1.1.1.4   root      569: fi
                    570: 
1.1.1.6   root      571: if test $ac_cv_prog_gcc = yes; then
1.1.1.4   root      572:   WARNING_CFLAGS="-Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes"
                    573:   OPTIMIZE_CFLAGS="-O2 -fomit-frame-pointer"
                    574:   dnl Not nice, but needed to turn off -g
                    575:   CFLAGS=
                    576: fi
                    577: 
                    578: if [[ "x$DO_PROFILING" = "xyes" ]]; then
                    579:   if [[ "x$CC" = "xgcc" ]]; then
                    580:     OPTIMIZE_CFLAGS="-O"
                    581:     DEBUG_CFLAGS="-g -fno-inline -fno-omit-frame-pointer -pg -DUSE_PROFILING"
                    582:     LDFLAGS="-pg"
                    583:   else
                    584:     DO_PROFILING=no
                    585:     echo "Don't know how to set up profiling for your compiler."
                    586:     NR_ERRORS=`expr $NR_ERRORS + 1`
1.1.1.3   root      587:   fi
                    588: fi
                    589: 
1.1.1.4   root      590: CFLAGS="$OPTIMIZE_CFLAGS $DEBUG_CFLAGS $WARNING_CFLAGS $CFLAGS $ADDITIONAL_CFLAGS"
                    591: 
                    592: if [[ "x$HAVEGCC27" = "xyes" ]]; then
1.1.1.3   root      593:   CFLAGS="$CFLAGS -DGCCCONSTFUNC=\"__attribute__((const))\""
                    594: else
                    595:   CFLAGS="$CFLAGS -DGCCCONSTFUNC="
                    596: fi
                    597: 
1.1.1.6   root      598: AC_MSG_CHECKING(for x86 target CPU)
                    599: AC_EGREP_CPP(yes,
                    600: [
1.1.1.3   root      601: #ifdef __i386__
1.1.1.6   root      602:   yes
1.1.1.3   root      603: #endif
1.1.1.6   root      604: ], [AC_MSG_RESULT(yes); HAVEI386=yes], AC_MSG_RESULT(no))
1.1.1.3   root      605: 
1.1.1.6   root      606: AC_MSG_CHECKING(for m68k target CPU)
                    607: AC_EGREP_CPP(yes,
                    608: [
                    609: #ifdef __m68k__
                    610:   yes
                    611: #endif
1.1.1.7   root      612: ], [AC_MSG_RESULT(yes); HAVE68K=yes], AC_MSG_RESULT(no))
1.1       root      613: 
1.1.1.11  root      614: AC_MSG_CHECKING(for ppc target CPU)
                    615: AC_EGREP_CPP(yes,
                    616: [
                    617: #ifdef __powerpc__
                    618:   yes
                    619: #endif
                    620: ], [AC_MSG_RESULT(yes); HAVEPPC=yes], AC_MSG_RESULT(no))
                    621: 
1.1.1.4   root      622: if MACHINE=`uname -a 2>/dev/null`; then
                    623:   case "$MACHINE" in
                    624:   Linux*)
                    625:     HAVELINUX=yes
                    626:     ;;
                    627:   esac
                    628: fi
                    629: 
                    630: dnl X86.S needs to know whether it needs to add underscores to symbols.
                    631: dnl This might break some obscure systems which don't have ELF but don't
                    632: dnl add underscores either.
1.1       root      633: 
1.1.1.6   root      634: AC_MSG_CHECKING(for GAS .p2align feature)
                    635: cat >conftest.S << EOF
                    636:        .text
                    637:        .p2align 5
1.1       root      638: EOF
1.1.1.6   root      639: if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVEGAS=yes; fi
                    640: AC_MSG_RESULT($HAVEGAS)
1.1.1.4   root      641: 
1.1.1.6   root      642: AC_MSG_CHECKING(whether assembler symbols need an underscore)
                    643: cat >conftest1.S << EOF
                    644:        .text
                    645:        .globl _symbol
                    646: _symbol:
                    647: EOF
                    648: cat >conftest2.c << EOF
                    649: extern void symbol ();
                    650: int main ()
                    651: {
                    652: symbol ();
                    653: }
                    654: EOF
                    655: $CC conftest1.S -c -o conftest1.o >/dev/null 2>&1
                    656: $CC conftest2.c -c -o conftest2.o >/dev/null 2>&1
                    657: if $CC conftest1.o conftest2.o -o conftest >/dev/null 2>&1; then
                    658:   USE_UNDERSCORE=yes
                    659:   CFLAGS="$CFLAGS -DUSE_UNDERSCORE"
1.1.1.4   root      660: else
1.1.1.6   root      661:   USE_UNDERSCORE=no
1.1.1.4   root      662: fi
1.1.1.6   root      663: AC_MSG_RESULT($USE_UNDERSCORE)
1.1.1.4   root      664: 
                    665: rm -f conftest*
                    666: 
1.1.1.10  root      667: AC_ARG_ENABLE(threads,[  --enable-threads        Enable some generally useful thread support],[USE_THREADS=$enableval],[])
1.1.1.4   root      668: 
                    669: if [[ "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
1.1.1.12! root      670:   if [[ "x$USE_THREADS" != "xyes" ]]; then
1.1.1.4   root      671:     echo "The gtk+ GUI needs threads; enabling thread support."
                    672:   fi
                    673: fi
                    674: 
1.1.1.12! root      675: if [[ "x$USE_THREADS" = "xyes" -o "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
1.1.1.4   root      676:   if [[ "x$HAVE_PTHREAD_LIB" = "xyes" ]]; then
                    677:     THREADDEP=td-posix
                    678:     CFLAGS="$CFLAGS -DSUPPORT_THREADS -D_REENTRANT"
                    679:     LIBS="$LIBS -lpthread"
                    680:     if [[ "x$HAVE_POSIX4_LIB" = "xyes" ]]; then
                    681:       LIBS="$LIBS -lposix4"
                    682:     fi
                    683: 
                    684:     if [[ "x$USE_THREADS" = "xyes" ]]; then    
                    685:       CFLAGS="$CFLAGS -DUAE_FILESYS_THREADS"
                    686:     fi
                    687: 
                    688:     if [[ "x$HAVELINUX" = "xno" -o "x$HAVEGLIBC2" = "xno" ]]; then
1.1.1.6   root      689:       echo "Thread support has only been tested on Linux systems with glibc-2.0"
1.1.1.4   root      690:       NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    691:     fi
                    692:     if [[ "x$TARGET" = "xsvgalib" ]]; then
                    693:       echo "If you didn't compile a fixed version of SVGAlib then thread support"
                    694:       echo "in UAE will lock your machine real hard."
                    695:       NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    696:     fi
1.1       root      697:   else
1.1.1.4   root      698:     echo "You tried to enable threads, but I couldn't find a thread library!"
                    699:     NR_ERRORS=`expr $NR_ERRORS + 1`
1.1       root      700:   fi
1.1.1.3   root      701: fi
                    702: 
1.1.1.4   root      703: dnl See if we have something better than GCC 2.7.
                    704: 
                    705: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    706:   SAVECFLAGS=$CFLAGS
                    707:   CFLAGS="$CFLAGS -mno-schedule-prologue"
                    708:   AC_TRY_COMPILE(,int main(){return 0;}, NO_SCHED_CFLAGS="-mno-schedule-prologue")
                    709:   CFLAGS=$SAVECFLAGS
                    710: fi
                    711: 
1.1.1.10  root      712: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    713:   SAVECFLAGS=$CFLAGS
                    714:   CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
                    715:   AC_TRY_COMPILE(,int main(){return 0;}, SAVECFLAGS=$CFLAGS)
                    716:   CFLAGS=$SAVECFLAGS
                    717: fi
                    718: 
1.1.1.4   root      719: dnl If GCC supports exceptions, we don't want them.
                    720: 
                    721: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    722:   SAVECFLAGS=$CFLAGS
                    723:   CFLAGS="$CFLAGS -fno-exceptions"
                    724:   NOEXCEPTIONS=no
                    725:   AC_TRY_COMPILE(,int main(){return 0;}, NOEXCEPTIONS=yes)
                    726:   if [[ "x$NOEXCEPTIONS" = "xno" ]]; then
                    727:     CFLAGS=$SAVECFLAGS
                    728:   fi
                    729: fi
                    730: 
                    731: 
1.1.1.3   root      732: dnl Set up the link to the appropriate machdep directory and select something
                    733: dnl for the REGPARAM define.
                    734: 
1.1.1.4   root      735: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
                    736:   MACHDEP=md-i386-gcc
                    737:   dnl strength-reduce is turned off not because of paranoia, but because it
                    738:   dnl actually makes the code worse in some cases on the i386 (generates too
                    739:   dnl many registers, which all end up on the stack).
1.1.1.6   root      740:   CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
                    741: 
                    742:   if [[ "x$HAVEGAS" = "xyes" ]]; then
                    743:     CFLAGS="$CFLAGS -DX86_ASSEMBLY"
                    744:     ASMOBJS=md-X86.o
                    745: 
                    746:     CPUOBJS=cpufast.o
                    747:   fi
                    748: else if test $uae_cv_prog_cc_watcom = yes; then
                    749:   MACHDEP=md-i386-watcom
                    750:   echo CFLAGS before: $CFLAGS
                    751:   CFLAGS=`echo $CFLAGS | sed 's, -g , ,' |sed 's,^-g ,,'`
                    752:   CFLAGS="$CFLAGS --/--bm --/--mf --/--w4 --/--s --/--ei --/--zp4 --/--5r"
                    753:   CFLAGS="$CFLAGS --/--oe=50 --/--oi --/--ok --/--ol --/--ot --/--oh --/--or --/--zq"
                    754:   CFLAGS="$CFLAGS -DREGPARAM= -DUNALIGNED_PROFITABLE"
                    755:   echo CFLAGS after:  $CFLAGS
1.1.1.11  root      756: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEPPC" = "xyes" ]]; then
                    757:   MACHDEP=md-ppc-gcc
                    758:   CFLAGS="$CFLAGS -DREGPARAM="
                    759:   if [[ "x$HAVE_MOTO_LIB" = "xyes" ]]; then
                    760:     MATHLIB="-lmoto $MATHLIB"
                    761:   fi
1.1.1.4   root      762: else if [[ "x$TARGET" = "xp_os" ]]; then
                    763:   CPU=`uname -m`
                    764:   if [[ "x$CPU" = "xm68k" ]]; then
                    765:      MACHDEP=md-68k
1.1.1.7   root      766:      CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
1.1.1.4   root      767:   else if [[ "x$CPU" = "xppc" ]]; then
                    768:      MACHDEP=md-ppc
                    769:      CFLAGS="$CFLAGS -DREGPARAM="
                    770:   else if [[ "x$CPU" = "xi386" ]]; then
                    771:      dnl Sam, I don't think we can get here.
                    772:      MACHDEP=md-i386-gcc
                    773:      CFLAGS="$CFLAGS -DX86_ASSEMBLY -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
                    774:   else
                    775:      echo "Unsupported CPU: $CPU!"
                    776:      exit 5
                    777:   fi
                    778:   fi
                    779:   fi
                    780:   CFLAGS="$CFLAGS -nostdinc -I/gg/include -I/p/../inc -D__POS__"
                    781:   OSDEP=od-pos
                    782:   CPUOBJS="cpufast.o"
1.1.1.7   root      783: else if [[ "x$TARGET" = "xamigaos" ]]; then
1.1.1.4   root      784:   OSDEP=od-amiga
1.1.1.7   root      785:   CPU=`uname -m`
                    786:   if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" ]]; then
                    787:     MACHDEP=md-68k
                    788:     CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
                    789:     CPUOBJS="cpufast1.o cpufast2.o cpufast3.o cpufast4.o cpufast5.o cpufast6.o cpufast7.o cpufast8.o"
                    790:   else if [[ "x$HAVEGCC27" = "xyes" -a "x$CPU" = "xppc" ]]; then
                    791:     MACHDEP=md-ppc-gcc
                    792:   else
                    793:     dnl sam: amigaos without gcc
                    794:     CFLAGS="$CFLAGS -O -DREGPARAM="
                    795:     CPUOBJS="cpuemu1.o cpuemu2.o cpuemu3.o cpuemu4.o cpuemu5.o cpuemu6.o cpuemu7.o cpuemu8.o"
                    796:   fi
                    797:   fi
1.1.1.4   root      798: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
                    799:   dnl sam: This is for linux 68k (REGPARAM is not used under linux)
                    800:   MACHDEP=md-68k
                    801:   CFLAGS="$CFLAGS -DM68K_FLAG_OPT=1 -DREGPARAM="
                    802:   CPUOBJS="cpufast.o"
                    803: else if [[ "x$TARGET" = "xbeos" ]]; then
                    804:   MACHDEP=md-ppc
                    805:   CFLAGS="$CFLAGS -DREGPARAM="
                    806:   OSDEP=od-beos
1.1       root      807: else
1.1.1.3   root      808:   CFLAGS="$CFLAGS -DREGPARAM="
                    809: fi
                    810: fi
1.1       root      811: fi
1.1.1.4   root      812: fi
                    813: fi
                    814: fi
1.1.1.11  root      815: fi
1.1       root      816: 
1.1.1.6   root      817: if [[ "x$TARGET" = "xwin32" ]]; then
                    818:   OSDEP=od-win32
                    819:   if test $ac_cv_prog_gcc = yes; then
                    820:     LIBS="$LIBS -lddraw -lwinmm -lcomctl32 -lcomdlg32 -luser32 -lgdi32 -lkernel32 -ladvapi32 -lshell32"
                    821:   else if test $uae_cv_prog_cc_watcom = yes; then
                    822:     LIBS="$LIBS -lddraw -lwinmm -lcomctl32"
                    823:   fi
                    824:   fi
                    825: else if [[ "x$HAVELINUX" = "xyes" ]]; then
1.1.1.4   root      826:   OSDEP=od-linux
                    827:   if [[ "x$HAVEGLIBC2" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    828:     CFLAGS="$CFLAGS -DHAVE_GLIBC_2_LINUX"
                    829:   fi
1.1.1.2   root      830: fi
1.1.1.6   root      831: fi
1.1.1.2   root      832: 
1.1.1.4   root      833: if [[ "x$TARGET" = "xx11" -o "x$TARGET" = "xsvgalib" -o "x$TARGET" = "xamigaos" \
                    834:      -o "x$TARGET" = "xbeos" -o "x$TARGET" = "xasciiart" -o "x$TARGET" = "xggilib" -o "x$TARGET" = "xp_os" ]]; then
                    835:   dnl On Unix, BeOS and AmigaOS system, zfile is supposed to work. Dunno about others.
1.1.1.3   root      836:   CFLAGS="$CFLAGS -DUSE_ZFILE"
1.1.1.4   root      837: fi
                    838: 
                    839: HAVE_USS_SOUND=no
                    840: if [[ "x$ac_cv_header_sys_soundcard_h" = "xyes" -o "x$ac_cv_header_machine_soundcard_h" = "xyes" ]]; then
                    841:   dnl Avoid surprises
                    842:   AC_MSG_CHECKING(whether sys/soundcard.h or machine/soundcard.h works)
                    843:   AC_TRY_COMPILE([
                    844: #include "confdefs.h"
                    845: #ifdef HAVE_SYS_SOUNDCARD_H
                    846: #include <sys/soundcard.h>
                    847: #else
                    848: #include <machine/soundcard.h>
                    849: #endif
                    850: #include <sys/ioctl.h>
                    851: ],
                    852: [int soundfd; ioctl (soundfd, SNDCTL_DSP_GETFMTS, 0);],
                    853: AC_MSG_RESULT(yes)
                    854: HAVE_USS_SOUND=yes,
                    855: AC_MSG_RESULT(no))
                    856: fi
                    857: 
1.1.1.8   root      858: if [[ "x$ac_cv_header_dmedia_audio.h" = "xno" ]]; then
                    859:   HAVE_SGIAUDIO_LIB=no
                    860: fi
                    861: 
1.1.1.4   root      862: AC_MSG_CHECKING(which sound system to use)
1.1.1.10  root      863: AC_ARG_ENABLE(file-sound,[  --enable-file-sound     Enable sound output to file],[USE_FILE_SOUND=$enableval],[])
1.1.1.4   root      864: 
                    865: if [[ "x$USE_FILE_SOUND" = "xyes" ]]; then
1.1.1.7   root      866:   AC_MSG_RESULT(file output)
                    867:   SOUNDDEP=sd-file
                    868:   USE_SOUND=yes  
                    869: else if [[ "x$HAVE_USS_SOUND" = "xyes" ]]; then
                    870:   AC_MSG_RESULT(USS)
                    871:   SOUNDDEP=sd-uss
1.1.1.4   root      872:   USE_SOUND=yes
1.1.1.7   root      873: else if [[ "x$ac_cv_header_sys_audioio_h" = "xyes" -o "x$ac_cv_header_sun_audioio_h" = "xyes" ]]; then
                    874:   AC_MSG_RESULT(Solaris/NetBSD)
                    875:   SOUNDDEP=sd-solaris
                    876:   USE_SOUND=yes
                    877: else if [[ "x$HAVE_AF_LIB" = "xyes" ]]; then
                    878:   AC_MSG_RESULT(AF sound)
                    879:   SOUNDDEP=sd-af
                    880:   LIBS="$LIBS -lAF"
                    881:   USE_SOUND=yes
1.1.1.8   root      882: else if [[ "x$HAVE_SGIAUDIO_LIB" = "xyes" ]]; then
                    883:   AC_MSG_RESULT(SGI sound)
                    884:   SOUNDDEP=sd-sgi
                    885:   LIBS="$LIBS -laudio"
                    886:   USE_SOUND=yes
1.1.1.7   root      887: else if [[ "x$HAVE_MME_LIB" = "xyes" ]]; then
                    888:   AC_MSG_RESULT(MME sound)
                    889:   SOUNDDEP=sd-mme
                    890:   LIBS="$LIBS -lmme"
                    891:   USE_SOUND=yes
                    892: else if [[ "x$TARGET" = "xp_os" ]]; then
                    893:   AC_MSG_RESULT(pAudio.device)
                    894:   SOUNDDEP=od-pos
                    895:   USE_SOUND=yes
                    896: else if [[ "x$TARGET" = "xamigaos" ]]; then
                    897:   if [[ "x$ac_cv_header_devices_ahi_h" = "xyes" ]]; then
                    898:     AC_MSG_RESULT(Amiga AHI.device)
1.1.1.4   root      899:   else
1.1.1.7   root      900:     AC_MSG_RESULT(Amiga audio.device)
1.1.1.6   root      901:   fi
1.1.1.7   root      902:   SOUNDDEP=od-amiga
                    903:   USE_SOUND=yes
                    904: else if [[ "x$TARGET" = "xbeos" ]]; then
                    905:   AC_MSG_RESULT(BeOS sound)
                    906:   SOUNDDEP=od-beos
                    907:   USE_SOUND=yes
                    908: else if [[ "x$TARGET" = "xwin32" ]]; then
                    909:   AC_MSG_RESULT(Win32 sound)
                    910:   SOUNDDEP=od-win32
                    911:   USE_SOUND=yes
                    912: else
                    913:   echo "no known sound system found"
                    914:   NR_ERRORS=`expr $NR_ERRORS + 1`
                    915: fi
                    916: fi
                    917: fi
                    918: fi
1.1.1.4   root      919: fi
1.1.1.7   root      920: fi
                    921: fi
                    922: fi
                    923: fi
1.1.1.8   root      924: fi
1.1.1.7   root      925: 
1.1.1.10  root      926: SCSIOBJS=scsi-none.o
                    927: SCSIDEP=scg-none
                    928: AC_ARG_ENABLE(scsi-device,[  --enable-scsi-device   Disable the uaescsi.device],[USE_SCSI_DEVICE=$enableval],[])
                    929: 
                    930: dnl @@@ Patrick - I hope no system other than Linux has "scsi/sg.h" !
                    931: if [[ "x$USE_SCSI_DEVICE" = "xyes" ]]; then
                    932:   AC_MSG_CHECKING(which scsi system to use)
                    933:   if [[ "x$ac_cv_header_scsi_sg_h" = "xyes" ]]; then
                    934:     AC_MSG_RESULT(Linux SG)
                    935:     SCSIOBJS=scsidev.o
                    936:     SCSIDEP=scg-linux-sg
                    937:   else
                    938:     AC_MSG_RESULT(SCSI not supported for this system)
                    939:   fi
                    940: fi
                    941: 
                    942: dnl Special case hack for BSD: try to use the Linux joystick.c.
                    943: 
                    944: if [[ "x$HAVE_MACHINE_JOYSTICK_H" = "xyes" ]]; then
                    945:   AC_TRY_COMPILE([#include <machine/joystick.h>],[{ struct joystick a; }],
                    946:     OD_JOYSTICK=od-linux/joystick.c,)
                    947: else
                    948:     OD_JOYSTICK=$OSDEP/joystick.c
                    949: fi
1.1.1.4   root      950: 
                    951: rm -f src/machdep
                    952: rm -f src/osdep
                    953: rm -f src/threaddep
                    954: rm -f src/sounddep
1.1.1.10  root      955: rm -f src/scsidep
1.1.1.4   root      956: rm -f src/target.h
1.1.1.5   root      957: rm -f src/config.h
1.1.1.6   root      958: rm -f src/sd-sound.c
                    959: rm -f src/od-joy.c
                    960: rm -f src/md-support.c
                    961: rm -f src/md-X86.S
1.1.1.10  root      962: rm -f src/scsi-support.c
1.1.1.3   root      963: 
1.1.1.4   root      964: if [[ "x$TARGET" = "xamigaos" -o "x$TARGET" = "xp_os" ]]; then
1.1.1.3   root      965:   dnl Determine the cpu-type
                    966:   AC_MSG_CHECKING(which CPU to use)
                    967:   cpu=`cpu | cut -d' ' -f2`
                    968:   AC_MSG_RESULT($cpu)
                    969:   CFLAGS="$CFLAGS -m$cpu"
                    970: 
                    971:   dnl Is that correct for the fpu ?
                    972:   AC_MSG_CHECKING(which FPU to use)
1.1.1.4   root      973:   fpu=`cpu | cut -d' ' -f3 | grep '^6888[12]$'`
                    974:   if [[ "x$fpu" != "x" ]]; then
                    975:     dnl gcc only knows about 68881
                    976:     AC_MSG_RESULT(68881)
                    977:     CFLAGS="$CFLAGS -m68881"
1.1.1.3   root      978:   else
                    979:     AC_MSG_RESULT(none)
                    980:   fi
                    981: fi
1.1.1.4   root      982: 
1.1       root      983: AC_SUBST(ac_cv_c_inline)
1.1.1.6   root      984: AC_SUBST(WRC)
1.1.1.4   root      985: AC_SUBST(NO_SCHED_CFLAGS)
1.1       root      986: AC_SUBST(LIBRARIES)
                    987: AC_SUBST(TARGET)
                    988: AC_SUBST(GFXOBJS)
1.1.1.6   root      989: AC_SUBST(RESOBJS)
1.1       root      990: AC_SUBST(ASMOBJS)
1.1.1.10  root      991: AC_SUBST(SCSIOBJS)
1.1.1.2   root      992: AC_SUBST(CPUOBJS)
1.1.1.3   root      993: AC_SUBST(DEBUGOBJS)
1.1.1.2   root      994: AC_SUBST(SET_MAKE)
1.1.1.3   root      995: AC_SUBST(MATHLIB)
1.1.1.4   root      996: AC_SUBST(SHM_SUPPORT_LINKS)
                    997: 
1.1.1.3   root      998: AC_SUBST(top_srcdir)
1.1       root      999: 
1.1.1.2   root     1000: AC_OUTPUT(src/Makefile Makefile)
1.1.1.4   root     1001: if [[ "x$DO_PROFILING" = "xyes" ]]; then
1.1.1.3   root     1002:   echo "Building a profiling version of UAE (select this option only if you know"
                   1003:   echo "what you are doing)"
                   1004: fi
1.1.1.4   root     1005: 
                   1006: dnl Create some more links and files.
                   1007: 
                   1008: dnl We removed those from the build directory above, so if the source
                   1009: dnl directory still has them, something is fairly wrong.
                   1010: 
                   1011: dnl This doesn't work with Solaris /bin/sh, neither do all the alternatives I
1.1.1.6   root     1012: dnl tried. It doesn't seem to cause a failure either, though.
1.1.1.4   root     1013: 
1.1.1.10  root     1014: if test -f $abssrcdir/src/target.h
1.1.1.6   root     1015: then
                   1016:   echo
                   1017:   echo "Fatal error: Can't configure in the current directory, because"
                   1018:   echo "configure was run in the source directory. Go to the source"
                   1019:   echo "directory, type"
                   1020:   echo "  make streifenfrei"
                   1021:   echo "and try again."
                   1022:   exit 1
                   1023: fi
1.1.1.4   root     1024: 
                   1025: ln -s $abssrcdir/src/$MACHDEP src/machdep
                   1026: ln -s $abssrcdir/src/$OSDEP src/osdep
                   1027: ln -s $abssrcdir/src/$THREADDEP src/threaddep
                   1028: ln -s $abssrcdir/src/$SOUNDDEP src/sounddep
                   1029: 
1.1.1.10  root     1030: echo "#include \"$abssrcdir/src/targets/$TARGETDEP\"" > src/target.h
                   1031: echo "#include \"$abssrcdir/config.h\"" > src/config.h
1.1.1.6   root     1032: 
1.1.1.10  root     1033: echo "#include \"$abssrcdir/src/$SOUNDDEP/sound.c\"" >src/sd-sound.c
                   1034: echo "#include \"$abssrcdir/src/$OD_JOYSTICK\"" >src/od-joy.c
                   1035: echo "#include \"$abssrcdir/src/$MACHDEP/support.c\"" >src/md-support.c
                   1036: 
                   1037: if [[ "x$SCSIDEP" != "xscg-none" ]]; then 
                   1038:   echo "#include \"$abssrcdir/src/$SCSIDEP/scsi.h\"" >src/scsi-support.c
                   1039:   echo "#include \"$abssrcdir/src/$SCSIDEP/scsi.c\"" >>src/scsi-support.c
                   1040: fi
1.1.1.6   root     1041: if [[ "x$MACHDEP" = "xmd-i386-gcc" ]]; then
1.1.1.10  root     1042:   echo "#include \"machdep/X86.S\"" >src/md-X86.S
1.1.1.6   root     1043: fi
1.1.1.11  root     1044: echo "#include \"$abssrcdir/src/include/$FPP_H\"" >src/md-fpp.h
1.1.1.6   root     1045: 
                   1046: 
1.1.1.4   root     1047: echo
                   1048: echo
                   1049: if [[ "x$NR_ERRORS" = "x0" ]]; then
                   1050:   if [[ "x$NR_WARNINGS" = "x0" ]]; then
                   1051:     echo "Configuration was successful!"
                   1052:   else
                   1053:     echo "There were $NR_WARNINGS warnings. That is usually harmless, but read the output"
                   1054:     echo "from configure carefully if you run into problems."
                   1055:   fi
                   1056: else
                   1057:   echo "There were $NR_ERRORS errors. UAE may still build and run cleanly, but you may"
                   1058:   echo "not get all the features you asked for."
                   1059: fi
                   1060: echo

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.