6 |
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
8 |
|
dnl Options. |
9 |
< |
WANT_XF86_DGA=yes |
10 |
< |
WANT_FBDEV_DGA=yes |
11 |
< |
WANT_UI=yes |
12 |
< |
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension (default)], [WANT_XF86_DGA=$enableval], []) |
13 |
< |
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb (default)], [WANT_FBDEV_DGA=$enableval], []) |
14 |
< |
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_ENABLE(esd, [ --enable-esd Enlightened Sound Daemon support [default=yes]], [WANT_ESD=$enableval], [WANT_ESD=yes]) |
12 |
> |
AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface [default=yes]], [WANT_UI=$enableval], [WANT_UI=yes]) |
13 |
|
|
14 |
|
dnl Checks for programs. |
15 |
|
AC_PROG_CC |
18 |
|
AC_PROG_MAKE_SET |
19 |
|
AC_PROG_INSTALL |
20 |
|
|
21 |
+ |
dnl We use mon if possible. |
22 |
+ |
MONSRCS= |
23 |
+ |
AC_MSG_CHECKING(for mon) |
24 |
+ |
if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then |
25 |
+ |
AC_MSG_RESULT(yes) |
26 |
+ |
WANT_MON=yes |
27 |
+ |
DEFINES="$DEFINES -DENABLE_MON=1" |
28 |
+ |
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" |
29 |
+ |
CXXFLAGS="$CXXFLAGS -I../../../mon/src" |
30 |
+ |
else |
31 |
+ |
AC_MSG_RESULT(no) |
32 |
+ |
WANT_MON=no |
33 |
+ |
DEFINES="$DEFINES -DENABLE_MON=0" |
34 |
+ |
fi |
35 |
+ |
|
36 |
|
dnl Checks for libraries. |
37 |
+ |
AC_CHECK_LIB(posix4, sem_init) |
38 |
+ |
|
39 |
+ |
dnl We need X11. |
40 |
|
AC_PATH_XTRA |
41 |
|
if [[ "x$no_x" = "xyes" ]]; then |
42 |
|
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
43 |
|
fi |
28 |
– |
|
44 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
45 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
46 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
32 |
– |
STATICLIBS= |
47 |
|
|
48 |
< |
dnl We need pthreads. |
49 |
< |
AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
50 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
51 |
< |
dnl Check even the libc_r (FreeBSD) |
38 |
< |
AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
39 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
40 |
< |
dnl Or maybe the user has PTL (NetBSD) |
41 |
< |
AC_CHECK_LIB(PTL, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
42 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
48 |
> |
dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
49 |
> |
AC_CHECK_LIB(pthread, pthread_create, , [ |
50 |
> |
AC_CHECK_LIB(c_r, pthread_create, , [ |
51 |
> |
AC_CHECK_LIB(PTL, pthread_create, , [ |
52 |
|
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
53 |
< |
else |
54 |
< |
LIBS="$LIBS -lPTL" |
55 |
< |
fi |
47 |
< |
else |
48 |
< |
LIBS="$LIBS -lc_r" |
49 |
< |
fi |
50 |
< |
else |
51 |
< |
LIBS="$LIBS -lpthread" |
52 |
< |
fi |
53 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
53 |
> |
]) |
54 |
> |
]) |
55 |
> |
]) |
56 |
|
|
57 |
< |
dnl We use DGA if possible. |
57 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
58 |
> |
SEMSRCS= |
59 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
60 |
> |
SEMSRCS=posix_sem.cpp |
61 |
> |
]) |
62 |
> |
|
63 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
64 |
|
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
65 |
< |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no) |
58 |
< |
if [[ "x$HAVE_DGA" = "xno" ]]; then |
59 |
< |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
60 |
< |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
61 |
< |
else |
65 |
> |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ |
66 |
|
DEFINES="$DEFINES -DENABLE_XF86_DGA=1" |
67 |
|
LIBS="$LIBS -lXxf86dga" |
68 |
|
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
69 |
|
AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) |
70 |
|
WANT_FBDEV_DGA=no |
71 |
|
fi |
72 |
< |
fi |
72 |
> |
], [ |
73 |
> |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
74 |
> |
WANT_XF86_DGA=no |
75 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
76 |
> |
]) |
77 |
|
else |
78 |
|
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
79 |
|
fi |
84 |
|
fi |
85 |
|
|
86 |
|
dnl We use GTK+ if possible. |
87 |
+ |
UISRCS=../dummy/prefs_editor_dummy.cpp |
88 |
|
if [[ "x$WANT_UI" = "xyes" ]]; then |
89 |
< |
AM_PATH_GTK(1.2.0) |
81 |
< |
if [[ "x$no_gtk" = "xyes" ]]; then |
82 |
< |
echo "Did not find gtk+, disabling user interface." |
83 |
< |
WANT_UI=no |
84 |
< |
GTK_CFLAGS= |
85 |
< |
GTK_LIBS= |
86 |
< |
else |
89 |
> |
AM_PATH_GTK(1.2.0, [ |
90 |
|
DEFINES="$DEFINES -DENABLE_GTK=1" |
91 |
< |
fi |
92 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
93 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
94 |
< |
LIBS="$LIBS $GTK_LIBS" |
91 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
92 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
93 |
> |
LIBS="$LIBS $GTK_LIBS" |
94 |
> |
UISRCS=prefs_editor_gtk.cpp |
95 |
> |
], [ |
96 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
97 |
> |
WANT_UI=no |
98 |
> |
]) |
99 |
|
fi |
100 |
|
|
101 |
< |
dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). |
102 |
< |
SEMSRCS= |
103 |
< |
AC_CHECK_FUNCS(sem_init) |
104 |
< |
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
105 |
< |
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
106 |
< |
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
107 |
< |
dnl Emulate semaphores with pthread mutexes |
108 |
< |
SEMSRCS="posix_sem.cpp" |
109 |
< |
else |
110 |
< |
LIBS="$LIBS -lposix4" |
111 |
< |
fi |
101 |
> |
dnl We use ESD if possible. |
102 |
> |
if [[ "x$WANT_ESD" = "xyes" ]]; then |
103 |
> |
AM_PATH_ESD(0.2.8, [ |
104 |
> |
DEFINES="$DEFINES -DENABLE_ESD=1" |
105 |
> |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
106 |
> |
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" |
107 |
> |
LIBS="$LIBS $ESD_LIBS" |
108 |
> |
], [ |
109 |
> |
AC_MSG_WARN([Could not find ESD, disabling ESD support.]) |
110 |
> |
WANT_ESD=no |
111 |
> |
]) |
112 |
|
fi |
113 |
|
|
114 |
|
dnl Checks for header files. |
132 |
|
dnl Checks for library functions. |
133 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
134 |
|
AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) |
135 |
+ |
AC_CHECK_FUNCS(pthread_cancel) |
136 |
|
|
137 |
|
dnl Select system-dependant source files. |
138 |
|
SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" |
139 |
|
if MACHINE=`uname -a 2>/dev/null`; then |
140 |
|
case "$MACHINE" in |
141 |
|
Linux*) |
142 |
< |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" |
142 |
> |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" |
143 |
|
;; |
144 |
|
FreeBSD*3.*) |
145 |
|
dnl Check for the CAM library |
154 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
155 |
|
AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) |
156 |
|
fi |
157 |
< |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" |
157 |
> |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" |
158 |
|
CXXFLAGS="$CXXFLAGS -I/sys" |
159 |
|
CFLAGS="$CFLAGS -I/sys" |
160 |
|
LIBS="$LIBS -lcam" |
188 |
|
;; |
189 |
|
esac |
190 |
|
fi |
191 |
< |
if [[ "x$WANT_UI" = "xyes" ]]; then |
184 |
< |
SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" |
185 |
< |
else |
186 |
< |
SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" |
187 |
< |
fi |
188 |
< |
if [[ "x$SEMSRCS" != "x" ]]; then |
189 |
< |
SYSSRCS="$SYSSRCS $SEMSRCS" |
190 |
< |
fi |
191 |
> |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS" |
192 |
|
|
193 |
|
dnl Check for i386 CPU. |
194 |
|
HAVE_I386=no |
236 |
|
fi |
237 |
|
|
238 |
|
dnl Select appropriate CPU source and REGPARAM define. |
239 |
+ |
WANT_X86_ASSEMBLY=no |
240 |
+ |
WANT_SPARC_V8_ASSEMBLY=no |
241 |
+ |
WANT_SPARC_V9_ASSEMBLY=no |
242 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
243 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
244 |
|
dnl i386 CPU |
245 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
246 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
247 |
+ |
WANT_X86_ASSEMBLY=yes |
248 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY" |
249 |
|
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
250 |
|
fi |
257 |
|
AC_MSG_RESULT($SPARC_TYPE) |
258 |
|
case "$SPARC_TYPE" in |
259 |
|
SPARC_V8) |
260 |
+ |
WANT_SPARC_V8_ASSEMBLY=yes |
261 |
|
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" |
262 |
|
CFLAGS="$CFLAGS -Wa,-Av8" |
263 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
264 |
|
;; |
265 |
|
SPARC_V9) |
266 |
+ |
WANT_SPARC_V9_ASSEMBLY=yes |
267 |
|
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" |
268 |
|
CFLAGS="$CFLAGS -Wa,-Av9" |
269 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
279 |
|
|
280 |
|
dnl Generate Makefile. |
281 |
|
AC_SUBST(DEFINES) |
275 |
– |
AC_SUBST(STATICLIBS) |
282 |
|
AC_SUBST(SYSSRCS) |
283 |
|
AC_SUBST(CPUINCLUDES) |
284 |
|
AC_SUBST(CPUSRCS) |
285 |
|
AC_OUTPUT(Makefile) |
286 |
+ |
|
287 |
+ |
dnl Print summary. |
288 |
+ |
echo |
289 |
+ |
echo Basilisk II configuration summary: |
290 |
+ |
echo |
291 |
+ |
echo XFree86 DGA support .............. : $WANT_XF86_DGA |
292 |
+ |
echo fbdev DGA support ................ : $WANT_FBDEV_DGA |
293 |
+ |
echo ESD sound support ................ : $WANT_ESD |
294 |
+ |
echo GTK user interface ............... : $WANT_UI |
295 |
+ |
echo mon debugger support ............. : $WANT_MON |
296 |
+ |
echo i386 assembly optimizations ...... : $WANT_X86_ASSEMBLY |
297 |
+ |
echo SPARC V8 assembly optimizations .. : $WANT_SPARC_V8_ASSEMBLY |
298 |
+ |
echo SPARC V9 assembly optimizations .. : $WANT_SPARC_V9_ASSEMBLY |
299 |
+ |
echo |
300 |
|
echo "Configuration done. Now type \"make\"." |