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 |
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 |
28 |
– |
|
33 |
|
CFLAGS="$CFLAGS $X_CFLAGS" |
34 |
|
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
35 |
|
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
32 |
– |
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) |
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 |
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" |
44 |
< |
fi |
45 |
< |
else |
46 |
< |
LIBS="$LIBS -lc_r" |
47 |
< |
fi |
48 |
< |
else |
49 |
< |
LIBS="$LIBS -lpthread" |
50 |
< |
fi |
53 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
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 if possible. |
52 |
> |
dnl We use DGA (XFree86 or fbdev) if possible. |
53 |
|
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
54 |
< |
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 |
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 |
< |
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 |
|
DEFINES="$DEFINES -DENABLE_XF86_DGA=0" |
67 |
|
fi |
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) |
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 |
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" |
176 |
|
;; |
177 |
|
esac |
178 |
|
fi |
179 |
< |
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 |
179 |
> |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS" |
180 |
|
|
181 |
|
dnl Check for i386 CPU. |
182 |
|
HAVE_I386=no |
261 |
|
|
262 |
|
dnl Generate Makefile. |
263 |
|
AC_SUBST(DEFINES) |
275 |
– |
AC_SUBST(STATICLIBS) |
264 |
|
AC_SUBST(SYSSRCS) |
265 |
|
AC_SUBST(CPUINCLUDES) |
266 |
|
AC_SUBST(CPUSRCS) |