13 |
|
|
14 |
|
dnl Checks for programs. |
15 |
|
AC_PROG_CC |
16 |
+ |
AC_PROG_CPP |
17 |
|
AC_PROG_CXX |
18 |
|
AC_PROG_MAKE_SET |
19 |
|
AC_PROG_INSTALL |
35 |
|
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 |
< |
AC_MSG_ERROR([You need libpthreads to run Basilisk II.]) |
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 |
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 |
83 |
|
if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then |
84 |
|
AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) |
85 |
|
if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then |
86 |
< |
dnl Checks for the existance of semget |
87 |
< |
AC_CHECK_FUNCS(semget) |
81 |
< |
if [[ "x$ac_cv_func_semget" = "xno" ]]; then |
82 |
< |
AC_MSG_ERROR([You need POSIX.4 semaphores to run Basilisk II.]) |
83 |
< |
else |
84 |
< |
SEMSRCS="posix_sem.cpp" |
85 |
< |
fi |
86 |
> |
dnl Emulate semaphores with pthread mutexes |
87 |
> |
SEMSRCS="posix_sem.cpp" |
88 |
|
else |
89 |
|
LIBS="$LIBS -lposix4" |
90 |
|
fi |
189 |
|
#endif |
190 |
|
], [AC_MSG_RESULT(yes); HAVE_I386=yes], AC_MSG_RESULT(no)) |
191 |
|
|
192 |
< |
dnl Check for GAS |
192 |
> |
dnl Check for GAS. |
193 |
|
HAVE_GAS=no |
194 |
|
AC_MSG_CHECKING(for GAS .p2align feature) |
195 |
|
cat >conftest.S << EOF |
199 |
|
if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi |
200 |
|
AC_MSG_RESULT($HAVE_GAS) |
201 |
|
|
202 |
< |
dnl Check for GCC 2.7 or higher |
202 |
> |
dnl Check for GCC 2.7 or higher. |
203 |
|
HAVE_GCC27=no |
204 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
205 |
|
AC_EGREP_CPP(yes, |
208 |
|
#endif |
209 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
210 |
|
|
211 |
< |
dnl Set "-fomit-frame-pointer" on GCC |
211 |
> |
dnl Set "-fomit-frame-pointer" on GCC. |
212 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
213 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
214 |
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
215 |
|
fi |
216 |
|
|
217 |
< |
dnl Select appropriate CPU source and REGPARAM define |
217 |
> |
dnl Select appropriate CPU source and REGPARAM define. |
218 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
219 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
220 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
221 |
|
DEFINES="$DEFINES -DX86_ASSEMBLY" |
222 |
< |
CPUSRCS="$CPUSRCS cpufast.s" |
222 |
> |
CPUSRCS="$CPUSRCS cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
223 |
|
else |
224 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
224 |
> |
CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
225 |
|
fi |
226 |
|
else |
227 |
< |
CPUSRCS="$CPUSRCS cpuemu.cpp" |
227 |
> |
CPUSRCS="$CPUSRCS cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
228 |
|
fi |
229 |
|
|
230 |
< |
dnl Generate Makefile |
230 |
> |
dnl Generate Makefile. |
231 |
|
AC_SUBST(DEFINES) |
232 |
|
AC_SUBST(STATICLIBS) |
233 |
|
AC_SUBST(SYSSRCS) |