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