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(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
11 |
> |
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
12 |
> |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
13 |
> |
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
14 |
|
|
15 |
|
dnl Checks for programs. |
16 |
|
AC_PROG_CC |
17 |
+ |
AC_PROG_CPP |
18 |
|
AC_PROG_CXX |
19 |
|
AC_PROG_MAKE_SET |
20 |
|
AC_PROG_INSTALL |
21 |
|
|
22 |
+ |
dnl We use mon if possible. |
23 |
+ |
MONSRCS= |
24 |
+ |
AC_MSG_CHECKING(for mon) |
25 |
+ |
if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then |
26 |
+ |
AC_MSG_RESULT(yes) |
27 |
+ |
WANT_MON=yes |
28 |
+ |
DEFINES="$DEFINES -DENABLE_MON=1" |
29 |
+ |
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" |
30 |
+ |
CXXFLAGS="$CXXFLAGS -I../../../mon/src" |
31 |
+ |
AC_CHECK_LIB(readline, readline) |
32 |
+ |
AC_CHECK_HEADERS(readline/readline.h readline/history.h) |
33 |
+ |
else |
34 |
+ |
AC_MSG_RESULT(no) |
35 |
+ |
WANT_MON=no |
36 |
+ |
DEFINES="$DEFINES -DENABLE_MON=0" |
37 |
+ |
fi |
38 |
+ |
|
39 |
|
dnl Checks for libraries. |
40 |
+ |
AC_CHECK_LIB(posix4, sem_init) |
41 |
+ |
|
42 |
+ |
dnl We need X11. |
43 |
|
AC_PATH_XTRA |
44 |
|
if [[ "x$no_x" = "xyes" ]]; then |
45 |
|
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
46 |
|
fi |
25 |
– |
|
47 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
48 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
49 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
29 |
– |
STATICLIBS= |
50 |
|
|
51 |
< |
dnl We need pthreads. |
52 |
< |
AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
53 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
54 |
< |
dnl Check even the libc_r (FreeBSD) |
55 |
< |
AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
56 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
57 |
< |
AC_MSG_ERROR([You need libpthreads to run Basilisk II.]) |
58 |
< |
else |
39 |
< |
LIBS="$LIBS -lc_r" |
40 |
< |
fi |
41 |
< |
else |
42 |
< |
LIBS="$LIBS -lpthread" |
43 |
< |
fi |
44 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
51 |
> |
dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
52 |
> |
AC_CHECK_LIB(pthread, pthread_create, , [ |
53 |
> |
AC_CHECK_LIB(c_r, pthread_create, , [ |
54 |
> |
AC_CHECK_LIB(PTL, pthread_create, , [ |
55 |
> |
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
56 |
> |
]) |
57 |
> |
]) |
58 |
> |
]) |
59 |
|
|
60 |
< |
dnl We use DGA if possible. |
61 |
< |
if [[ "x$WANT_DGA" = "xyes" ]]; then |
62 |
< |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no) |
63 |
< |
if [[ "x$HAVE_DGA" = "xno" ]]; then |
64 |
< |
AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga.]) |
65 |
< |
else |
66 |
< |
DEFINES="$DEFINES -DENABLE_DGA=1" |
60 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
61 |
> |
SEMSRCS= |
62 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
63 |
> |
SEMSRCS=posix_sem.cpp |
64 |
> |
]) |
65 |
> |
|
66 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
67 |
> |
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
68 |
> |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ |
69 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=1" |
70 |
|
LIBS="$LIBS -lXxf86dga" |
71 |
< |
fi |
71 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
72 |
> |
AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) |
73 |
> |
WANT_FBDEV_DGA=no |
74 |
> |
fi |
75 |
> |
], [ |
76 |
> |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
77 |
> |
WANT_XF86_DGA=no |
78 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
79 |
> |
]) |
80 |
> |
else |
81 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
82 |
> |
fi |
83 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
84 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=1" |
85 |
> |
else |
86 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0" |
87 |
|
fi |
88 |
|
|
89 |
|
dnl We use GTK+ if possible. |
90 |
< |
if [[ "x$WANT_UI" = "xyes" ]]; then |
91 |
< |
AM_PATH_GTK(1.2.0) |
92 |
< |
if [[ "x$no_gtk" = "xyes" ]]; then |
61 |
< |
echo "Did not find gtk+, disabling user interface." |
62 |
< |
WANT_UI=no |
63 |
< |
GTK_CFLAGS= |
64 |
< |
GTK_LIBS= |
65 |
< |
else |
90 |
> |
UISRCS=../dummy/prefs_editor_dummy.cpp |
91 |
> |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
92 |
> |
AM_PATH_GTK(1.2.0, [ |
93 |
|
DEFINES="$DEFINES -DENABLE_GTK=1" |
94 |
< |
fi |
95 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
96 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
97 |
< |
LIBS="$LIBS $GTK_LIBS" |
94 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
95 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
96 |
> |
LIBS="$LIBS $GTK_LIBS" |
97 |
> |
UISRCS=prefs_editor_gtk.cpp |
98 |
> |
], [ |
99 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
100 |
> |
WANT_GTK=no |
101 |
> |
]) |
102 |
|
fi |
103 |
|
|
104 |
< |
dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). |
105 |
< |
SEMSRCS= |
106 |
< |
AC_CHECK_FUNCS(sem_init) |
107 |
< |
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
108 |
< |
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
109 |
< |
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
110 |
< |
dnl Checks for the existance of semget |
111 |
< |
AC_CHECK_FUNCS(semget) |
112 |
< |
if [[ "x$ac_cv_func_semget" = "xno" ]]; then |
113 |
< |
AC_MSG_ERROR([You need POSIX.4 semaphores to run Basilisk II.]) |
114 |
< |
else |
84 |
< |
SEMSRCS="posix_sem.cpp" |
85 |
< |
fi |
86 |
< |
else |
87 |
< |
LIBS="$LIBS -lposix4" |
88 |
< |
fi |
104 |
> |
dnl We use ESD if possible. |
105 |
> |
if [[ "x$WANT_ESD" = "xyes" ]]; then |
106 |
> |
AM_PATH_ESD(0.2.8, [ |
107 |
> |
DEFINES="$DEFINES -DENABLE_ESD=1" |
108 |
> |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
109 |
> |
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" |
110 |
> |
LIBS="$LIBS $ESD_LIBS" |
111 |
> |
], [ |
112 |
> |
AC_MSG_WARN([Could not find ESD, disabling ESD support.]) |
113 |
> |
WANT_ESD=no |
114 |
> |
]) |
115 |
|
fi |
116 |
|
|
117 |
|
dnl Checks for header files. |
135 |
|
dnl Checks for library functions. |
136 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
137 |
|
AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) |
138 |
+ |
AC_CHECK_FUNCS(pthread_cancel) |
139 |
|
|
140 |
|
dnl Select system-dependant source files. |
141 |
|
SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" |
142 |
|
if MACHINE=`uname -a 2>/dev/null`; then |
143 |
|
case "$MACHINE" in |
144 |
|
Linux*) |
145 |
< |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" |
145 |
> |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" |
146 |
|
;; |
147 |
|
FreeBSD*3.*) |
148 |
|
dnl Check for the CAM library |
157 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
158 |
|
AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) |
159 |
|
fi |
160 |
< |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" |
160 |
> |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" |
161 |
|
CXXFLAGS="$CXXFLAGS -I/sys" |
162 |
|
CFLAGS="$CFLAGS -I/sys" |
163 |
|
LIBS="$LIBS -lcam" |
190 |
|
LIBS="$LIBS -lm" |
191 |
|
;; |
192 |
|
esac |
166 |
– |
if [[ "x$WANT_UI" = "xyes" ]]; then |
167 |
– |
SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" |
168 |
– |
else |
169 |
– |
SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" |
170 |
– |
fi |
193 |
|
fi |
194 |
< |
if [[ "x$SEMSRCS" != "x" ]]; then |
173 |
< |
SYSSRCS="$SYSSRCS $SEMSRCS" |
174 |
< |
fi |
175 |
< |
|
176 |
< |
dnl Defaults for UAE CPU. |
177 |
< |
CPUINCLUDES="-I../uae_cpu" |
178 |
< |
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" |
194 |
> |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS" |
195 |
|
|
196 |
< |
dnl Check for i386. |
196 |
> |
dnl Check for i386 CPU. |
197 |
|
HAVE_I386=no |
198 |
|
AC_MSG_CHECKING(for x86 target CPU) |
199 |
|
AC_EGREP_CPP(yes, |
203 |
|
#endif |
204 |
|
], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no)) |
205 |
|
|
206 |
+ |
dnl Check for SPARC CPU. |
207 |
+ |
HAVE_SPARC=no |
208 |
+ |
AC_MSG_CHECKING(for SPARC target CPU) |
209 |
+ |
AC_EGREP_CPP(yes, |
210 |
+ |
[ |
211 |
+ |
#ifdef __sparc__ |
212 |
+ |
yes |
213 |
+ |
#endif |
214 |
+ |
], [AC_MSG_RESULT(yes); HAVE_SPARC=yes], AC_MSG_RESULT(no)) |
215 |
+ |
|
216 |
|
dnl Check for GAS. |
217 |
|
HAVE_GAS=no |
218 |
|
AC_MSG_CHECKING(for GAS .p2align feature) |
232 |
|
#endif |
233 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
234 |
|
|
235 |
< |
dnl Set "-fomit-frame-pointer" on GCC. |
235 |
> |
dnl Set "-fomit-frame-pointer" on GCC 2.7 or higher. |
236 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
237 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
238 |
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
239 |
|
fi |
240 |
|
|
241 |
|
dnl Select appropriate CPU source and REGPARAM define. |
242 |
+ |
WANT_X86_ASSEMBLY=no |
243 |
+ |
WANT_SPARC_V8_ASSEMBLY=no |
244 |
+ |
WANT_SPARC_V9_ASSEMBLY=no |
245 |
+ |
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
246 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
247 |
+ |
dnl i386 CPU |
248 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
249 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
250 |
+ |
WANT_X86_ASSEMBLY=yes |
251 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY" |
252 |
< |
CPUSRCS="$CPUSRCS cpufast.s" |
221 |
< |
else |
222 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
252 |
> |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
253 |
|
fi |
254 |
< |
else |
255 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
254 |
> |
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
255 |
> |
dnl SPARC CPU |
256 |
> |
case "$MACHINE" in |
257 |
> |
SunOS*) |
258 |
> |
AC_MSG_CHECKING(SPARC CPU architecture) |
259 |
> |
SPARC_TYPE=`Solaris/which_sparc` |
260 |
> |
AC_MSG_RESULT($SPARC_TYPE) |
261 |
> |
case "$SPARC_TYPE" in |
262 |
> |
SPARC_V8) |
263 |
> |
WANT_SPARC_V8_ASSEMBLY=yes |
264 |
> |
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" |
265 |
> |
CFLAGS="$CFLAGS -Wa,-Av8" |
266 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
267 |
> |
;; |
268 |
> |
SPARC_V9) |
269 |
> |
WANT_SPARC_V9_ASSEMBLY=yes |
270 |
> |
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" |
271 |
> |
CFLAGS="$CFLAGS -Wa,-Av9" |
272 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
273 |
> |
;; |
274 |
> |
esac |
275 |
> |
;; |
276 |
> |
esac |
277 |
|
fi |
278 |
|
|
279 |
+ |
dnl UAE CPU sources for all architectures. |
280 |
+ |
CPUINCLUDES="-I../uae_cpu" |
281 |
+ |
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" |
282 |
+ |
|
283 |
|
dnl Generate Makefile. |
284 |
|
AC_SUBST(DEFINES) |
230 |
– |
AC_SUBST(STATICLIBS) |
285 |
|
AC_SUBST(SYSSRCS) |
286 |
|
AC_SUBST(CPUINCLUDES) |
287 |
|
AC_SUBST(CPUSRCS) |
288 |
|
AC_OUTPUT(Makefile) |
289 |
+ |
|
290 |
+ |
dnl Print summary. |
291 |
+ |
echo |
292 |
+ |
echo Basilisk II configuration summary: |
293 |
+ |
echo |
294 |
+ |
echo XFree86 DGA support .............. : $WANT_XF86_DGA |
295 |
+ |
echo fbdev DGA support ................ : $WANT_FBDEV_DGA |
296 |
+ |
echo ESD sound support ................ : $WANT_ESD |
297 |
+ |
echo GTK user interface ............... : $WANT_GTK |
298 |
+ |
echo mon debugger support ............. : $WANT_MON |
299 |
+ |
echo i386 assembly optimizations ...... : $WANT_X86_ASSEMBLY |
300 |
+ |
echo SPARC V8 assembly optimizations .. : $WANT_SPARC_V8_ASSEMBLY |
301 |
+ |
echo SPARC V9 assembly optimizations .. : $WANT_SPARC_V9_ASSEMBLY |
302 |
+ |
echo |
303 |
|
echo "Configuration done. Now type \"make\"." |