Annotation of uae/configure.in, revision 1.1.1.11

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.6   root      524: P2C=p2c.o
1.1.1.11! root      525: FPP_H=fpp-unknown.h
1.1.1.4   root      526: USE_PENGUINS=no
                    527: USE_THREADS=no
                    528: USE_FILE_SOUND=no
1.1.1.10  root      529: USE_SCSI_DEVICE=no
1.1.1.4   root      530: 
1.1.1.6   root      531: USE_UNDERSCORE=dunno
                    532: 
1.1.1.4   root      533: HAVELINUX=no
1.1.1.6   root      534: HAVEBSD=no
1.1.1.4   root      535: HAVEGCC27=no
1.1.1.6   root      536: HAVEGAS=no
1.1.1.4   root      537: HAVEI386=no
                    538: HAVE68K=no
1.1.1.11! root      539: HAVEPPC=no
1.1.1.4   root      540: HAVEGLIBC2=no
1.1.1.3   root      541: 
1.1       root      542: ASMOBJS=
1.1.1.4   root      543: CPUOBJS=cpuemu.o
1.1.1.3   root      544: 
1.1.1.4   root      545: AC_MSG_CHECKING(for GCC 2.7 or higher)
1.1.1.6   root      546: AC_EGREP_CPP(yes,
                    547: [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
                    548:   yes
1.1.1.3   root      549: #endif
1.1.1.6   root      550: ], [AC_MSG_RESULT(yes); HAVEGCC27=yes], AC_MSG_RESULT(no))
1.1.1.3   root      551: 
1.1.1.6   root      552: if test $ac_cv_prog_gcc = yes; then
                    553:   if test $HAVEGCC27 != yes; then
1.1.1.3   root      554:     echo "I suggest you upgrade to at least version 2.7 of GCC"
1.1.1.6   root      555:   fi
                    556: else
                    557:   if test $uae_cv_prog_cc_watcom != yes; then
1.1.1.3   root      558:     echo "Couldn't find GCC. UAE may or may not compile and run correctly."
1.1.1.4   root      559:     NR_WARNINGS=`expr $NR_WARNINGS + 1`
1.1.1.3   root      560:   fi
                    561: fi
                    562: 
1.1.1.4   root      563: if [[ "x$ac_cv_header_features_h" = "xyes" ]]; then
1.1.1.6   root      564:   AC_MSG_CHECKING(for glibc-2.0 or higher)
                    565:   AC_EGREP_CPP(yes,
                    566: [#include <features.h>
                    567: #if __GLIBC__ - 1 >= 1
                    568:   yes
1.1.1.4   root      569: #endif
1.1.1.6   root      570: ], [AC_MSG_RESULT(yes); HAVEGLIBC2=yes], AC_MSG_RESULT(no))
1.1.1.4   root      571: fi
                    572: 
1.1.1.6   root      573: if test $ac_cv_prog_gcc = yes; then
1.1.1.4   root      574:   WARNING_CFLAGS="-Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes"
                    575:   OPTIMIZE_CFLAGS="-O2 -fomit-frame-pointer"
                    576:   dnl Not nice, but needed to turn off -g
                    577:   CFLAGS=
                    578: fi
                    579: 
                    580: if [[ "x$DO_PROFILING" = "xyes" ]]; then
                    581:   if [[ "x$CC" = "xgcc" ]]; then
                    582:     OPTIMIZE_CFLAGS="-O"
                    583:     DEBUG_CFLAGS="-g -fno-inline -fno-omit-frame-pointer -pg -DUSE_PROFILING"
                    584:     LDFLAGS="-pg"
                    585:   else
                    586:     DO_PROFILING=no
                    587:     echo "Don't know how to set up profiling for your compiler."
                    588:     NR_ERRORS=`expr $NR_ERRORS + 1`
1.1.1.3   root      589:   fi
                    590: fi
                    591: 
1.1.1.4   root      592: CFLAGS="$OPTIMIZE_CFLAGS $DEBUG_CFLAGS $WARNING_CFLAGS $CFLAGS $ADDITIONAL_CFLAGS"
                    593: 
                    594: if [[ "x$HAVEGCC27" = "xyes" ]]; then
1.1.1.3   root      595:   CFLAGS="$CFLAGS -DGCCCONSTFUNC=\"__attribute__((const))\""
                    596: else
                    597:   CFLAGS="$CFLAGS -DGCCCONSTFUNC="
                    598: fi
                    599: 
1.1.1.6   root      600: AC_MSG_CHECKING(for x86 target CPU)
                    601: AC_EGREP_CPP(yes,
                    602: [
1.1.1.3   root      603: #ifdef __i386__
1.1.1.6   root      604:   yes
1.1.1.3   root      605: #endif
1.1.1.6   root      606: ], [AC_MSG_RESULT(yes); HAVEI386=yes], AC_MSG_RESULT(no))
1.1.1.3   root      607: 
1.1.1.6   root      608: AC_MSG_CHECKING(for m68k target CPU)
                    609: AC_EGREP_CPP(yes,
                    610: [
                    611: #ifdef __m68k__
                    612:   yes
                    613: #endif
1.1.1.7   root      614: ], [AC_MSG_RESULT(yes); HAVE68K=yes], AC_MSG_RESULT(no))
1.1       root      615: 
1.1.1.11! root      616: AC_MSG_CHECKING(for ppc target CPU)
        !           617: AC_EGREP_CPP(yes,
        !           618: [
        !           619: #ifdef __powerpc__
        !           620:   yes
        !           621: #endif
        !           622: ], [AC_MSG_RESULT(yes); HAVEPPC=yes], AC_MSG_RESULT(no))
        !           623: 
1.1.1.4   root      624: if MACHINE=`uname -a 2>/dev/null`; then
                    625:   case "$MACHINE" in
                    626:   Linux*)
                    627:     HAVELINUX=yes
                    628:     ;;
                    629:   esac
                    630: fi
                    631: 
                    632: dnl X86.S needs to know whether it needs to add underscores to symbols.
                    633: dnl This might break some obscure systems which don't have ELF but don't
                    634: dnl add underscores either.
1.1       root      635: 
1.1.1.6   root      636: AC_MSG_CHECKING(for GAS .p2align feature)
                    637: cat >conftest.S << EOF
                    638:        .text
                    639:        .p2align 5
1.1       root      640: EOF
1.1.1.6   root      641: if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVEGAS=yes; fi
                    642: AC_MSG_RESULT($HAVEGAS)
1.1.1.4   root      643: 
1.1.1.6   root      644: AC_MSG_CHECKING(whether assembler symbols need an underscore)
                    645: cat >conftest1.S << EOF
                    646:        .text
                    647:        .globl _symbol
                    648: _symbol:
                    649: EOF
                    650: cat >conftest2.c << EOF
                    651: extern void symbol ();
                    652: int main ()
                    653: {
                    654: symbol ();
                    655: }
                    656: EOF
                    657: $CC conftest1.S -c -o conftest1.o >/dev/null 2>&1
                    658: $CC conftest2.c -c -o conftest2.o >/dev/null 2>&1
                    659: if $CC conftest1.o conftest2.o -o conftest >/dev/null 2>&1; then
                    660:   USE_UNDERSCORE=yes
                    661:   CFLAGS="$CFLAGS -DUSE_UNDERSCORE"
1.1.1.4   root      662: else
1.1.1.6   root      663:   USE_UNDERSCORE=no
1.1.1.4   root      664: fi
1.1.1.6   root      665: AC_MSG_RESULT($USE_UNDERSCORE)
1.1.1.4   root      666: 
                    667: rm -f conftest*
                    668: 
1.1.1.10  root      669: AC_ARG_ENABLE(threads,[  --enable-threads        Enable some generally useful thread support],[USE_THREADS=$enableval],[])
1.1.1.4   root      670: AC_ARG_ENABLE(penguins,[  --enable-penguins       Enable threads that only make sense on SMP machines],[USE_PENGUINS=$enableval],[])
                    671: 
                    672: if [[ "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
                    673:   if [[ "x$USE_THREADS" != "xyes" -a "x$USE_PENGUINS" != "xyes" ]]; then
                    674:     echo "The gtk+ GUI needs threads; enabling thread support."
                    675:   fi
                    676: fi
                    677: 
                    678: if [[ "x$USE_THREADS" = "xyes" -o "x$USE_PENGUINS" = "xyes" -o "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
                    679:   if [[ "x$HAVE_PTHREAD_LIB" = "xyes" ]]; then
                    680:     THREADDEP=td-posix
                    681:     CFLAGS="$CFLAGS -DSUPPORT_THREADS -D_REENTRANT"
                    682:     LIBS="$LIBS -lpthread"
                    683:     if [[ "x$HAVE_POSIX4_LIB" = "xyes" ]]; then
                    684:       LIBS="$LIBS -lposix4"
                    685:     fi
                    686: 
                    687:     if [[ "x$USE_THREADS" = "xyes" ]]; then    
                    688:       CFLAGS="$CFLAGS -DUAE_FILESYS_THREADS"
                    689:     fi
                    690:     if [[ "x$USE_PENGUINS" = "xyes" ]]; then
                    691:       CFLAGS="$CFLAGS -DSUPPORT_PENGUINS"
                    692:     fi
                    693: 
                    694:     if [[ "x$HAVELINUX" = "xno" -o "x$HAVEGLIBC2" = "xno" ]]; then
1.1.1.6   root      695:       echo "Thread support has only been tested on Linux systems with glibc-2.0"
1.1.1.4   root      696:       NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    697:     fi
                    698:     if [[ "x$TARGET" = "xsvgalib" ]]; then
                    699:       echo "If you didn't compile a fixed version of SVGAlib then thread support"
                    700:       echo "in UAE will lock your machine real hard."
                    701:       NR_WARNINGS=`expr $NR_WARNINGS + 1`
                    702:     fi
1.1       root      703:   else
1.1.1.4   root      704:     echo "You tried to enable threads, but I couldn't find a thread library!"
                    705:     NR_ERRORS=`expr $NR_ERRORS + 1`
1.1       root      706:   fi
1.1.1.3   root      707: fi
                    708: 
1.1.1.4   root      709: dnl See if we have something better than GCC 2.7.
                    710: 
                    711: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    712:   SAVECFLAGS=$CFLAGS
                    713:   CFLAGS="$CFLAGS -mno-schedule-prologue"
                    714:   AC_TRY_COMPILE(,int main(){return 0;}, NO_SCHED_CFLAGS="-mno-schedule-prologue")
                    715:   CFLAGS=$SAVECFLAGS
                    716: fi
                    717: 
1.1.1.10  root      718: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    719:   SAVECFLAGS=$CFLAGS
                    720:   CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
                    721:   AC_TRY_COMPILE(,int main(){return 0;}, SAVECFLAGS=$CFLAGS)
                    722:   CFLAGS=$SAVECFLAGS
                    723: fi
                    724: 
1.1.1.4   root      725: dnl If GCC supports exceptions, we don't want them.
                    726: 
                    727: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    728:   SAVECFLAGS=$CFLAGS
                    729:   CFLAGS="$CFLAGS -fno-exceptions"
                    730:   NOEXCEPTIONS=no
                    731:   AC_TRY_COMPILE(,int main(){return 0;}, NOEXCEPTIONS=yes)
                    732:   if [[ "x$NOEXCEPTIONS" = "xno" ]]; then
                    733:     CFLAGS=$SAVECFLAGS
                    734:   fi
                    735: fi
                    736: 
                    737: 
1.1.1.3   root      738: dnl Set up the link to the appropriate machdep directory and select something
                    739: dnl for the REGPARAM define.
                    740: 
1.1.1.4   root      741: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
                    742:   MACHDEP=md-i386-gcc
                    743:   dnl strength-reduce is turned off not because of paranoia, but because it
                    744:   dnl actually makes the code worse in some cases on the i386 (generates too
                    745:   dnl many registers, which all end up on the stack).
1.1.1.6   root      746:   CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
                    747: 
                    748:   if [[ "x$HAVEGAS" = "xyes" ]]; then
                    749:     CFLAGS="$CFLAGS -DX86_ASSEMBLY"
                    750:     ASMOBJS=md-X86.o
                    751: 
                    752:     CPUOBJS=cpufast.o
                    753:     P2C=p2c_x86.o
                    754:   fi
                    755: else if test $uae_cv_prog_cc_watcom = yes; then
                    756:   MACHDEP=md-i386-watcom
                    757:   echo CFLAGS before: $CFLAGS
                    758:   CFLAGS=`echo $CFLAGS | sed 's, -g , ,' |sed 's,^-g ,,'`
                    759:   CFLAGS="$CFLAGS --/--bm --/--mf --/--w4 --/--s --/--ei --/--zp4 --/--5r"
                    760:   CFLAGS="$CFLAGS --/--oe=50 --/--oi --/--ok --/--ol --/--ot --/--oh --/--or --/--zq"
                    761:   CFLAGS="$CFLAGS -DREGPARAM= -DUNALIGNED_PROFITABLE"
                    762:   echo CFLAGS after:  $CFLAGS
1.1.1.11! root      763: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEPPC" = "xyes" ]]; then
        !           764:   MACHDEP=md-ppc-gcc
        !           765:   CFLAGS="$CFLAGS -DREGPARAM="
        !           766:   if [[ "x$HAVE_MOTO_LIB" = "xyes" ]]; then
        !           767:     MATHLIB="-lmoto $MATHLIB"
        !           768:   fi
1.1.1.4   root      769: else if [[ "x$TARGET" = "xp_os" ]]; then
                    770:   CPU=`uname -m`
                    771:   if [[ "x$CPU" = "xm68k" ]]; then
                    772:      MACHDEP=md-68k
1.1.1.7   root      773:      CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
1.1.1.4   root      774:   else if [[ "x$CPU" = "xppc" ]]; then
                    775:      MACHDEP=md-ppc
                    776:      CFLAGS="$CFLAGS -DREGPARAM="
                    777:   else if [[ "x$CPU" = "xi386" ]]; then
                    778:      dnl Sam, I don't think we can get here.
                    779:      MACHDEP=md-i386-gcc
                    780:      CFLAGS="$CFLAGS -DX86_ASSEMBLY -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
                    781:   else
                    782:      echo "Unsupported CPU: $CPU!"
                    783:      exit 5
                    784:   fi
                    785:   fi
                    786:   fi
                    787:   CFLAGS="$CFLAGS -nostdinc -I/gg/include -I/p/../inc -D__POS__"
                    788:   OSDEP=od-pos
                    789:   CPUOBJS="cpufast.o"
1.1.1.7   root      790: else if [[ "x$TARGET" = "xamigaos" ]]; then
1.1.1.4   root      791:   OSDEP=od-amiga
1.1.1.7   root      792:   CPU=`uname -m`
                    793:   if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" ]]; then
                    794:     MACHDEP=md-68k
                    795:     CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
                    796:     CPUOBJS="cpufast1.o cpufast2.o cpufast3.o cpufast4.o cpufast5.o cpufast6.o cpufast7.o cpufast8.o"
                    797:   else if [[ "x$HAVEGCC27" = "xyes" -a "x$CPU" = "xppc" ]]; then
                    798:     MACHDEP=md-ppc-gcc
                    799:   else
                    800:     dnl sam: amigaos without gcc
                    801:     CFLAGS="$CFLAGS -O -DREGPARAM="
                    802:     CPUOBJS="cpuemu1.o cpuemu2.o cpuemu3.o cpuemu4.o cpuemu5.o cpuemu6.o cpuemu7.o cpuemu8.o"
                    803:   fi
                    804:   fi
1.1.1.4   root      805: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
                    806:   dnl sam: This is for linux 68k (REGPARAM is not used under linux)
                    807:   MACHDEP=md-68k
                    808:   CFLAGS="$CFLAGS -DM68K_FLAG_OPT=1 -DREGPARAM="
                    809:   CPUOBJS="cpufast.o"
                    810: else if [[ "x$TARGET" = "xbeos" ]]; then
                    811:   MACHDEP=md-ppc
                    812:   CFLAGS="$CFLAGS -DREGPARAM="
                    813:   OSDEP=od-beos
1.1       root      814: else
1.1.1.3   root      815:   CFLAGS="$CFLAGS -DREGPARAM="
                    816: fi
                    817: fi
1.1       root      818: fi
1.1.1.4   root      819: fi
                    820: fi
                    821: fi
1.1.1.11! root      822: fi
1.1       root      823: 
1.1.1.6   root      824: if [[ "x$TARGET" = "xwin32" ]]; then
                    825:   OSDEP=od-win32
                    826:   if test $ac_cv_prog_gcc = yes; then
                    827:     LIBS="$LIBS -lddraw -lwinmm -lcomctl32 -lcomdlg32 -luser32 -lgdi32 -lkernel32 -ladvapi32 -lshell32"
                    828:   else if test $uae_cv_prog_cc_watcom = yes; then
                    829:     LIBS="$LIBS -lddraw -lwinmm -lcomctl32"
                    830:   fi
                    831:   fi
                    832: else if [[ "x$HAVELINUX" = "xyes" ]]; then
1.1.1.4   root      833:   OSDEP=od-linux
                    834:   if [[ "x$HAVEGLIBC2" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
                    835:     CFLAGS="$CFLAGS -DHAVE_GLIBC_2_LINUX"
                    836:   fi
1.1.1.2   root      837: fi
1.1.1.6   root      838: fi
1.1.1.2   root      839: 
1.1.1.4   root      840: if [[ "x$TARGET" = "xx11" -o "x$TARGET" = "xsvgalib" -o "x$TARGET" = "xamigaos" \
                    841:      -o "x$TARGET" = "xbeos" -o "x$TARGET" = "xasciiart" -o "x$TARGET" = "xggilib" -o "x$TARGET" = "xp_os" ]]; then
                    842:   dnl On Unix, BeOS and AmigaOS system, zfile is supposed to work. Dunno about others.
1.1.1.3   root      843:   CFLAGS="$CFLAGS -DUSE_ZFILE"
1.1.1.4   root      844: fi
                    845: 
                    846: HAVE_USS_SOUND=no
                    847: if [[ "x$ac_cv_header_sys_soundcard_h" = "xyes" -o "x$ac_cv_header_machine_soundcard_h" = "xyes" ]]; then
                    848:   dnl Avoid surprises
                    849:   AC_MSG_CHECKING(whether sys/soundcard.h or machine/soundcard.h works)
                    850:   AC_TRY_COMPILE([
                    851: #include "confdefs.h"
                    852: #ifdef HAVE_SYS_SOUNDCARD_H
                    853: #include <sys/soundcard.h>
                    854: #else
                    855: #include <machine/soundcard.h>
                    856: #endif
                    857: #include <sys/ioctl.h>
                    858: ],
                    859: [int soundfd; ioctl (soundfd, SNDCTL_DSP_GETFMTS, 0);],
                    860: AC_MSG_RESULT(yes)
                    861: HAVE_USS_SOUND=yes,
                    862: AC_MSG_RESULT(no))
                    863: fi
                    864: 
1.1.1.8   root      865: if [[ "x$ac_cv_header_dmedia_audio.h" = "xno" ]]; then
                    866:   HAVE_SGIAUDIO_LIB=no
                    867: fi
                    868: 
1.1.1.4   root      869: AC_MSG_CHECKING(which sound system to use)
1.1.1.10  root      870: AC_ARG_ENABLE(file-sound,[  --enable-file-sound     Enable sound output to file],[USE_FILE_SOUND=$enableval],[])
1.1.1.4   root      871: 
                    872: if [[ "x$USE_FILE_SOUND" = "xyes" ]]; then
1.1.1.7   root      873:   AC_MSG_RESULT(file output)
                    874:   SOUNDDEP=sd-file
                    875:   USE_SOUND=yes  
                    876: else if [[ "x$HAVE_USS_SOUND" = "xyes" ]]; then
                    877:   AC_MSG_RESULT(USS)
                    878:   SOUNDDEP=sd-uss
1.1.1.4   root      879:   USE_SOUND=yes
1.1.1.7   root      880: else if [[ "x$ac_cv_header_sys_audioio_h" = "xyes" -o "x$ac_cv_header_sun_audioio_h" = "xyes" ]]; then
                    881:   AC_MSG_RESULT(Solaris/NetBSD)
                    882:   SOUNDDEP=sd-solaris
                    883:   USE_SOUND=yes
                    884: else if [[ "x$HAVE_AF_LIB" = "xyes" ]]; then
                    885:   AC_MSG_RESULT(AF sound)
                    886:   SOUNDDEP=sd-af
                    887:   LIBS="$LIBS -lAF"
                    888:   USE_SOUND=yes
1.1.1.8   root      889: else if [[ "x$HAVE_SGIAUDIO_LIB" = "xyes" ]]; then
                    890:   AC_MSG_RESULT(SGI sound)
                    891:   SOUNDDEP=sd-sgi
                    892:   LIBS="$LIBS -laudio"
                    893:   USE_SOUND=yes
1.1.1.7   root      894: else if [[ "x$HAVE_MME_LIB" = "xyes" ]]; then
                    895:   AC_MSG_RESULT(MME sound)
                    896:   SOUNDDEP=sd-mme
                    897:   LIBS="$LIBS -lmme"
                    898:   USE_SOUND=yes
                    899: else if [[ "x$TARGET" = "xp_os" ]]; then
                    900:   AC_MSG_RESULT(pAudio.device)
                    901:   SOUNDDEP=od-pos
                    902:   USE_SOUND=yes
                    903: else if [[ "x$TARGET" = "xamigaos" ]]; then
                    904:   if [[ "x$ac_cv_header_devices_ahi_h" = "xyes" ]]; then
                    905:     AC_MSG_RESULT(Amiga AHI.device)
1.1.1.4   root      906:   else
1.1.1.7   root      907:     AC_MSG_RESULT(Amiga audio.device)
1.1.1.6   root      908:   fi
1.1.1.7   root      909:   SOUNDDEP=od-amiga
                    910:   USE_SOUND=yes
                    911: else if [[ "x$TARGET" = "xbeos" ]]; then
                    912:   AC_MSG_RESULT(BeOS sound)
                    913:   SOUNDDEP=od-beos
                    914:   USE_SOUND=yes
                    915: else if [[ "x$TARGET" = "xwin32" ]]; then
                    916:   AC_MSG_RESULT(Win32 sound)
                    917:   SOUNDDEP=od-win32
                    918:   USE_SOUND=yes
                    919: else
                    920:   echo "no known sound system found"
                    921:   NR_ERRORS=`expr $NR_ERRORS + 1`
                    922: fi
                    923: fi
                    924: fi
                    925: fi
1.1.1.4   root      926: fi
1.1.1.7   root      927: fi
                    928: fi
                    929: fi
                    930: fi
1.1.1.8   root      931: fi
1.1.1.7   root      932: 
1.1.1.10  root      933: SCSIOBJS=scsi-none.o
                    934: SCSIDEP=scg-none
                    935: AC_ARG_ENABLE(scsi-device,[  --enable-scsi-device   Disable the uaescsi.device],[USE_SCSI_DEVICE=$enableval],[])
                    936: 
                    937: dnl @@@ Patrick - I hope no system other than Linux has "scsi/sg.h" !
                    938: if [[ "x$USE_SCSI_DEVICE" = "xyes" ]]; then
                    939:   AC_MSG_CHECKING(which scsi system to use)
                    940:   if [[ "x$ac_cv_header_scsi_sg_h" = "xyes" ]]; then
                    941:     AC_MSG_RESULT(Linux SG)
                    942:     SCSIOBJS=scsidev.o
                    943:     SCSIDEP=scg-linux-sg
                    944:   else
                    945:     AC_MSG_RESULT(SCSI not supported for this system)
                    946:   fi
                    947: fi
                    948: 
                    949: dnl Special case hack for BSD: try to use the Linux joystick.c.
                    950: 
                    951: if [[ "x$HAVE_MACHINE_JOYSTICK_H" = "xyes" ]]; then
                    952:   AC_TRY_COMPILE([#include <machine/joystick.h>],[{ struct joystick a; }],
                    953:     OD_JOYSTICK=od-linux/joystick.c,)
                    954: else
                    955:     OD_JOYSTICK=$OSDEP/joystick.c
                    956: fi
1.1.1.4   root      957: 
                    958: rm -f src/machdep
                    959: rm -f src/osdep
                    960: rm -f src/threaddep
                    961: rm -f src/sounddep
1.1.1.10  root      962: rm -f src/scsidep
1.1.1.4   root      963: rm -f src/target.h
1.1.1.5   root      964: rm -f src/config.h
1.1.1.6   root      965: rm -f src/sd-sound.c
                    966: rm -f src/od-joy.c
                    967: rm -f src/md-support.c
                    968: rm -f src/md-X86.S
1.1.1.10  root      969: rm -f src/scsi-support.c
1.1.1.3   root      970: 
1.1.1.4   root      971: if [[ "x$TARGET" = "xamigaos" -o "x$TARGET" = "xp_os" ]]; then
1.1.1.3   root      972:   dnl Determine the cpu-type
                    973:   AC_MSG_CHECKING(which CPU to use)
                    974:   cpu=`cpu | cut -d' ' -f2`
                    975:   AC_MSG_RESULT($cpu)
                    976:   CFLAGS="$CFLAGS -m$cpu"
                    977: 
                    978:   dnl Is that correct for the fpu ?
                    979:   AC_MSG_CHECKING(which FPU to use)
1.1.1.4   root      980:   fpu=`cpu | cut -d' ' -f3 | grep '^6888[12]$'`
                    981:   if [[ "x$fpu" != "x" ]]; then
                    982:     dnl gcc only knows about 68881
                    983:     AC_MSG_RESULT(68881)
                    984:     CFLAGS="$CFLAGS -m68881"
1.1.1.3   root      985:   else
                    986:     AC_MSG_RESULT(none)
                    987:   fi
                    988: fi
1.1.1.4   root      989: 
1.1       root      990: AC_SUBST(ac_cv_c_inline)
1.1.1.6   root      991: AC_SUBST(WRC)
1.1.1.4   root      992: AC_SUBST(NO_SCHED_CFLAGS)
1.1       root      993: AC_SUBST(LIBRARIES)
                    994: AC_SUBST(TARGET)
                    995: AC_SUBST(GFXOBJS)
1.1.1.6   root      996: AC_SUBST(RESOBJS)
1.1       root      997: AC_SUBST(ASMOBJS)
1.1.1.10  root      998: AC_SUBST(SCSIOBJS)
1.1.1.6   root      999: AC_SUBST(P2C)
1.1.1.2   root     1000: AC_SUBST(CPUOBJS)
1.1.1.3   root     1001: AC_SUBST(DEBUGOBJS)
1.1.1.2   root     1002: AC_SUBST(SET_MAKE)
1.1.1.3   root     1003: AC_SUBST(MATHLIB)
1.1.1.4   root     1004: AC_SUBST(SHM_SUPPORT_LINKS)
                   1005: 
1.1.1.3   root     1006: AC_SUBST(top_srcdir)
1.1       root     1007: 
1.1.1.2   root     1008: AC_OUTPUT(src/Makefile Makefile)
1.1.1.4   root     1009: if [[ "x$DO_PROFILING" = "xyes" ]]; then
1.1.1.3   root     1010:   echo "Building a profiling version of UAE (select this option only if you know"
                   1011:   echo "what you are doing)"
                   1012: fi
1.1.1.4   root     1013: 
                   1014: dnl Create some more links and files.
                   1015: 
                   1016: dnl We removed those from the build directory above, so if the source
                   1017: dnl directory still has them, something is fairly wrong.
                   1018: 
                   1019: dnl This doesn't work with Solaris /bin/sh, neither do all the alternatives I
1.1.1.6   root     1020: dnl tried. It doesn't seem to cause a failure either, though.
1.1.1.4   root     1021: 
1.1.1.10  root     1022: if test -f $abssrcdir/src/target.h
1.1.1.6   root     1023: then
                   1024:   echo
                   1025:   echo "Fatal error: Can't configure in the current directory, because"
                   1026:   echo "configure was run in the source directory. Go to the source"
                   1027:   echo "directory, type"
                   1028:   echo "  make streifenfrei"
                   1029:   echo "and try again."
                   1030:   exit 1
                   1031: fi
1.1.1.4   root     1032: 
                   1033: ln -s $abssrcdir/src/$MACHDEP src/machdep
                   1034: ln -s $abssrcdir/src/$OSDEP src/osdep
                   1035: ln -s $abssrcdir/src/$THREADDEP src/threaddep
                   1036: ln -s $abssrcdir/src/$SOUNDDEP src/sounddep
                   1037: 
1.1.1.10  root     1038: echo "#include \"$abssrcdir/src/targets/$TARGETDEP\"" > src/target.h
                   1039: echo "#include \"$abssrcdir/config.h\"" > src/config.h
1.1.1.6   root     1040: 
1.1.1.10  root     1041: echo "#include \"$abssrcdir/src/$SOUNDDEP/sound.c\"" >src/sd-sound.c
                   1042: echo "#include \"$abssrcdir/src/$OD_JOYSTICK\"" >src/od-joy.c
                   1043: echo "#include \"$abssrcdir/src/$MACHDEP/support.c\"" >src/md-support.c
                   1044: 
                   1045: if [[ "x$SCSIDEP" != "xscg-none" ]]; then 
                   1046:   echo "#include \"$abssrcdir/src/$SCSIDEP/scsi.h\"" >src/scsi-support.c
                   1047:   echo "#include \"$abssrcdir/src/$SCSIDEP/scsi.c\"" >>src/scsi-support.c
                   1048: fi
1.1.1.6   root     1049: if [[ "x$MACHDEP" = "xmd-i386-gcc" ]]; then
1.1.1.10  root     1050:   echo "#include \"machdep/X86.S\"" >src/md-X86.S
1.1.1.6   root     1051: fi
1.1.1.11! root     1052: echo "#include \"$abssrcdir/src/include/$FPP_H\"" >src/md-fpp.h
1.1.1.6   root     1053: 
                   1054: 
1.1.1.4   root     1055: echo
                   1056: echo
                   1057: if [[ "x$NR_ERRORS" = "x0" ]]; then
                   1058:   if [[ "x$NR_WARNINGS" = "x0" ]]; then
                   1059:     echo "Configuration was successful!"
                   1060:   else
                   1061:     echo "There were $NR_WARNINGS warnings. That is usually harmless, but read the output"
                   1062:     echo "from configure carefully if you run into problems."
                   1063:   fi
                   1064: else
                   1065:   echo "There were $NR_ERRORS errors. UAE may still build and run cleanly, but you may"
                   1066:   echo "not get all the features you asked for."
                   1067: fi
                   1068: echo

unix.superglobalmegacorp.com

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