112 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
113 |
|
SEMSRC= |
114 |
|
AC_CHECK_FUNCS(sem_init, , [ |
115 |
< |
if [ "x$HAVE_PTHREADS" = "xyes" ]; then |
115 |
> |
if test "x$HAVE_PTHREADS" = "xyes"; then |
116 |
|
SEMSRC=posix_sem.cpp |
117 |
|
fi |
118 |
|
]) |
318 |
|
AC_LANG_CPLUSPLUS |
319 |
|
AC_TRY_RUN([ |
320 |
|
#include <unistd.h> |
321 |
+ |
#include <stdlib.h> |
322 |
|
#include <signal.h> |
323 |
|
#include <fcntl.h> |
324 |
|
#include <sys/mman.h> |
333 |
|
int main() |
334 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
335 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
336 |
< |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = 0; |
336 |
> |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = SA_SIGINFO; |
337 |
|
sigaction(SIGSEGV, &sa, 0); |
338 |
|
mem[0] = 0; |
339 |
|
exit(1); // should not be reached |
373 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
374 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
375 |
|
struct sigaction sa; sa.sa_flags = 0; |
376 |
< |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
376 |
> |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
377 |
|
sigaction(SIGSEGV, &sa, 0); |
378 |
|
mem[0] = 0; |
379 |
|
exit(1); // should not be reached |
384 |
|
) |
385 |
|
AC_LANG_RESTORE |
386 |
|
]) |
387 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
387 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
388 |
|
fi |
389 |
|
;; |
390 |
|
esac |
510 |
|
AC_MSG_RESULT($SPARC_TYPE) |
511 |
|
case "$SPARC_TYPE" in |
512 |
|
SPARC_V8) |
513 |
< |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
513 |
> |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
514 |
|
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS" |
515 |
|
CFLAGS="$CFLAGS -Wa,-Av8" |
516 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
517 |
|
;; |
518 |
|
SPARC_V9) |
519 |
< |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
519 |
> |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
520 |
|
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS" |
521 |
|
CFLAGS="$CFLAGS -Wa,-Av9" |
522 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
542 |
|
|
543 |
|
dnl Remove the "-g" option if set for GCC. |
544 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
545 |
< |
dnl gb-- Probably not the cleanest way to take |
546 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
547 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
545 |
> |
dnl gb-- Probably not the cleanest way to take |
546 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
547 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
548 |
|
fi |
549 |
|
|
550 |
|
dnl Generate Makefile. |