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