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