6 |
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
8 |
|
dnl Options. |
9 |
< |
WANT_DGA=yes |
10 |
< |
WANT_UI=yes |
11 |
< |
AC_ARG_ENABLE(dga, [ --enable-dga use the DGA extension (default)], [WANT_DGA=$enableval], []) |
12 |
< |
AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface (default)], [WANT_UI=$enableval], []) |
9 |
> |
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
10 |
> |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
11 |
> |
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
12 |
> |
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
13 |
> |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
14 |
> |
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
15 |
|
|
16 |
|
dnl Checks for programs. |
17 |
|
AC_PROG_CC |
20 |
|
AC_PROG_MAKE_SET |
21 |
|
AC_PROG_INSTALL |
22 |
|
|
23 |
+ |
dnl We use mon if possible. |
24 |
+ |
MONSRCS= |
25 |
+ |
AC_MSG_CHECKING(for mon) |
26 |
+ |
if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then |
27 |
+ |
AC_MSG_RESULT(yes) |
28 |
+ |
WANT_MON=yes |
29 |
+ |
DEFINES="$DEFINES -DENABLE_MON=1" |
30 |
+ |
MONSRCS="../../../mon/src/mon.cpp ../../../mon/src/mon_6502.cpp ../../../mon/src/mon_68k.cpp ../../../mon/src/mon_8080.cpp ../../../mon/src/mon_cmd.cpp ../../../mon/src/mon_ppc.cpp ../../../mon/src/mon_x86.cpp" |
31 |
+ |
CXXFLAGS="$CXXFLAGS -I../../../mon/src" |
32 |
+ |
AC_CHECK_LIB(readline, readline) |
33 |
+ |
AC_CHECK_HEADERS(readline/readline.h readline/history.h) |
34 |
+ |
else |
35 |
+ |
AC_MSG_RESULT(no) |
36 |
+ |
WANT_MON=no |
37 |
+ |
DEFINES="$DEFINES -DENABLE_MON=0" |
38 |
+ |
fi |
39 |
+ |
|
40 |
|
dnl Checks for libraries. |
41 |
+ |
AC_CHECK_LIB(posix4, sem_init) |
42 |
+ |
|
43 |
+ |
dnl We need X11. |
44 |
|
AC_PATH_XTRA |
45 |
|
if [[ "x$no_x" = "xyes" ]]; then |
46 |
|
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
47 |
|
fi |
26 |
– |
|
48 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
49 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
50 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
30 |
– |
STATICLIBS= |
51 |
|
|
52 |
< |
dnl We need pthreads. |
53 |
< |
AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
54 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
55 |
< |
dnl Check even the libc_r (FreeBSD) |
56 |
< |
AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
57 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
58 |
< |
AC_MSG_ERROR([You need libpthreads to run Basilisk II.]) |
59 |
< |
else |
60 |
< |
LIBS="$LIBS -lc_r" |
61 |
< |
fi |
52 |
> |
dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
53 |
> |
AC_CHECK_LIB(pthread, pthread_create, , [ |
54 |
> |
AC_CHECK_LIB(c_r, pthread_create, , [ |
55 |
> |
AC_CHECK_LIB(PTL, pthread_create, , [ |
56 |
> |
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
57 |
> |
]) |
58 |
> |
]) |
59 |
> |
]) |
60 |
> |
|
61 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
62 |
> |
SEMSRCS= |
63 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
64 |
> |
SEMSRCS=posix_sem.cpp |
65 |
> |
]) |
66 |
> |
|
67 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
68 |
> |
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
69 |
> |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ |
70 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=1" |
71 |
> |
LIBS="$LIBS -lXxf86dga" |
72 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
73 |
> |
AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) |
74 |
> |
WANT_FBDEV_DGA=no |
75 |
> |
fi |
76 |
> |
], [ |
77 |
> |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
78 |
> |
WANT_XF86_DGA=no |
79 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
80 |
> |
]) |
81 |
|
else |
82 |
< |
LIBS="$LIBS -lpthread" |
82 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
83 |
> |
fi |
84 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
85 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=1" |
86 |
> |
else |
87 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0" |
88 |
|
fi |
45 |
– |
AC_CHECK_FUNCS(pthread_cancel) |
89 |
|
|
90 |
< |
dnl We use DGA if possible. |
91 |
< |
if [[ "x$WANT_DGA" = "xyes" ]]; then |
92 |
< |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no) |
93 |
< |
if [[ "x$HAVE_DGA" = "xno" ]]; then |
94 |
< |
AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga.]) |
95 |
< |
else |
96 |
< |
DEFINES="$DEFINES -DENABLE_DGA=1" |
97 |
< |
LIBS="$LIBS -lXxf86dga" |
98 |
< |
fi |
90 |
> |
dnl We use XFree86 VidMode if possible. |
91 |
> |
if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then |
92 |
> |
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [ |
93 |
> |
DEFINES="$DEFINES -DENABLE_XF86_VIDMODE=1" |
94 |
> |
LIBS="$LIBS -lXxf86vm" |
95 |
> |
], [ |
96 |
> |
AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.]) |
97 |
> |
WANT_XF86_VIDMODE=no |
98 |
> |
DEFINES="$DEFINES -DENABLE_XF86_VIDMODE=0" |
99 |
> |
]) |
100 |
|
fi |
101 |
|
|
102 |
|
dnl We use GTK+ if possible. |
103 |
< |
if [[ "x$WANT_UI" = "xyes" ]]; then |
104 |
< |
AM_PATH_GTK(1.2.0) |
105 |
< |
if [[ "x$no_gtk" = "xyes" ]]; then |
62 |
< |
echo "Did not find gtk+, disabling user interface." |
63 |
< |
WANT_UI=no |
64 |
< |
GTK_CFLAGS= |
65 |
< |
GTK_LIBS= |
66 |
< |
else |
103 |
> |
UISRCS=../dummy/prefs_editor_dummy.cpp |
104 |
> |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
105 |
> |
AM_PATH_GTK(1.2.0, [ |
106 |
|
DEFINES="$DEFINES -DENABLE_GTK=1" |
107 |
< |
fi |
108 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
109 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
110 |
< |
LIBS="$LIBS $GTK_LIBS" |
107 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
108 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
109 |
> |
LIBS="$LIBS $GTK_LIBS" |
110 |
> |
UISRCS=prefs_editor_gtk.cpp |
111 |
> |
], [ |
112 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
113 |
> |
WANT_GTK=no |
114 |
> |
DEFINES="$DEFINES -DENABLE_GTK=0" |
115 |
> |
]) |
116 |
|
fi |
117 |
|
|
118 |
< |
dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). |
119 |
< |
SEMSRCS= |
120 |
< |
AC_CHECK_FUNCS(sem_init) |
121 |
< |
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
122 |
< |
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
123 |
< |
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
124 |
< |
dnl Checks for the existance of semget |
125 |
< |
AC_CHECK_FUNCS(semget) |
126 |
< |
if [[ "x$ac_cv_func_semget" = "xno" ]]; then |
127 |
< |
AC_MSG_ERROR([You need POSIX.4 semaphores to run Basilisk II.]) |
128 |
< |
else |
129 |
< |
SEMSRCS="posix_sem.cpp" |
86 |
< |
fi |
87 |
< |
else |
88 |
< |
LIBS="$LIBS -lposix4" |
89 |
< |
fi |
118 |
> |
dnl We use ESD if possible. |
119 |
> |
if [[ "x$WANT_ESD" = "xyes" ]]; then |
120 |
> |
AM_PATH_ESD(0.2.8, [ |
121 |
> |
DEFINES="$DEFINES -DENABLE_ESD=1" |
122 |
> |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
123 |
> |
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" |
124 |
> |
LIBS="$LIBS $ESD_LIBS" |
125 |
> |
], [ |
126 |
> |
AC_MSG_WARN([Could not find ESD, disabling ESD support.]) |
127 |
> |
WANT_ESD=no |
128 |
> |
DEFINES="$DEFINES -DENABLE_ESD=0" |
129 |
> |
]) |
130 |
|
fi |
131 |
|
|
132 |
|
dnl Checks for header files. |
150 |
|
dnl Checks for library functions. |
151 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
152 |
|
AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) |
153 |
+ |
AC_CHECK_FUNCS(pthread_cancel) |
154 |
|
|
155 |
|
dnl Select system-dependant source files. |
156 |
|
SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" |
157 |
|
if MACHINE=`uname -a 2>/dev/null`; then |
158 |
|
case "$MACHINE" in |
159 |
|
Linux*) |
160 |
< |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" |
160 |
> |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" |
161 |
|
;; |
162 |
|
FreeBSD*3.*) |
163 |
|
dnl Check for the CAM library |
172 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
173 |
|
AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) |
174 |
|
fi |
175 |
< |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" |
175 |
> |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" |
176 |
|
CXXFLAGS="$CXXFLAGS -I/sys" |
177 |
|
CFLAGS="$CFLAGS -I/sys" |
178 |
|
LIBS="$LIBS -lcam" |
205 |
|
LIBS="$LIBS -lm" |
206 |
|
;; |
207 |
|
esac |
167 |
– |
if [[ "x$WANT_UI" = "xyes" ]]; then |
168 |
– |
SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" |
169 |
– |
else |
170 |
– |
SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" |
171 |
– |
fi |
208 |
|
fi |
209 |
< |
if [[ "x$SEMSRCS" != "x" ]]; then |
174 |
< |
SYSSRCS="$SYSSRCS $SEMSRCS" |
175 |
< |
fi |
176 |
< |
|
177 |
< |
dnl Defaults for UAE CPU. |
178 |
< |
CPUINCLUDES="-I../uae_cpu" |
179 |
< |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp ../uae_cpu/fpp.cpp cpustbl.cpp cpudefs.cpp" |
209 |
> |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS" |
210 |
|
|
211 |
< |
dnl Check for i386. |
211 |
> |
dnl Check for i386 CPU. |
212 |
|
HAVE_I386=no |
213 |
|
AC_MSG_CHECKING(for x86 target CPU) |
214 |
|
AC_EGREP_CPP(yes, |
218 |
|
#endif |
219 |
|
], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no)) |
220 |
|
|
221 |
+ |
dnl Check for SPARC CPU. |
222 |
+ |
HAVE_SPARC=no |
223 |
+ |
AC_MSG_CHECKING(for SPARC target CPU) |
224 |
+ |
AC_EGREP_CPP(yes, |
225 |
+ |
[ |
226 |
+ |
#ifdef __sparc__ |
227 |
+ |
yes |
228 |
+ |
#endif |
229 |
+ |
], [AC_MSG_RESULT(yes); HAVE_SPARC=yes], AC_MSG_RESULT(no)) |
230 |
+ |
|
231 |
|
dnl Check for GAS. |
232 |
|
HAVE_GAS=no |
233 |
|
AC_MSG_CHECKING(for GAS .p2align feature) |
247 |
|
#endif |
248 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
249 |
|
|
250 |
< |
dnl Set "-fomit-frame-pointer" on GCC. |
250 |
> |
dnl Set "-fomit-frame-pointer" on GCC 2.7 or higher. |
251 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
252 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
253 |
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
254 |
|
fi |
255 |
|
|
256 |
|
dnl Select appropriate CPU source and REGPARAM define. |
257 |
+ |
WANT_X86_ASSEMBLY=no |
258 |
+ |
WANT_SPARC_V8_ASSEMBLY=no |
259 |
+ |
WANT_SPARC_V9_ASSEMBLY=no |
260 |
+ |
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
261 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
262 |
+ |
dnl i386 CPU |
263 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
264 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
265 |
+ |
WANT_X86_ASSEMBLY=yes |
266 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY" |
267 |
< |
CPUSRCS="$CPUSRCS cpufast.s" |
222 |
< |
else |
223 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
267 |
> |
CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
268 |
|
fi |
269 |
< |
else |
270 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
269 |
> |
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
270 |
> |
dnl SPARC CPU |
271 |
> |
case "$MACHINE" in |
272 |
> |
SunOS*) |
273 |
> |
AC_MSG_CHECKING(SPARC CPU architecture) |
274 |
> |
SPARC_TYPE=`Solaris/which_sparc` |
275 |
> |
AC_MSG_RESULT($SPARC_TYPE) |
276 |
> |
case "$SPARC_TYPE" in |
277 |
> |
SPARC_V8) |
278 |
> |
WANT_SPARC_V8_ASSEMBLY=yes |
279 |
> |
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" |
280 |
> |
CFLAGS="$CFLAGS -Wa,-Av8" |
281 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
282 |
> |
;; |
283 |
> |
SPARC_V9) |
284 |
> |
WANT_SPARC_V9_ASSEMBLY=yes |
285 |
> |
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" |
286 |
> |
CFLAGS="$CFLAGS -Wa,-Av9" |
287 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
288 |
> |
;; |
289 |
> |
esac |
290 |
> |
;; |
291 |
> |
esac |
292 |
|
fi |
293 |
|
|
294 |
+ |
dnl UAE CPU sources for all architectures. |
295 |
+ |
CPUINCLUDES="-I../uae_cpu" |
296 |
+ |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp ../uae_cpu/fpp.cpp cpustbl.cpp cpudefs.cpp $CPUSRCS" |
297 |
+ |
|
298 |
|
dnl Generate Makefile. |
299 |
|
AC_SUBST(DEFINES) |
231 |
– |
AC_SUBST(STATICLIBS) |
300 |
|
AC_SUBST(SYSSRCS) |
301 |
|
AC_SUBST(CPUINCLUDES) |
302 |
|
AC_SUBST(CPUSRCS) |
303 |
|
AC_OUTPUT(Makefile) |
304 |
+ |
|
305 |
+ |
dnl Print summary. |
306 |
+ |
echo |
307 |
+ |
echo Basilisk II configuration summary: |
308 |
+ |
echo |
309 |
+ |
echo XFree86 DGA support .............. : $WANT_XF86_DGA |
310 |
+ |
echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE |
311 |
+ |
echo fbdev DGA support ................ : $WANT_FBDEV_DGA |
312 |
+ |
echo ESD sound support ................ : $WANT_ESD |
313 |
+ |
echo GTK user interface ............... : $WANT_GTK |
314 |
+ |
echo mon debugger support ............. : $WANT_MON |
315 |
+ |
echo i386 assembly optimizations ...... : $WANT_X86_ASSEMBLY |
316 |
+ |
echo SPARC V8 assembly optimizations .. : $WANT_SPARC_V8_ASSEMBLY |
317 |
+ |
echo SPARC V9 assembly optimizations .. : $WANT_SPARC_V9_ASSEMBLY |
318 |
+ |
echo |
319 |
|
echo "Configuration done. Now type \"make\"." |