|
|
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:
351: AM_PATH_GTK
352:
353: dnl See if we can at least compile SHM support
354:
355: SHM_SUPPORT_LINKS=0
1.1.1.6 root 356: 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 357: AC_MSG_CHECKING(whether the X11 MIT-SHM extension can be compiled in)
358: TMP_SAVE_CFLAGS=$CFLAGS
359: TMP_SAVE_LIBS=$LIBS
360: CFLAGS="$CFLAGS $X_CFLAGS"
361: LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"
1.1.1.20! root 362: AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1.1.1.4 root 363: #include "confdefs.h"
364: #ifdef HAVE_SYS_TYPES_H
365: #include <sys/types.h>
366: #endif
367: #include <X11/Xlib.h>
368: #include <X11/Xutil.h>
369: #include <X11/keysym.h>
370: #include <X11/cursorfont.h>
371: #include <sys/ipc.h>
372: #include <sys/shm.h>
1.1.1.20! root 373: #include <X11/extensions/XShm.h>]], [[
1.1.1.4 root 374: static XShmSegmentInfo shminfo;
375: static Display *display;
376: XShmAttach(display, &shminfo);
377: XSync(display,0);
378: shmctl(shminfo.shmid, IPC_RMID, 0);
1.1.1.20! root 379: ]])],[SHM_SUPPORT_LINKS=1
! 380: AC_MSG_RESULT(yes)],[SHM_SUPPORT_LINKS=0
! 381: AC_MSG_RESULT(no)])
1.1.1.4 root 382: CFLAGS=$TMP_SAVE_CFLAGS
383: LIBS=$TMP_SAVE_LIBS
1.1.1.2 root 384: fi
385:
1.1.1.3 root 386: MATHLIB=-lm
1.1.1.4 root 387: DEBUGOBJS="debug.o"
1.1.1.3 root 388:
1.1 root 389: AC_MSG_CHECKING(which target to use)
1.1.1.4 root 390:
1.1.1.18 root 391: if [[ "x$WANT_SDLGFX" = "xyes" ]]; then
392: AC_MSG_RESULT(SDL)
393: MATHLIB=
394: TARGET=x11
395: GFXOBJS="sdlgfx.o"
396: # @@@ Kludge. This may get changed later.
397: TARGETDEP=t-x11.h
398: else if [[ "x$HAVE_DIRECTX" = "xyes" ]]; then
1.1.1.6 root 399: AC_MSG_RESULT(Win32/DirectX)
400: MATHLIB=
401: TARGET=win32
402: TARGETDEP=t-win32.h
1.1.1.18 root 403: GFXOBJS="osdep/win32.o osdep/parser.o osdep/keyboard.o osdep/posixemu.o"
1.1.1.6 root 404: RESOBJS="osdep/winuae.res"
405: else if [[ "x$HAVE_BEOS" = "xyes" ]]; then
1.1.1.4 root 406: AC_MSG_RESULT(BeOS)
407: MATHLIB=
408: TARGET=beos
409: TARGETDEP=t-beos.h
410: GFXOBJS=osdep/beos.o
411: OPTIMIZE_CFLAGS=-O7
412: else if [[ "x$HAVE_POS" = "xyes" ]]; then
413: AC_MSG_RESULT(p.OS)
414: TARGET=p_os
415: TARGETDEP=t-pos.h
416: GFXOBJS="osdep/pos-win.o osdep/pos-disk.o osdep/pos-rexx.o"
417: else if [[ "x$HAVE_AMIGA_LIB" = "xyes" ]]; then
1.1.1.3 root 418: AC_MSG_RESULT(AmigaOS)
419: TARGET=amigaos
1.1.1.4 root 420: TARGETDEP=t-amiga.h
421: GFXOBJS="osdep/ami-win.o osdep/ami-disk.o osdep/ami-rexx.o osdep/ami-appw.o"
422: else if [[ "x$HAVE_NEXT_LIB" = "xyes" ]]; then
1.1.1.3 root 423: AC_MSG_RESULT(NeXTStep)
424: MATHLIB=
425: TARGET=next
426: GFXOBJS="NeXTwin.o"
1.1.1.4 root 427: TARGETDEP=t-next.h
1.1.1.3 root 428: LIBRARIES="-sectcreate __ICON __header ../Uae.app/Uae.iconheader -segprot __ICON r r -sectcreate __ICON app ../Uae.app/Uae.tiff -lMedia_s -lNeXT_s"
429: else
1.1.1.4 root 430: dnl Unix system
431: dnl If we don't have X, see what else we have and/or want.
1.1.1.3 root 432:
1.1.1.4 root 433: if [[ "x$no_x" = "xyes" ]]; then
1.1.1.13 root 434: if [[ "x$WANT_SVGALIB" != "xyes" -a "x$WANT_ASCIIART" != "xyes" ]]; then
1.1.1.4 root 435: if [[ "x$WANT_SVGALIB" != "xno" -a "x$HAVE_SVGA_LIB" = "xyes" ]]; then
436: WANT_SVGALIB=yes
437: else if [[ "x$WANT_ASCIIART" != "xno" -a "x$HAVE_NCURSES_LIB" = "xyes" ]]; then
438: WANT_ASCIIART=yes
439: fi
440: fi
1.1.1.3 root 441: fi
442: fi
443:
1.1.1.13 root 444: if [[ "x$WANT_SVGALIB" = "xyes" ]]; then
1.1.1.4 root 445: AC_MSG_RESULT(SVGAlib)
446: TARGET=svgalib
447: TARGETDEP=t-svgalib.h
448: GFXOBJS=svga.o
449: LIBRARIES="-lvga"
450: WANT_NCURSES_UI=yes
451: else if [[ "x$WANT_ASCIIART" = "xyes" ]]; then
452: AC_MSG_RESULT(ncurses ASCII art)
453: TARGET=asciiart
454: TARGETDEP=t-ascii.h
455: GFXOBJS="ncurses.o"
1.1.1.18 root 456: WANT_NCURSES_UI=yes
1.1.1.4 root 457: LIBRARIES="-lncurses"
458: else if [[ "x$no_x" = "xyes" ]]; then
459: AC_MSG_RESULT(Ummm....)
460: echo "Fatal error: No graphics system found, don't know what target to use."
461: exit 1
1.1.1.3 root 462: else
1.1.1.4 root 463: AC_MSG_RESULT(X11)
464: TARGET=x11
465: TARGETDEP=t-x11.h
466: GFXOBJS=xwin.o
467:
468: LIBRARIES="$X_LIBS $X_PRE_LIBS"
469: dnl If we still think we want DGA, set it up.
470: if [[ "x$WANT_DGA" = "xyes" ]]; then
471: LIBRARIES="$LIBRARIES -lXxf86dga"
472: X_CFLAGS="$X_CFLAGS -DUSE_DGA_EXTENSION"
473: if [[ "x$WANT_VIDMODE" = "xyes" ]]; then
474: LIBRARIES="$LIBRARIES -lXxf86vm"
475: X_CFLAGS="$X_CFLAGS -DUSE_VIDMODE_EXTENSION"
476: fi
477: fi
478: LIBRARIES="$LIBRARIES -lXext -lX11 $X_EXTRA_LIBS"
479: fi
480: fi
481: fi
1.1 root 482: fi
1.1.1.3 root 483: fi
484: fi
485: fi
1.1.1.6 root 486: fi
1.1.1.18 root 487: fi
1.1 root 488:
1.1.1.18 root 489: if [[ "x$HAVE_DIRECTX" = "xyes" ]]; then
490: TARGETDEP=t-win32.h
491: TARGET=win32
492: fi
493:
494: if [[ "x$WANT_UI" != "xno" ]]; then
495: if [[ "x$HAVE_DIRECTX" = "xyes" ]]; then
496: GUIOBJS=osdep/win32gui.o
497: else if [[ "x$HAVE_AMIGA_LIB" = "xyes" ]]; then
498: GUIOBJS="osdep/ami-gui.o"
499: else if [[ "x$HAVE_POS" = "xyes" ]]; then
500: GUIOBJS="osdep/pos-gui.o"
501: else if [[ "x$WANT_NCURSES_UI" = "xyes" ]]; then
502: if [[ "x$HAVE_NCURSES_LIB" = "xno" ]]; then
1.1.1.4 root 503: echo "ncurses is unavailable, can't provide a user interface"
1.1.1.18 root 504: if [[ "x$WANT_UI" = "xyes" ]]; then
505: NR_ERRORS=`expr $NR_ERRORS + 1`
506: fi
507: WANT_UI=no
508: GUIOBJS=nogui.o
509: else
510: GUIOBJS="tui.o svgancui.o"
511: LIBRARIES="$LIBRARIES -lncurses"
512: ADDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DUSING_CURSES_UI"
513: if [[ "x$ac_cv_header_ncurses_h" = "xno" ]]; then
514: echo "Found libncurses, but no ncurses.h. This is normal with recent versions"
515: echo "of ncurses, but it might indicate a problem with older versions."
516: NR_WARNINGS=`expr $NR_WARNINGS + 1`
517: fi
1.1.1.4 root 518: fi
1.1.1.18 root 519: else if [[ "x$no_x" != "xno" ]]; then
520: if [[ "x$no_gtk" = "xyes" ]]; then
521: echo "Did not find gtk+, disabling user interface"
522: GTK_CFLAGS=
1.1.1.19 root 523: GUIOBJS=nogui.o
1.1.1.18 root 524: if [[ "x$WANT_UI" = "xyes" ]]; then
525: NR_ERRORS=`expr $NR_ERRORS + 1`
526: fi
527: else
528: echo "Using gtk+ GUI."
529: NEED_THREAD_SUPPORT=yes
530: DDITIONAL_CFLAGS="$ADDITIONAL_CFLAGS -DUSING_GTK_GUI"
531: GUIOBJS=gtkui.o
532: fi
533: else
534: if [[ "x$WANT_UI" = "xyes" ]]; then
535: echo "GUI requested, but no suitable libraries found."
536: NR_ERRORS=`expr $NR_ERRORS + 1`
1.1.1.4 root 537: fi
538: GUIOBJS=nogui.o
539: fi
1.1.1.18 root 540: fi
541: fi
542: fi
543: fi
544: else
545: GUIOBJS=nogui.o
1.1.1.3 root 546: fi
1.1.1.18 root 547:
1.1.1.4 root 548: GFXOBJS="$GFXOBJS $GUIOBJS"
549:
1.1.1.3 root 550: dnl Find out some things about the system
551: dnl - whether we have GCC 2.7 or better.
552: dnl - what CPU we have (to use some assembly hacks on the x86)
553: dnl - whether we are on a Linux system
1.1.1.4 root 554: dnl - whether it's running glibc-2.0
555:
556: MACHDEP=md-generic
557: OSDEP=od-generic
558: THREADDEP=td-none
559: SOUNDDEP=od-generic
560:
1.1.1.11 root 561: FPP_H=fpp-unknown.h
1.1.1.4 root 562: USE_THREADS=no
563: USE_FILE_SOUND=no
1.1.1.10 root 564: USE_SCSI_DEVICE=no
1.1.1.4 root 565:
1.1.1.6 root 566: USE_UNDERSCORE=dunno
567:
1.1.1.4 root 568: HAVELINUX=no
1.1.1.6 root 569: HAVEBSD=no
1.1.1.4 root 570: HAVEGCC27=no
571: HAVEI386=no
572: HAVE68K=no
1.1.1.11 root 573: HAVEPPC=no
1.1.1.4 root 574: HAVEGLIBC2=no
1.1.1.3 root 575:
1.1 root 576: ASMOBJS=
1.1.1.4 root 577: CPUOBJS=cpuemu.o
1.1.1.3 root 578:
1.1.1.4 root 579: AC_MSG_CHECKING(for GCC 2.7 or higher)
1.1.1.6 root 580: AC_EGREP_CPP(yes,
581: [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
582: yes
1.1.1.3 root 583: #endif
1.1.1.6 root 584: ], [AC_MSG_RESULT(yes); HAVEGCC27=yes], AC_MSG_RESULT(no))
1.1.1.3 root 585:
1.1.1.20! root 586: if test $ac_cv_c_compiler_gnu = yes; then
1.1.1.6 root 587: if test $HAVEGCC27 != yes; then
1.1.1.3 root 588: echo "I suggest you upgrade to at least version 2.7 of GCC"
1.1.1.6 root 589: fi
590: else
591: if test $uae_cv_prog_cc_watcom != yes; then
1.1.1.3 root 592: echo "Couldn't find GCC. UAE may or may not compile and run correctly."
1.1.1.4 root 593: NR_WARNINGS=`expr $NR_WARNINGS + 1`
1.1.1.3 root 594: fi
595: fi
596:
1.1.1.4 root 597: if [[ "x$ac_cv_header_features_h" = "xyes" ]]; then
1.1.1.6 root 598: AC_MSG_CHECKING(for glibc-2.0 or higher)
599: AC_EGREP_CPP(yes,
600: [#include <features.h>
601: #if __GLIBC__ - 1 >= 1
602: yes
1.1.1.4 root 603: #endif
1.1.1.6 root 604: ], [AC_MSG_RESULT(yes); HAVEGLIBC2=yes], AC_MSG_RESULT(no))
1.1.1.4 root 605: fi
606:
1.1.1.20! root 607: if test $ac_cv_c_compiler_gnu = yes; then
1.1.1.4 root 608: WARNING_CFLAGS="-Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes"
609: OPTIMIZE_CFLAGS="-O2 -fomit-frame-pointer"
610: dnl Not nice, but needed to turn off -g
611: CFLAGS=
612: fi
613:
614: if [[ "x$DO_PROFILING" = "xyes" ]]; then
615: if [[ "x$CC" = "xgcc" ]]; then
616: OPTIMIZE_CFLAGS="-O"
617: DEBUG_CFLAGS="-g -fno-inline -fno-omit-frame-pointer -pg -DUSE_PROFILING"
618: LDFLAGS="-pg"
619: else
620: DO_PROFILING=no
621: echo "Don't know how to set up profiling for your compiler."
622: NR_ERRORS=`expr $NR_ERRORS + 1`
1.1.1.3 root 623: fi
624: fi
625:
1.1.1.4 root 626: CFLAGS="$OPTIMIZE_CFLAGS $DEBUG_CFLAGS $WARNING_CFLAGS $CFLAGS $ADDITIONAL_CFLAGS"
627:
628: if [[ "x$HAVEGCC27" = "xyes" ]]; then
1.1.1.3 root 629: CFLAGS="$CFLAGS -DGCCCONSTFUNC=\"__attribute__((const))\""
630: else
631: CFLAGS="$CFLAGS -DGCCCONSTFUNC="
632: fi
633:
1.1.1.6 root 634: AC_MSG_CHECKING(for x86 target CPU)
635: AC_EGREP_CPP(yes,
636: [
1.1.1.3 root 637: #ifdef __i386__
1.1.1.6 root 638: yes
1.1.1.3 root 639: #endif
1.1.1.6 root 640: ], [AC_MSG_RESULT(yes); HAVEI386=yes], AC_MSG_RESULT(no))
1.1.1.3 root 641:
1.1.1.6 root 642: AC_MSG_CHECKING(for m68k target CPU)
643: AC_EGREP_CPP(yes,
644: [
645: #ifdef __m68k__
646: yes
647: #endif
1.1.1.7 root 648: ], [AC_MSG_RESULT(yes); HAVE68K=yes], AC_MSG_RESULT(no))
1.1 root 649:
1.1.1.11 root 650: AC_MSG_CHECKING(for ppc target CPU)
651: AC_EGREP_CPP(yes,
652: [
653: #ifdef __powerpc__
654: yes
655: #endif
656: ], [AC_MSG_RESULT(yes); HAVEPPC=yes], AC_MSG_RESULT(no))
657:
1.1.1.4 root 658: if MACHINE=`uname -a 2>/dev/null`; then
659: case "$MACHINE" in
660: Linux*)
661: HAVELINUX=yes
662: ;;
663: esac
664: fi
665:
666: dnl X86.S needs to know whether it needs to add underscores to symbols.
667: dnl This might break some obscure systems which don't have ELF but don't
668: dnl add underscores either.
1.1 root 669:
1.1.1.6 root 670: AC_MSG_CHECKING(whether assembler symbols need an underscore)
671: cat >conftest1.S << EOF
672: .text
673: .globl _symbol
674: _symbol:
675: EOF
676: cat >conftest2.c << EOF
677: extern void symbol ();
678: int main ()
679: {
680: symbol ();
681: }
682: EOF
683: $CC conftest1.S -c -o conftest1.o >/dev/null 2>&1
684: $CC conftest2.c -c -o conftest2.o >/dev/null 2>&1
685: if $CC conftest1.o conftest2.o -o conftest >/dev/null 2>&1; then
686: USE_UNDERSCORE=yes
687: CFLAGS="$CFLAGS -DUSE_UNDERSCORE"
1.1.1.4 root 688: else
1.1.1.6 root 689: USE_UNDERSCORE=no
1.1.1.4 root 690: fi
1.1.1.6 root 691: AC_MSG_RESULT($USE_UNDERSCORE)
1.1.1.4 root 692:
693: rm -f conftest*
694:
1.1.1.10 root 695: AC_ARG_ENABLE(threads,[ --enable-threads Enable some generally useful thread support],[USE_THREADS=$enableval],[])
1.1.1.4 root 696:
697: dnl See if we have something better than GCC 2.7.
698:
699: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
700: SAVECFLAGS=$CFLAGS
701: CFLAGS="$CFLAGS -mno-schedule-prologue"
1.1.1.20! root 702: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int main(){return 0;}]])],[NO_SCHED_CFLAGS="-mno-schedule-prologue"],[])
1.1.1.4 root 703: CFLAGS=$SAVECFLAGS
704: fi
705:
1.1.1.10 root 706: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
707: SAVECFLAGS=$CFLAGS
708: CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
1.1.1.20! root 709: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int main(){return 0;}]])],[SAVECFLAGS=$CFLAGS],[])
! 710: CFLAGS=$SAVECFLAGS
! 711: fi
! 712:
! 713: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
! 714: SAVECFLAGS=$CFLAGS
! 715: CFLAGS="$CFLAGS -fno-reorder-blocks"
! 716: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int main(){return 0;}]])],[NO_REORDER_CFLAGS="-fno-reorder-blocks"],[])
1.1.1.10 root 717: CFLAGS=$SAVECFLAGS
718: fi
719:
1.1.1.4 root 720: dnl If GCC supports exceptions, we don't want them.
721:
722: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" ]]; then
723: SAVECFLAGS=$CFLAGS
724: CFLAGS="$CFLAGS -fno-exceptions"
725: NOEXCEPTIONS=no
1.1.1.20! root 726: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int main(){return 0;}]])],[NOEXCEPTIONS=yes],[])
1.1.1.4 root 727: if [[ "x$NOEXCEPTIONS" = "xno" ]]; then
728: CFLAGS=$SAVECFLAGS
729: fi
730: fi
731:
732:
1.1.1.3 root 733: dnl Set up the link to the appropriate machdep directory and select something
734: dnl for the REGPARAM define.
735:
1.1.1.4 root 736: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEI386" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
737: MACHDEP=md-i386-gcc
738: dnl strength-reduce is turned off not because of paranoia, but because it
739: dnl actually makes the code worse in some cases on the i386 (generates too
740: dnl many registers, which all end up on the stack).
1.1.1.6 root 741: CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
742:
1.1.1.14 root 743: CFLAGS="$CFLAGS -DX86_ASSEMBLY -DOPTIMIZED_FLAGS"
744: ASMOBJS=md-X86.o
1.1.1.6 root 745: else if test $uae_cv_prog_cc_watcom = yes; then
746: MACHDEP=md-i386-watcom
747: echo CFLAGS before: $CFLAGS
748: CFLAGS=`echo $CFLAGS | sed 's, -g , ,' |sed 's,^-g ,,'`
749: CFLAGS="$CFLAGS --/--bm --/--mf --/--w4 --/--s --/--ei --/--zp4 --/--5r"
750: CFLAGS="$CFLAGS --/--oe=50 --/--oi --/--ok --/--ol --/--ot --/--oh --/--or --/--zq"
751: CFLAGS="$CFLAGS -DREGPARAM= -DUNALIGNED_PROFITABLE"
752: echo CFLAGS after: $CFLAGS
1.1.1.11 root 753: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVEPPC" = "xyes" ]]; then
754: MACHDEP=md-ppc-gcc
755: CFLAGS="$CFLAGS -DREGPARAM="
756: if [[ "x$HAVE_MOTO_LIB" = "xyes" ]]; then
757: MATHLIB="-lmoto $MATHLIB"
758: fi
1.1.1.4 root 759: else if [[ "x$TARGET" = "xp_os" ]]; then
760: CPU=`uname -m`
761: if [[ "x$CPU" = "xm68k" ]]; then
762: MACHDEP=md-68k
1.1.1.7 root 763: CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
1.1.1.4 root 764: else if [[ "x$CPU" = "xppc" ]]; then
765: MACHDEP=md-ppc
766: CFLAGS="$CFLAGS -DREGPARAM="
767: else if [[ "x$CPU" = "xi386" ]]; then
768: dnl Sam, I don't think we can get here.
769: MACHDEP=md-i386-gcc
770: CFLAGS="$CFLAGS -DX86_ASSEMBLY -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
771: else
772: echo "Unsupported CPU: $CPU!"
773: exit 5
774: fi
775: fi
776: fi
777: CFLAGS="$CFLAGS -nostdinc -I/gg/include -I/p/../inc -D__POS__"
778: OSDEP=od-pos
1.1.1.7 root 779: else if [[ "x$TARGET" = "xamigaos" ]]; then
1.1.1.4 root 780: OSDEP=od-amiga
1.1.1.7 root 781: CPU=`uname -m`
782: if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" ]]; then
783: MACHDEP=md-68k
784: CFLAGS="$CFLAGS -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(4)))\" -DM68K_FLAG_OPT=1"
785: else if [[ "x$HAVEGCC27" = "xyes" -a "x$CPU" = "xppc" ]]; then
786: MACHDEP=md-ppc-gcc
787: else
788: dnl sam: amigaos without gcc
789: CFLAGS="$CFLAGS -O -DREGPARAM="
790: fi
1.1.1.20! root 791: CPUOBJS="cpuemu1.o cpuemu2.o cpuemu3.o cpuemu4.o cpuemu5.o cpuemu6.o cpuemu7.o cpuemu8.o"
1.1.1.7 root 792: fi
1.1.1.4 root 793: else if [[ "x$HAVEGCC27" = "xyes" -a "x$HAVE68K" = "xyes" -a "x$DO_PROFILING" = "xno" ]]; then
794: dnl sam: This is for linux 68k (REGPARAM is not used under linux)
795: MACHDEP=md-68k
796: CFLAGS="$CFLAGS -DM68K_FLAG_OPT=1 -DREGPARAM="
797: else if [[ "x$TARGET" = "xbeos" ]]; then
798: MACHDEP=md-ppc
799: CFLAGS="$CFLAGS -DREGPARAM="
800: OSDEP=od-beos
1.1 root 801: else
1.1.1.3 root 802: CFLAGS="$CFLAGS -DREGPARAM="
803: fi
804: fi
1.1 root 805: fi
1.1.1.4 root 806: fi
807: fi
808: fi
1.1.1.11 root 809: fi
1.1 root 810:
1.1.1.17 root 811: FSDBOBJS=fsdb_unix.o
1.1.1.6 root 812: if [[ "x$TARGET" = "xwin32" ]]; then
813: OSDEP=od-win32
1.1.1.17 root 814: FSDBOBJS=osdep/fsdb_win32.o
1.1.1.20! root 815: if test $ac_cv_c_compiler_gnu = yes; then
1.1.1.6 root 816: LIBS="$LIBS -lddraw -lwinmm -lcomctl32 -lcomdlg32 -luser32 -lgdi32 -lkernel32 -ladvapi32 -lshell32"
817: else if test $uae_cv_prog_cc_watcom = yes; then
818: LIBS="$LIBS -lddraw -lwinmm -lcomctl32"
819: fi
820: fi
821: else if [[ "x$HAVELINUX" = "xyes" ]]; then
1.1.1.4 root 822: OSDEP=od-linux
1.1.1.2 root 823: fi
1.1.1.6 root 824: fi
1.1.1.2 root 825:
1.1.1.4 root 826: if [[ "x$TARGET" = "xx11" -o "x$TARGET" = "xsvgalib" -o "x$TARGET" = "xamigaos" \
1.1.1.13 root 827: -o "x$TARGET" = "xbeos" -o "x$TARGET" = "xasciiart" -o "x$TARGET" = "xp_os" ]]; then
1.1.1.4 root 828: dnl On Unix, BeOS and AmigaOS system, zfile is supposed to work. Dunno about others.
1.1.1.3 root 829: CFLAGS="$CFLAGS -DUSE_ZFILE"
1.1.1.4 root 830: fi
831:
832: HAVE_USS_SOUND=no
833: if [[ "x$ac_cv_header_sys_soundcard_h" = "xyes" -o "x$ac_cv_header_machine_soundcard_h" = "xyes" ]]; then
834: dnl Avoid surprises
835: AC_MSG_CHECKING(whether sys/soundcard.h or machine/soundcard.h works)
1.1.1.20! root 836: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1.1.1.4 root 837: #include "confdefs.h"
838: #ifdef HAVE_SYS_SOUNDCARD_H
839: #include <sys/soundcard.h>
840: #else
841: #include <machine/soundcard.h>
842: #endif
843: #include <sys/ioctl.h>
1.1.1.20! root 844: ]], [[int soundfd; ioctl (soundfd, SNDCTL_DSP_GETFMTS, 0);]])],[AC_MSG_RESULT(yes)
! 845: HAVE_USS_SOUND=yes],[AC_MSG_RESULT(no)])
1.1.1.4 root 846: fi
847:
1.1.1.8 root 848: if [[ "x$ac_cv_header_dmedia_audio.h" = "xno" ]]; then
849: HAVE_SGIAUDIO_LIB=no
850: fi
851:
1.1.1.4 root 852: AC_MSG_CHECKING(which sound system to use)
1.1.1.10 root 853: AC_ARG_ENABLE(file-sound,[ --enable-file-sound Enable sound output to file],[USE_FILE_SOUND=$enableval],[])
1.1.1.4 root 854:
855: if [[ "x$USE_FILE_SOUND" = "xyes" ]]; then
1.1.1.7 root 856: AC_MSG_RESULT(file output)
857: SOUNDDEP=sd-file
858: USE_SOUND=yes
1.1.1.18 root 859: else if [[ "x$WANT_SDLSND" = "xyes" ]]; then
1.1.1.17 root 860: AC_MSG_RESULT(SDL)
861: SOUNDDEP=sd-sdl
862: USE_SOUND=yes
863: NEED_THREAD_SUPPORT=yes
1.1.1.20! root 864: else if [[ "x$WANT_ALSA" = "xyes" ]]; then
! 865: AC_MSG_RESULT(ALSA)
! 866: SOUNDDEP=sd-alsa
! 867: USE_SOUND=yes
1.1.1.7 root 868: else if [[ "x$HAVE_USS_SOUND" = "xyes" ]]; then
869: AC_MSG_RESULT(USS)
870: SOUNDDEP=sd-uss
1.1.1.4 root 871: USE_SOUND=yes
1.1.1.7 root 872: else if [[ "x$ac_cv_header_sys_audioio_h" = "xyes" -o "x$ac_cv_header_sun_audioio_h" = "xyes" ]]; then
873: AC_MSG_RESULT(Solaris/NetBSD)
874: SOUNDDEP=sd-solaris
875: USE_SOUND=yes
876: else if [[ "x$HAVE_AF_LIB" = "xyes" ]]; then
877: AC_MSG_RESULT(AF sound)
878: SOUNDDEP=sd-af
879: LIBS="$LIBS -lAF"
880: USE_SOUND=yes
1.1.1.8 root 881: else if [[ "x$HAVE_SGIAUDIO_LIB" = "xyes" ]]; then
882: AC_MSG_RESULT(SGI sound)
883: SOUNDDEP=sd-sgi
884: LIBS="$LIBS -laudio"
885: USE_SOUND=yes
1.1.1.7 root 886: else if [[ "x$HAVE_MME_LIB" = "xyes" ]]; then
887: AC_MSG_RESULT(MME sound)
888: SOUNDDEP=sd-mme
889: LIBS="$LIBS -lmme"
890: USE_SOUND=yes
891: else if [[ "x$TARGET" = "xp_os" ]]; then
892: AC_MSG_RESULT(pAudio.device)
893: SOUNDDEP=od-pos
894: USE_SOUND=yes
895: else if [[ "x$TARGET" = "xamigaos" ]]; then
896: if [[ "x$ac_cv_header_devices_ahi_h" = "xyes" ]]; then
897: AC_MSG_RESULT(Amiga AHI.device)
1.1.1.4 root 898: else
1.1.1.7 root 899: AC_MSG_RESULT(Amiga audio.device)
1.1.1.6 root 900: fi
1.1.1.7 root 901: SOUNDDEP=od-amiga
902: USE_SOUND=yes
903: else if [[ "x$TARGET" = "xbeos" ]]; then
904: AC_MSG_RESULT(BeOS sound)
905: SOUNDDEP=od-beos
906: USE_SOUND=yes
907: else if [[ "x$TARGET" = "xwin32" ]]; then
908: AC_MSG_RESULT(Win32 sound)
909: SOUNDDEP=od-win32
910: USE_SOUND=yes
911: else
912: echo "no known sound system found"
913: NR_ERRORS=`expr $NR_ERRORS + 1`
914: fi
915: fi
916: fi
917: fi
1.1.1.4 root 918: fi
1.1.1.7 root 919: fi
920: fi
921: fi
922: fi
1.1.1.8 root 923: fi
1.1.1.17 root 924: fi
1.1.1.20! root 925: fi
1.1.1.17 root 926:
927: if [[ "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
928: if [[ "x$USE_THREADS" != "xyes" ]]; then
929: echo "Threads are needed for this configuration; enabling thread support."
930: fi
931: fi
932:
933: if [[ "x$USE_THREADS" = "xyes" -o "x$NEED_THREAD_SUPPORT" = "xyes" ]]; then
934: if [[ "x$WANT_SDL" = "xyes" ]]; then
935: THREADDEP=td-sdl
936: else if [[ "x$HAVE_PTHREAD_LIB" = "xyes" ]]; then
937: THREADDEP=td-posix
938: CFLAGS="$CFLAGS -DSUPPORT_THREADS -D_REENTRANT"
939: LIBS="$LIBS -lpthread"
940: if [[ "x$HAVE_POSIX4_LIB" = "xyes" ]]; then
941: LIBS="$LIBS -lposix4"
942: fi
943:
944: if [[ "x$USE_THREADS" = "xyes" ]]; then
945: CFLAGS="$CFLAGS -DUAE_FILESYS_THREADS"
946: fi
947:
948: if [[ "x$HAVELINUX" = "xno" -o "x$HAVEGLIBC2" = "xno" ]]; then
949: echo "Thread support has only been tested on Linux systems with glibc-2.0"
950: NR_WARNINGS=`expr $NR_WARNINGS + 1`
951: fi
952: if [[ "x$TARGET" = "xsvgalib" ]]; then
953: echo "If you didn't compile a fixed version of SVGAlib then thread support"
954: echo "in UAE will lock your machine real hard."
955: NR_WARNINGS=`expr $NR_WARNINGS + 1`
956: fi
957: else
958: echo "You tried to enable threads, but I couldn't find a thread library!"
959: NR_ERRORS=`expr $NR_ERRORS + 1`
960: fi
961: fi
962: fi
1.1.1.7 root 963:
1.1.1.10 root 964: SCSIOBJS=scsi-none.o
1.1.1.14 root 965: AC_ARG_ENABLE(scsi-device,[ --enable-scsi-device Enable the uaescsi.device],[USE_SCSI_DEVICE=$enableval],[])
1.1.1.10 root 966: if [[ "x$USE_SCSI_DEVICE" = "xyes" ]]; then
1.1.1.13 root 967: AC_MSG_CHECKING("availability of libscg headers and lib")
968: OLDLIBS="$LIBS"
1.1.1.14 root 969: OLDCFLAGS="$CFLAGS"
970: CFLAGS="$CFLAGS -Isrc/include"
971: LIBS="-Lsrc $LIBS -lscg -lschily"
1.1.1.20! root 972: AC_LINK_IFELSE([AC_LANG_PROGRAM([[typedef int BOOL;
1.1.1.14 root 973: #include "scg/scgcmd.h"
1.1.1.13 root 974: #include "scg/scsitransp.h"
1.1.1.20! root 975: #include "scg/scsireg.h"]], [[{SCSI *scgp = open_scsi ((void *)0, (void *)0, 0, 1, 1);}]])],[
1.1.1.13 root 976: AC_MSG_RESULT(available)
1.1.1.10 root 977: SCSIOBJS=scsidev.o
1.1.1.20! root 978: ],[
1.1.1.13 root 979: AC_MSG_RESULT(not available)
980: NR_WARNINGS=`expr $NR_WARNINGS + 1`
981: echo "Please refer to the UAE SCSI device section in docs/README for installation instructions."
982: LIBS="$OLDLIBS"
983: ])
1.1.1.14 root 984: CFLAGS="$OLDCFLAGS"
1.1.1.10 root 985: fi
986:
987: dnl Special case hack for BSD: try to use the Linux joystick.c.
988:
1.1.1.17 root 989: if [[ "x$WANT_SDL" = "xyes" ]]; then
990: OD_JOYSTICK=sdl-joystick.c
1.1.1.19 root 991: else if [[ "x$ac_cv_header_machine_joystick_h" = "xyes" ]]; then
1.1.1.20! root 992: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <machine/joystick.h>]], [[{ struct joystick a; }]])],[OD_JOYSTICK=od-linux/joystick.c],[])
1.1.1.10 root 993: else
994: OD_JOYSTICK=$OSDEP/joystick.c
995: fi
1.1.1.17 root 996: fi
1.1.1.4 root 997:
998: rm -f src/machdep
999: rm -f src/osdep
1000: rm -f src/threaddep
1001: rm -f src/sounddep
1.1.1.10 root 1002: rm -f src/scsidep
1.1.1.4 root 1003: rm -f src/target.h
1.1.1.5 root 1004: rm -f src/config.h
1.1.1.6 root 1005: rm -f src/sd-sound.c
1006: rm -f src/od-joy.c
1007: rm -f src/md-support.c
1008: rm -f src/md-X86.S
1.1.1.10 root 1009: rm -f src/scsi-support.c
1.1.1.3 root 1010:
1.1.1.4 root 1011: if [[ "x$TARGET" = "xamigaos" -o "x$TARGET" = "xp_os" ]]; then
1.1.1.3 root 1012: dnl Determine the cpu-type
1013: AC_MSG_CHECKING(which CPU to use)
1014: cpu=`cpu | cut -d' ' -f2`
1015: AC_MSG_RESULT($cpu)
1016: CFLAGS="$CFLAGS -m$cpu"
1017:
1018: dnl Is that correct for the fpu ?
1019: AC_MSG_CHECKING(which FPU to use)
1.1.1.4 root 1020: fpu=`cpu | cut -d' ' -f3 | grep '^6888[12]$'`
1021: if [[ "x$fpu" != "x" ]]; then
1022: dnl gcc only knows about 68881
1023: AC_MSG_RESULT(68881)
1024: CFLAGS="$CFLAGS -m68881"
1.1.1.3 root 1025: else
1026: AC_MSG_RESULT(none)
1027: fi
1028: fi
1.1.1.4 root 1029:
1.1 root 1030: AC_SUBST(ac_cv_c_inline)
1.1.1.17 root 1031: AC_SUBST(WRCPRG)
1.1.1.4 root 1032: AC_SUBST(NO_SCHED_CFLAGS)
1.1.1.20! root 1033: AC_SUBST(NO_REORDER_CFLAGS)
1.1 root 1034: AC_SUBST(LIBRARIES)
1035: AC_SUBST(TARGET)
1036: AC_SUBST(GFXOBJS)
1.1.1.6 root 1037: AC_SUBST(RESOBJS)
1.1 root 1038: AC_SUBST(ASMOBJS)
1.1.1.10 root 1039: AC_SUBST(SCSIOBJS)
1.1.1.2 root 1040: AC_SUBST(CPUOBJS)
1.1.1.3 root 1041: AC_SUBST(DEBUGOBJS)
1.1.1.17 root 1042: AC_SUBST(FSDBOBJS)
1.1.1.2 root 1043: AC_SUBST(SET_MAKE)
1.1.1.3 root 1044: AC_SUBST(MATHLIB)
1.1.1.4 root 1045: AC_SUBST(SHM_SUPPORT_LINKS)
1046:
1.1.1.3 root 1047: AC_SUBST(top_srcdir)
1.1 root 1048:
1.1.1.20! root 1049: AC_CONFIG_FILES([src/Makefile Makefile])
! 1050: AC_OUTPUT
1.1.1.4 root 1051: if [[ "x$DO_PROFILING" = "xyes" ]]; then
1.1.1.3 root 1052: echo "Building a profiling version of UAE (select this option only if you know"
1053: echo "what you are doing)"
1054: fi
1.1.1.4 root 1055:
1056: dnl Create some more links and files.
1057:
1058: dnl We removed those from the build directory above, so if the source
1059: dnl directory still has them, something is fairly wrong.
1060:
1061: dnl This doesn't work with Solaris /bin/sh, neither do all the alternatives I
1.1.1.6 root 1062: dnl tried. It doesn't seem to cause a failure either, though.
1.1.1.4 root 1063:
1.1.1.10 root 1064: if test -f $abssrcdir/src/target.h
1.1.1.6 root 1065: then
1066: echo
1067: echo "Fatal error: Can't configure in the current directory, because"
1068: echo "configure was run in the source directory. Go to the source"
1069: echo "directory, type"
1070: echo " make streifenfrei"
1071: echo "and try again."
1072: exit 1
1073: fi
1.1.1.4 root 1074:
1075: ln -s $abssrcdir/src/$MACHDEP src/machdep
1076: ln -s $abssrcdir/src/$OSDEP src/osdep
1077: ln -s $abssrcdir/src/$THREADDEP src/threaddep
1078: ln -s $abssrcdir/src/$SOUNDDEP src/sounddep
1079:
1.1.1.10 root 1080: echo "#include \"$abssrcdir/src/targets/$TARGETDEP\"" > src/target.h
1081: echo "#include \"$abssrcdir/config.h\"" > src/config.h
1.1.1.6 root 1082:
1.1.1.10 root 1083: echo "#include \"$abssrcdir/src/$SOUNDDEP/sound.c\"" >src/sd-sound.c
1084: echo "#include \"$abssrcdir/src/$OD_JOYSTICK\"" >src/od-joy.c
1085: echo "#include \"$abssrcdir/src/$MACHDEP/support.c\"" >src/md-support.c
1086:
1.1.1.6 root 1087: if [[ "x$MACHDEP" = "xmd-i386-gcc" ]]; then
1.1.1.10 root 1088: echo "#include \"machdep/X86.S\"" >src/md-X86.S
1.1.1.6 root 1089: fi
1.1.1.11 root 1090: echo "#include \"$abssrcdir/src/include/$FPP_H\"" >src/md-fpp.h
1.1.1.6 root 1091:
1.1.1.17 root 1092: mkdir -p src/tools
1093: progname=$0
1094: changequote(,)dnl
1095: srcd=`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
1096: changequote([,])dnl
1097: topsrcdir=`cd $srcd; pwd`
1098: cd src/tools
1099: CC=$HOSTCC $topsrcdir/src/tools/configure
1.1.1.6 root 1100:
1.1.1.4 root 1101: echo
1102: echo
1103: if [[ "x$NR_ERRORS" = "x0" ]]; then
1104: if [[ "x$NR_WARNINGS" = "x0" ]]; then
1105: echo "Configuration was successful!"
1106: else
1107: echo "There were $NR_WARNINGS warnings. That is usually harmless, but read the output"
1108: echo "from configure carefully if you run into problems."
1109: fi
1110: else
1111: echo "There were $NR_ERRORS errors. UAE may still build and run cleanly, but you may"
1112: echo "not get all the features you asked for."
1113: fi
1114: echo
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.