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