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