host_win32=no
target_win32=no
+platform_android=no
case "$host" in
*-mingw*|*-*-cygwin*)
AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
with_sigaltstack=no
use_sigposix=yes
;;
+ *-*-linux-android*)
+ host_win32=no
+ platform_android=yes
+ AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
+
+ CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
+ if test "x$disable_munmap" != "xyes"; then
+ CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
+ fi
+ libmono_cflags="-D_REENTRANT"
+ libdl="-ldl"
+ libgc_threads=pthreads
+ use_sigposix=yes
+
+ with_tls=pthread
+ with_sigaltstack=no
+ with_static_mono=no
+
+ # Android doesn't support boehm, as it's missing <link.h>
+ support_boehm=no
+ with_gc=sgen
+
+ # isinf(3) requires -lm; see isinf check below
+ LDFLAGS="$LDFLAGS -lm"
+
+ # Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
+ # PAGE_SIZE; breaks mono/io-layer/collection.c
+ # Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
+ CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
+ CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
+
+ # to bypass the underscore linker check, can't work when cross-compiling
+ mono_cv_uscore=yes
+ ;;
*-*-linux*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
+AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
+AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=yes)
+AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
+
dnl
dnl Boehm GC configuration
dnl
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
platform_darwin=no
+platform_android=no
case $host in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
OS="UNIX"
PIDTYPE='int'
;;
+*-*-linux-android*)
+ platform_android=yes
+ PATHSEP='/'
+ SEARCHSEP=':'
+ OS="UNIX"
+ PIDTYPE='int'
+ ;;
*)
PATHSEP='/'
SEARCHSEP=':'
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
+AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
endif
if SHARED_MONO
+if SUPPORT_BOEHM
bin_PROGRAMS = pedump
endif
+endif
#
# libtool is not capable of creating static/shared versions of the same
endif
if SHARED_MONO
+if SUPPORT_BOEHM
shared_libraries = libmonoruntime.la
endif
+endif
noinst_LTLIBRARIES = $(shared_libraries) libmonoruntime-static.la $(sgen_libraries) $(moonlight_libraries)
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
endif
if SHARED_MONO
+if SUPPORT_BOEHM
pedump_SOURCES = \
pedump.c
pedump_LDFLAGS=-framework CoreFoundation
endif
endif
+endif
EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h \
tpool-poll.c tpool-epoll.c tpool-kqueue.c
sgen_static_libraries = libmonosgen-static.la
endif
+if SUPPORT_BOEHM
+boehm_libraries = libmono-2.0.la
+boehm_binaries = mono
+endif
+
if HOST_WIN32
bin_PROGRAMS = mono monow
else
-bin_PROGRAMS = mono $(sgen_binaries)
+bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
endif
noinst_PROGRAMS = genmdesc
if SHARED_MONO
-shared_libraries = libmono-2.0.la $(sgen_libraries)
+shared_libraries = $(boehm_libraries) $(sgen_libraries)
endif
lib_LTLIBRARIES = $(shared_libraries)