6 |
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
8 |
|
dnl Options. |
9 |
< |
WANT_DGA=yes |
9 |
> |
WANT_XF86_DGA=yes |
10 |
> |
WANT_FBDEV_DGA=yes |
11 |
> |
WANT_ESD=yes |
12 |
|
WANT_UI=yes |
13 |
< |
AC_ARG_ENABLE(dga, [ --enable-dga use the DGA extension (default)], [WANT_DGA=$enableval], []) |
14 |
< |
AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface (default)], [WANT_UI=$enableval], []) |
13 |
> |
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], []) |
14 |
> |
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], []) |
15 |
> |
AC_ARG_ENABLE(esd, [ --enable-esd Enlightened Sound Daemon support [default=yes]], [WANT_ESD=$enableval], []) |
16 |
> |
AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface [default=yes]], [WANT_UI=$enableval], []) |
17 |
|
|
18 |
|
dnl Checks for programs. |
19 |
|
AC_PROG_CC |
23 |
|
AC_PROG_INSTALL |
24 |
|
|
25 |
|
dnl Checks for libraries. |
26 |
+ |
AC_CHECK_LIB(posix4, sem_init) |
27 |
+ |
|
28 |
+ |
dnl We need X11. |
29 |
|
AC_PATH_XTRA |
30 |
|
if [[ "x$no_x" = "xyes" ]]; then |
31 |
|
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
32 |
|
fi |
26 |
– |
|
33 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
34 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
35 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
30 |
– |
STATICLIBS= |
36 |
|
|
37 |
< |
dnl We need pthreads. |
38 |
< |
AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
39 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
40 |
< |
dnl Check even the libc_r (FreeBSD) |
36 |
< |
AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
37 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
38 |
< |
dnl Or maybe the user has PTL (NetBSD) |
39 |
< |
AC_CHECK_LIB(PTL, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
40 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
37 |
> |
dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
38 |
> |
AC_CHECK_LIB(pthread, pthread_create, , [ |
39 |
> |
AC_CHECK_LIB(c_r, pthread_create, , [ |
40 |
> |
AC_CHECK_LIB(PTL, pthread_create, , [ |
41 |
|
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
42 |
< |
else |
43 |
< |
LIBS="$LIBS -lPTL" |
42 |
> |
]) |
43 |
> |
]) |
44 |
> |
]) |
45 |
> |
|
46 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
47 |
> |
SEMSRCS= |
48 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
49 |
> |
SEMSRCS=posix_sem.cpp |
50 |
> |
]) |
51 |
> |
|
52 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
53 |
> |
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
54 |
> |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ |
55 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=1" |
56 |
> |
LIBS="$LIBS -lXxf86dga" |
57 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
58 |
> |
AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) |
59 |
> |
WANT_FBDEV_DGA=no |
60 |
|
fi |
61 |
< |
else |
62 |
< |
LIBS="$LIBS -lc_r" |
63 |
< |
fi |
61 |
> |
], [ |
62 |
> |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
63 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
64 |
> |
]) |
65 |
|
else |
66 |
< |
LIBS="$LIBS -lpthread" |
66 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
67 |
|
fi |
68 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
69 |
< |
|
70 |
< |
dnl We use DGA if possible. |
71 |
< |
if [[ "x$WANT_DGA" = "xyes" ]]; then |
55 |
< |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no) |
56 |
< |
if [[ "x$HAVE_DGA" = "xno" ]]; then |
57 |
< |
AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga.]) |
58 |
< |
else |
59 |
< |
DEFINES="$DEFINES -DENABLE_DGA=1" |
60 |
< |
LIBS="$LIBS -lXxf86dga" |
61 |
< |
fi |
68 |
> |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
69 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=1" |
70 |
> |
else |
71 |
> |
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0" |
72 |
|
fi |
73 |
|
|
74 |
|
dnl We use GTK+ if possible. |
75 |
+ |
UISRCS=../dummy/prefs_editor_dummy.cpp |
76 |
|
if [[ "x$WANT_UI" = "xyes" ]]; then |
77 |
< |
AM_PATH_GTK(1.2.0) |
67 |
< |
if [[ "x$no_gtk" = "xyes" ]]; then |
68 |
< |
echo "Did not find gtk+, disabling user interface." |
69 |
< |
WANT_UI=no |
70 |
< |
GTK_CFLAGS= |
71 |
< |
GTK_LIBS= |
72 |
< |
else |
77 |
> |
AM_PATH_GTK(1.2.0, [ |
78 |
|
DEFINES="$DEFINES -DENABLE_GTK=1" |
79 |
< |
fi |
80 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
81 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
82 |
< |
LIBS="$LIBS $GTK_LIBS" |
79 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
80 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
81 |
> |
LIBS="$LIBS $GTK_LIBS" |
82 |
> |
UISRCS=prefs_editor_gtk.cpp |
83 |
> |
], [ |
84 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
85 |
> |
WANT_UI=no |
86 |
> |
]) |
87 |
|
fi |
88 |
|
|
89 |
< |
dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). |
90 |
< |
SEMSRCS= |
91 |
< |
AC_CHECK_FUNCS(sem_init) |
92 |
< |
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
93 |
< |
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
94 |
< |
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
95 |
< |
dnl Emulate semaphores with pthread mutexes |
96 |
< |
SEMSRCS="posix_sem.cpp" |
97 |
< |
else |
98 |
< |
LIBS="$LIBS -lposix4" |
99 |
< |
fi |
89 |
> |
dnl We use ESD if possible. |
90 |
> |
if [[ "x$WANT_ESD" = "xyes" ]]; then |
91 |
> |
AM_PATH_ESD(0.2.8, [ |
92 |
> |
DEFINES="$DEFINES -DENABLE_ESD=1" |
93 |
> |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
94 |
> |
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" |
95 |
> |
LIBS="$LIBS $ESD_LIBS" |
96 |
> |
], [ |
97 |
> |
AC_MSG_WARN([Could not find ESD, disabling ESD support.]) |
98 |
> |
WANT_ESD=no |
99 |
> |
]) |
100 |
|
fi |
101 |
|
|
102 |
|
dnl Checks for header files. |
120 |
|
dnl Checks for library functions. |
121 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
122 |
|
AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) |
123 |
+ |
AC_CHECK_FUNCS(pthread_cancel) |
124 |
|
|
125 |
|
dnl Select system-dependant source files. |
126 |
|
SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" |
127 |
|
if MACHINE=`uname -a 2>/dev/null`; then |
128 |
|
case "$MACHINE" in |
129 |
|
Linux*) |
130 |
< |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" |
130 |
> |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" |
131 |
|
;; |
132 |
|
FreeBSD*3.*) |
133 |
|
dnl Check for the CAM library |
142 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
143 |
|
AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) |
144 |
|
fi |
145 |
< |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" |
145 |
> |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" |
146 |
|
CXXFLAGS="$CXXFLAGS -I/sys" |
147 |
|
CFLAGS="$CFLAGS -I/sys" |
148 |
|
LIBS="$LIBS -lcam" |
175 |
|
LIBS="$LIBS -lm" |
176 |
|
;; |
177 |
|
esac |
168 |
– |
if [[ "x$WANT_UI" = "xyes" ]]; then |
169 |
– |
SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" |
170 |
– |
else |
171 |
– |
SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" |
172 |
– |
fi |
173 |
– |
fi |
174 |
– |
if [[ "x$SEMSRCS" != "x" ]]; then |
175 |
– |
SYSSRCS="$SYSSRCS $SEMSRCS" |
178 |
|
fi |
179 |
+ |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS" |
180 |
|
|
181 |
< |
dnl Defaults for UAE CPU. |
179 |
< |
CPUINCLUDES="-I../uae_cpu" |
180 |
< |
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" |
181 |
< |
|
182 |
< |
dnl Check for i386. |
181 |
> |
dnl Check for i386 CPU. |
182 |
|
HAVE_I386=no |
183 |
|
AC_MSG_CHECKING(for x86 target CPU) |
184 |
|
AC_EGREP_CPP(yes, |
188 |
|
#endif |
189 |
|
], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no)) |
190 |
|
|
191 |
+ |
dnl Check for SPARC CPU. |
192 |
+ |
HAVE_SPARC=no |
193 |
+ |
AC_MSG_CHECKING(for SPARC target CPU) |
194 |
+ |
AC_EGREP_CPP(yes, |
195 |
+ |
[ |
196 |
+ |
#ifdef __sparc__ |
197 |
+ |
yes |
198 |
+ |
#endif |
199 |
+ |
], [AC_MSG_RESULT(yes); HAVE_SPARC=yes], AC_MSG_RESULT(no)) |
200 |
+ |
|
201 |
|
dnl Check for GAS. |
202 |
|
HAVE_GAS=no |
203 |
|
AC_MSG_CHECKING(for GAS .p2align feature) |
217 |
|
#endif |
218 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
219 |
|
|
220 |
< |
dnl Set "-fomit-frame-pointer" on GCC. |
220 |
> |
dnl Set "-fomit-frame-pointer" on GCC 2.7 or higher. |
221 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
222 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
223 |
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
224 |
|
fi |
225 |
|
|
226 |
|
dnl Select appropriate CPU source and REGPARAM define. |
227 |
+ |
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
228 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
229 |
+ |
dnl i386 CPU |
230 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
231 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
232 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY" |
233 |
< |
CPUSRCS="$CPUSRCS cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
223 |
< |
else |
224 |
< |
CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
233 |
> |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
234 |
|
fi |
235 |
< |
else |
236 |
< |
CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
235 |
> |
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
236 |
> |
dnl SPARC CPU |
237 |
> |
case "$MACHINE" in |
238 |
> |
SunOS*) |
239 |
> |
AC_MSG_CHECKING(SPARC CPU architecture) |
240 |
> |
SPARC_TYPE=`Solaris/which_sparc` |
241 |
> |
AC_MSG_RESULT($SPARC_TYPE) |
242 |
> |
case "$SPARC_TYPE" in |
243 |
> |
SPARC_V8) |
244 |
> |
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" |
245 |
> |
CFLAGS="$CFLAGS -Wa,-Av8" |
246 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
247 |
> |
;; |
248 |
> |
SPARC_V9) |
249 |
> |
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" |
250 |
> |
CFLAGS="$CFLAGS -Wa,-Av9" |
251 |
> |
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
252 |
> |
;; |
253 |
> |
esac |
254 |
> |
;; |
255 |
> |
esac |
256 |
|
fi |
257 |
|
|
258 |
+ |
dnl UAE CPU sources for all architectures. |
259 |
+ |
CPUINCLUDES="-I../uae_cpu" |
260 |
+ |
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" |
261 |
+ |
|
262 |
|
dnl Generate Makefile. |
263 |
|
AC_SUBST(DEFINES) |
232 |
– |
AC_SUBST(STATICLIBS) |
264 |
|
AC_SUBST(SYSSRCS) |
265 |
|
AC_SUBST(CPUINCLUDES) |
266 |
|
AC_SUBST(CPUSRCS) |