Check for MAP_ANON (needed for darwin) and removed MAP_ANONYMOUS defines
authortwisti <none@none>
Fri, 12 Nov 2004 11:26:26 +0000 (11:26 +0000)
committertwisti <none@none>
Fri, 12 Nov 2004 11:26:26 +0000 (11:26 +0000)
in CFLAGS. Made problems with boehm on darwin.

configure.in

index b33c2bc9d54191eb6c7a1b436c3c4e4e28eb222b..fdbc477af4729fa6403f4213ce71d23baa2c9e92 100644 (file)
@@ -32,7 +32,7 @@ i386* | i486* | i586* | i686* )
 mips* )
        ARCH_DIR="mips"
         STATIC_CLASSPATH="1"
-       CFLAGS="-64 -O2 -OPT:Olimit=0 -g -DMAP_ANONYMOUS=0 -woff 1110,1164,1515 -D__MIPS__"
+       CFLAGS="-64 -O2 -OPT:Olimit=0 -g -woff 1110,1164,1515 -D__MIPS__"
        LIBS="-lelfutil"
        AC_DEFINE([TRACE_ARGS_NUM], 8, [Defines integer argument register count])
        ;;
@@ -40,7 +40,7 @@ mips* )
 powerpc* | ppc* )
        ARCH_DIR="powerpc"
         STATIC_CLASSPATH="1"
-       CFLAGS="-Wall -O2 -g -DMAP_ANONYMOUS=0 -no-cpp-precomp -D__POWERPC__"
+       CFLAGS="-Wall -O0 -g -no-cpp-precomp -D__POWERPC__"
        AC_DEFINE([TRACE_ARGS_NUM], 8, [Defines integer argument register count])
        ;;
 
@@ -57,7 +57,6 @@ sparc* | * )
         ;;
 esac
 
-
 case "$host_os" in
 *linux* | *Linux* )
         CFLAGS="$CFLAGS -D__LINUX__ -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
@@ -145,12 +144,26 @@ if test $ac_cv_func_mmap_fixed_mapped = yes; then
                                    ac_cv_map_anonymous=yes,
                                    ac_cv_map_anonymous=no))
 
+       AC_CACHE_CHECK(whether MAP_ANON is defined,
+                      ac_cv_map_anon,
+                      AC_EGREP_CPP(yes, 
+                                   [#include <sys/mman.h>
+                                    #ifdef MAP_ANON
+                                       yes
+                                    #endif],
+                                   ac_cv_map_anon=yes,
+                                   ac_cv_map_anon=no))
+
        if test $ac_cv_map_failed = yes; then
-               AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if mman.h defines MAP_FAILED])
+               AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
        fi
 
        if test $ac_cv_map_anonymous = yes; then
-               AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if mman.h defines MAP_ANONYMOUS])
+               AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
+       fi
+
+       if test $ac_cv_map_anon = yes; then
+               AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
        fi
 fi