Annotation of uae/configure.in, revision 1.1.1.7

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

unix.superglobalmegacorp.com

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