Annotation of uae/configure.in, revision 1.1.1.21

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

unix.superglobalmegacorp.com

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