From f8709b10f1987b96b8dd235f36835172f587139f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 27 Mar 2018 21:27:48 +0300 Subject: [PATCH] Accept Android platform by both CMake and configure (fix of commit 1680d91) * CMakeLists.txt (_HOST): Adjust FIXME comment. * CMakeLists.txt (HOST): Remove replacement of "android" to "linux". * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-android*]: Define GC_THREADS and _REENTRANT macros. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-android* && enable_parallel_mark]: Define PARALLEL_MARK macro. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=*-*-android* && enable_thread_local_alloc]: Define THREAD_LOCAL_ALLOC macro. * configure.ac [$THREADS=posix && $host=*-*-android*] (GC_THREADS, _REENTRANT): Define macro. * configure.ac [$THREADS=posix && $host=*-*-android* && $enable_parallel_mark] (PARALLEL_MARK): Likewise. * configure.ac [$THREADS=posix && $host=*-*-android* && $enable_thread_local_alloc] (THREAD_LOCAL_ALLOC): Likewise. --- CMakeLists.txt | 9 ++------- configure.ac | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 000e5a6..1e10a88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,13 +73,8 @@ OPTION(enable_parallel_mark "Parallelize marking and free list construction" ON) OPTION(enable_cplusplus "install C++ support" NO) -SET(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM}) #FIXME missing the vendor field.Use lowercase - +SET(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM}) #FIXME missing the vendor field. STRING(TOLOWER ${_HOST} HOST) - -# Accept Android hosts as Linux. -STRING(REPLACE "android" "linux" HOST "${HOST}") - MESSAGE("HOST = ${HOST}") #Thread Detection. Relying on cmake for lib an includes. @@ -87,7 +82,7 @@ MESSAGE("HOST = ${HOST}") IF(CMAKE_USE_PTHREADS_INIT) SET(SRC ${SRC} pthread_start.c pthread_support.c pthread_stop_world.c) # Common defines for most POSIX platforms. - IF( HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-darwin.*|.*-.*-.*freebsd.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) + IF( HOST MATCHES .*-.*-aix.*|.*-.*-android.*|.*-.*-cygwin.*|.*-.*-darwin.*|.*-.*-.*freebsd.*|.*-.*-gnu.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-.*linux.*|.*-.*-nacl.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*) ADD_DEFINITIONS("-DGC_THREADS -D_REENTRANT") IF(enable_parallel_mark) ADD_DEFINITIONS("-DPARALLEL_MARK") diff --git a/configure.ac b/configure.ac index 354ce1b..b7268e6 100644 --- a/configure.ac +++ b/configure.ac @@ -185,7 +185,7 @@ case "$THREADS" in default_threadlibs=false # Common defines for most POSIX platforms. case "$host" in - *-*-aix* | *-*-cygwin* | *-*-darwin* | *-*-dragonfly* | \ + *-*-aix* | *-*-android* | *-*-cygwin* | *-*-darwin* | *-*-dragonfly* | \ *-*-freebsd* | *-*-haiku* | *-*-hpux11* | *-*-irix* | \ *-*-kfreebsd*-gnu | *-*-gnu* | *-*-*linux* | *-*-nacl* | \ *-*-netbsd* | *-*-openbsd* | *-*-osf* | *-*-solaris*) -- 2.7.4