8 |
|
dnl Options. |
9 |
|
WANT_XF86_DGA=yes |
10 |
|
WANT_FBDEV_DGA=yes |
11 |
+ |
WANT_ESD=yes |
12 |
|
WANT_UI=yes |
13 |
< |
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension (default)], [WANT_XF86_DGA=$enableval], []) |
14 |
< |
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb (default)], [WANT_FBDEV_DGA=$enableval], []) |
15 |
< |
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 |
22 |
|
AC_PROG_MAKE_SET |
23 |
|
AC_PROG_INSTALL |
24 |
|
|
25 |
+ |
dnl We use mon if possible. |
26 |
+ |
MONSRCS= |
27 |
+ |
AC_MSG_CHECKING(for mon) |
28 |
+ |
if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then |
29 |
+ |
AC_MSG_RESULT(yes) |
30 |
+ |
DEFINES="$DEFINES -DENABLE_MON=1" |
31 |
+ |
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" |
32 |
+ |
CXXFLAGS="$CXXFLAGS -I../../../mon/src" |
33 |
+ |
else |
34 |
+ |
AC_MSG_RESULT(no) |
35 |
+ |
DEFINES="$DEFINES -DENABLE_MON=0" |
36 |
+ |
fi |
37 |
+ |
|
38 |
|
dnl Checks for libraries. |
39 |
+ |
AC_CHECK_LIB(posix4, sem_init) |
40 |
+ |
|
41 |
+ |
dnl We need X11. |
42 |
|
AC_PATH_XTRA |
43 |
|
if [[ "x$no_x" = "xyes" ]]; then |
44 |
|
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
45 |
|
fi |
28 |
– |
|
46 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
47 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
48 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
32 |
– |
STATICLIBS= |
49 |
|
|
50 |
< |
dnl We need pthreads. |
51 |
< |
AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) |
52 |
< |
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
53 |
< |
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 |
50 |
> |
dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
51 |
> |
AC_CHECK_LIB(pthread, pthread_create, , [ |
52 |
> |
AC_CHECK_LIB(c_r, pthread_create, , [ |
53 |
> |
AC_CHECK_LIB(PTL, pthread_create, , [ |
54 |
|
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
55 |
< |
else |
56 |
< |
LIBS="$LIBS -lPTL" |
57 |
< |
fi |
47 |
< |
else |
48 |
< |
LIBS="$LIBS -lc_r" |
49 |
< |
fi |
50 |
< |
else |
51 |
< |
LIBS="$LIBS -lpthread" |
52 |
< |
fi |
53 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
55 |
> |
]) |
56 |
> |
]) |
57 |
> |
]) |
58 |
|
|
59 |
< |
dnl We use DGA if possible. |
59 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
60 |
> |
SEMSRCS= |
61 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
62 |
> |
SEMSRCS=posix_sem.cpp |
63 |
> |
]) |
64 |
> |
|
65 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
66 |
|
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
67 |
< |
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 |
67 |
> |
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ |
68 |
|
DEFINES="$DEFINES -DENABLE_XF86_DGA=1" |
69 |
|
LIBS="$LIBS -lXxf86dga" |
70 |
|
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
71 |
|
AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) |
72 |
|
WANT_FBDEV_DGA=no |
73 |
|
fi |
74 |
< |
fi |
74 |
> |
], [ |
75 |
> |
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) |
76 |
> |
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
77 |
> |
]) |
78 |
|
else |
79 |
|
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
80 |
|
fi |
85 |
|
fi |
86 |
|
|
87 |
|
dnl We use GTK+ if possible. |
88 |
+ |
UISRCS=../dummy/prefs_editor_dummy.cpp |
89 |
|
if [[ "x$WANT_UI" = "xyes" ]]; then |
90 |
< |
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 |
90 |
> |
AM_PATH_GTK(1.2.0, [ |
91 |
|
DEFINES="$DEFINES -DENABLE_GTK=1" |
92 |
< |
fi |
93 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
94 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
95 |
< |
LIBS="$LIBS $GTK_LIBS" |
92 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
93 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
94 |
> |
LIBS="$LIBS $GTK_LIBS" |
95 |
> |
UISRCS=prefs_editor_gtk.cpp |
96 |
> |
], [ |
97 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
98 |
> |
WANT_UI=no |
99 |
> |
]) |
100 |
|
fi |
101 |
|
|
102 |
< |
dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). |
103 |
< |
SEMSRCS= |
104 |
< |
AC_CHECK_FUNCS(sem_init) |
105 |
< |
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
106 |
< |
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
107 |
< |
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
108 |
< |
dnl Emulate semaphores with pthread mutexes |
109 |
< |
SEMSRCS="posix_sem.cpp" |
110 |
< |
else |
111 |
< |
LIBS="$LIBS -lposix4" |
112 |
< |
fi |
102 |
> |
dnl We use ESD if possible. |
103 |
> |
if [[ "x$WANT_ESD" = "xyes" ]]; then |
104 |
> |
AM_PATH_ESD(0.2.8, [ |
105 |
> |
DEFINES="$DEFINES -DENABLE_ESD=1" |
106 |
> |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
107 |
> |
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" |
108 |
> |
LIBS="$LIBS $ESD_LIBS" |
109 |
> |
], [ |
110 |
> |
AC_MSG_WARN([Could not find ESD, disabling ESD support.]) |
111 |
> |
WANT_ESD=no |
112 |
> |
]) |
113 |
|
fi |
114 |
|
|
115 |
|
dnl Checks for header files. |
133 |
|
dnl Checks for library functions. |
134 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
135 |
|
AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) |
136 |
+ |
AC_CHECK_FUNCS(pthread_cancel) |
137 |
|
|
138 |
|
dnl Select system-dependant source files. |
139 |
|
SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" |
140 |
|
if MACHINE=`uname -a 2>/dev/null`; then |
141 |
|
case "$MACHINE" in |
142 |
|
Linux*) |
143 |
< |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" |
143 |
> |
SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" |
144 |
|
;; |
145 |
|
FreeBSD*3.*) |
146 |
|
dnl Check for the CAM library |
155 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
156 |
|
AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) |
157 |
|
fi |
158 |
< |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" |
158 |
> |
SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" |
159 |
|
CXXFLAGS="$CXXFLAGS -I/sys" |
160 |
|
CFLAGS="$CFLAGS -I/sys" |
161 |
|
LIBS="$LIBS -lcam" |
189 |
|
;; |
190 |
|
esac |
191 |
|
fi |
192 |
< |
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 |
192 |
> |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS" |
193 |
|
|
194 |
|
dnl Check for i386 CPU. |
195 |
|
HAVE_I386=no |
274 |
|
|
275 |
|
dnl Generate Makefile. |
276 |
|
AC_SUBST(DEFINES) |
275 |
– |
AC_SUBST(STATICLIBS) |
277 |
|
AC_SUBST(SYSSRCS) |
278 |
|
AC_SUBST(CPUINCLUDES) |
279 |
|
AC_SUBST(CPUSRCS) |