Merge "Remove unused variables from select.mk."
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 07b3ece..020de69 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -302,6 +302,9 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
+# Move to libc++ as the default STL.
+$(call add-clean-step, rm -rf $(OUT_DIR))
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/combo/include/arch/darwin-x86/AndroidConfig.h b/core/combo/include/arch/darwin-x86/AndroidConfig.h
index eb5609c..73f5337 100644
--- a/core/combo/include/arch/darwin-x86/AndroidConfig.h
+++ b/core/combo/include/arch/darwin-x86/AndroidConfig.h
@@ -105,13 +105,6 @@
#define _LARGEFILE_SOURCE 1
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
* Add any extra platform-specific defines here.
*/
#define _THREAD_SAFE
@@ -122,16 +115,6 @@
/* #define HAVE_MALLOC_H */
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
@@ -161,13 +144,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- *
- * For tools apps, we'll treat is as not case sensitive.
- */
-/* #define OS_CASE_SENSITIVE */
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -178,11 +154,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if writev() exists
*/
#define HAVE_WRITEV 1
@@ -208,11 +179,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/linux-arm/AndroidConfig.h b/core/combo/include/arch/linux-arm/AndroidConfig.h
index 4a9ec62..1ca3730 100644
--- a/core/combo/include/arch/linux-arm/AndroidConfig.h
+++ b/core/combo/include/arch/linux-arm/AndroidConfig.h
@@ -94,30 +94,11 @@
#define HAVE_LITTLE_ENDIAN
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
- * Add any extra platform-specific defines here.
- */
-#ifndef __linux__
-#define __linux__
-#endif
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
-/*
+/*
* Define if we're running on *our* linux on device or emulator.
*/
#define HAVE_ANDROID_OS 1
@@ -128,26 +109,11 @@
#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-#define HAVE_INOTIFY 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if libc includes Android system properties implementation.
*/
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
@@ -168,11 +134,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -183,11 +144,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -218,11 +174,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/linux-arm64/AndroidConfig.h b/core/combo/include/arch/linux-arm64/AndroidConfig.h
index c3ad5da..99bf74d 100644
--- a/core/combo/include/arch/linux-arm64/AndroidConfig.h
+++ b/core/combo/include/arch/linux-arm64/AndroidConfig.h
@@ -92,25 +92,6 @@
/* #define _LARGEFILE_SOURCE 1 */
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
- * Add any extra platform-specific defines here.
- */
-#ifndef __linux__
-#define __linux__
-#endif
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
@@ -126,26 +107,11 @@
#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-#define HAVE_INOTIFY 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if libc includes Android system properties implementation.
*/
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
@@ -166,11 +132,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -181,11 +142,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -216,11 +172,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/linux-mips/AndroidConfig.h b/core/combo/include/arch/linux-mips/AndroidConfig.h
index 45bff09..da45929 100644
--- a/core/combo/include/arch/linux-mips/AndroidConfig.h
+++ b/core/combo/include/arch/linux-mips/AndroidConfig.h
@@ -122,37 +122,6 @@
/* #define _LARGEFILE_SOURCE 1 */
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
- * Add any extra platform-specific defines here.
- */
-#ifndef __linux__
-#define __linux__ 1
-#endif
-
-#ifndef __linux
-#define __linux 1
-#endif
-
-#ifdef __unix__
-#undef __unix__
-#endif
-
-#ifdef __unix
-#undef __unix
-#endif
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
@@ -168,26 +137,11 @@
#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-#define HAVE_INOTIFY 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if libc includes Android system properties implementation.
*/
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
@@ -219,11 +173,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -234,11 +183,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -269,11 +213,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/linux-mips64/AndroidConfig.h b/core/combo/include/arch/linux-mips64/AndroidConfig.h
index f66830a..3225afd 100644
--- a/core/combo/include/arch/linux-mips64/AndroidConfig.h
+++ b/core/combo/include/arch/linux-mips64/AndroidConfig.h
@@ -112,37 +112,6 @@
/* #define _LARGEFILE_SOURCE 1 */
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
- * Add any extra platform-specific defines here.
- */
-#ifndef __linux__
-#define __linux__ 1
-#endif
-
-#ifndef __linux
-#define __linux 1
-#endif
-
-#ifdef __unix__
-#undef __unix__
-#endif
-
-#ifdef __unix
-#undef __unix
-#endif
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
@@ -158,26 +127,11 @@
#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-#define HAVE_INOTIFY 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if libc includes Android system properties implementation.
*/
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
@@ -209,11 +163,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -224,11 +173,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -259,11 +203,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h
index e3bffec..38f289c 100644
--- a/core/combo/include/arch/linux-x86/AndroidConfig.h
+++ b/core/combo/include/arch/linux-x86/AndroidConfig.h
@@ -107,18 +107,6 @@
#define _LARGEFILE_SOURCE 1
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 1
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
@@ -134,16 +122,6 @@
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if system provides a system property server (should be
* mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
*/
@@ -160,11 +138,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -200,11 +173,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/target_linux-x86/AndroidConfig.h b/core/combo/include/arch/target_linux-x86/AndroidConfig.h
index 216bb9ed..690bb43 100644
--- a/core/combo/include/arch/target_linux-x86/AndroidConfig.h
+++ b/core/combo/include/arch/target_linux-x86/AndroidConfig.h
@@ -86,30 +86,11 @@
/* #define _LARGEFILE_SOURCE 1 */
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
- * Defined if we have the sched_setscheduler() call
- */
-#define HAVE_SCHED_SETSCHEDULER
-
-/*
- * Add any extra platform-specific defines here.
- */
-#ifndef __linux__
-#define __linux__
-#endif
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
-/*
+/*
* Define if we're running on *our* linux on device or emulator.
*/
#define HAVE_ANDROID_OS 1
@@ -120,26 +101,11 @@
#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-#define HAVE_INOTIFY 1
-
-/*
* Define if we have madvise() in <sys/mman.h>
*/
#define HAVE_MADVISE 1
/*
- * Define if tm struct has tm_gmtoff field
- */
-#define HAVE_TM_GMTOFF 1
-
-/*
- * Define if dirent struct has d_type field
- */
-#define HAVE_DIRENT_D_TYPE 1
-
-/*
* Define if libc includes Android system properties implementation.
*/
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
@@ -160,11 +126,6 @@
#define OS_PATH_SEPARATOR '/'
/*
- * Is the filesystem case sensitive?
- */
-#define OS_CASE_SENSITIVE
-
-/*
* Define if <sys/socket.h> exists.
*/
#define HAVE_SYS_SOCKET_H 1
@@ -175,11 +136,6 @@
#define HAVE_STRLCPY 1
/*
- * Define if the BSD funopen() function exists on the system.
- */
-#define HAVE_FUNOPEN 1
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -210,11 +166,6 @@
#define HAVE_PREAD 1
/*
- * Define if we have st_mtim in struct stat
- */
-#define HAVE_STAT_ST_MTIM 1
-
-/*
* Define if printf() supports %zd for size_t arguments
*/
#define HAVE_PRINTF_ZD 1
diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h
index 786f95e..e9964a3 100644
--- a/core/combo/include/arch/windows/AndroidConfig.h
+++ b/core/combo/include/arch/windows/AndroidConfig.h
@@ -140,13 +140,6 @@
#define _LARGEFILE_SOURCE 1
/*
- * Defined if we have the backtrace() call for retrieving a stack trace.
- * Needed for CallStack to operate; if not defined, CallStack is
- * non-functional.
- */
-#define HAVE_BACKTRACE 0
-
-/*
* Add any extra platform-specific defines here.
*/
#define WIN32 1 /* stock Cygwin doesn't define these */
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
index 4f41daa..0f574d2 100644
--- a/core/cxx_stl_setup.mk
+++ b/core/cxx_stl_setup.mk
@@ -4,16 +4,14 @@
## Output variables: My_cflags, my_c_includes, my_shared_libraries, etc.
#############################################################
-# Only around for development purposes. Will be removed soon.
-my_libcxx_is_default := false
-
# Select the appropriate C++ STL
ifeq ($(strip $(LOCAL_CXX_STL)),default)
ifndef LOCAL_SDK_VERSION
- ifeq ($(strip $(my_libcxx_is_default)),true)
- # Platform code. Select the appropriate STL.
+ # Platform code. Select the appropriate STL.
+ ifndef USE_MINGW
my_cxx_stl := libc++
else
+ # libc++ is not supported on mingw.
my_cxx_stl := libstdc++
endif
else
diff --git a/core/host_test_internal.mk b/core/host_test_internal.mk
index 8611c4b..e0070c1 100644
--- a/core/host_test_internal.mk
+++ b/core/host_test_internal.mk
@@ -12,17 +12,4 @@
LOCAL_CFLAGS += -DGTEST_HAS_STD_STRING -O0 -g
LOCAL_C_INCLUDES += external/gtest/include
-my_test_libcxx := false
-ifeq (,$(TARGET_BUILD_APPS))
-ifneq ($(filter $(strip $(LOCAL_CXX_STL)),libc++ libc++_static),)
-my_test_libcxx := true
-endif
-endif
-
-ifeq ($(my_test_libcxx),true)
-LOCAL_STATIC_LIBRARIES += libgtest_libc++_host libgtest_main_libc++_host
-else
LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host
-LOCAL_SHARED_LIBRARIES +=
-endif
-
diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk
index 50f4036..ed011d1 100644
--- a/core/target_test_internal.mk
+++ b/core/target_test_internal.mk
@@ -6,13 +6,12 @@
LOCAL_C_INCLUDES += external/gtest/include
-my_test_libcxx := false
-ifndef LOCAL_SDK_VERSION
-ifeq (,$(TARGET_BUILD_APPS))
-ifneq ($(filter $(strip $(LOCAL_CXX_STL)),libc++ libc++_static),)
my_test_libcxx := true
+ifdef LOCAL_SDK_VERSION
+my_test_libcxx := false
endif
-endif
+ifneq ($(filter $(strip $(LOCAL_CXX_STL)),stlport stlport_static),)
+my_test_libcxx := false
endif
ifeq ($(my_test_libcxx),true)
diff --git a/libs/host/CopyFile.c b/libs/host/CopyFile.c
index ca52565..f0c8fe5 100644
--- a/libs/host/CopyFile.c
+++ b/libs/host/CopyFile.c
@@ -68,15 +68,13 @@
*/
static bool isHiresMtime(const struct stat* pSrcStat)
{
-#if HAVE_STAT_ST_MTIM
-#if defined(MACOSX_RSRC)
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+ return 0;
+#elif defined(MACOSX_RSRC)
return pSrcStat->st_mtimespec.tv_nsec > 0;
#else
return pSrcStat->st_mtim.tv_nsec > 0;
#endif
-#else
- return 0;
-#endif
}
/*
diff --git a/tools/atree/files.cpp b/tools/atree/files.cpp
index df3e987..d945f58 100644
--- a/tools/atree/files.cpp
+++ b/tools/atree/files.cpp
@@ -447,14 +447,7 @@
continue;
}
string entry = path_append(path, ent->d_name);
-#ifdef HAVE_DIRENT_D_TYPE
- bool is_directory = (ent->d_type == DT_DIR);
-#else
- // If dirent.d_type is missing, then use stat instead
- struct stat stat_buf;
- stat(entry.c_str(), &stat_buf);
- bool is_directory = S_ISDIR(stat_buf.st_mode);
-#endif
+ bool is_directory = (ent->d_type == DT_DIR);
add_more(entry, is_directory, rec, more);
if (is_directory) {
dirs.push_back(entry);
diff --git a/tools/atree/fs.cpp b/tools/atree/fs.cpp
index 9468cfd..6cd080e 100644
--- a/tools/atree/fs.cpp
+++ b/tools/atree/fs.cpp
@@ -63,14 +63,7 @@
string full = path;
full += '/';
full += ent->d_name;
-#ifdef HAVE_DIRENT_D_TYPE
bool is_directory = (ent->d_type == DT_DIR);
-#else
- // If dirent.d_type is missing, then use stat instead
- struct stat stat_buf;
- stat(full.c_str(), &stat_buf);
- bool is_directory = S_ISDIR(stat_buf.st_mode);
-#endif
if (is_directory) {
dirs.push_back(full);
} else {