diff options
author | Jiyong Park <jiyong@google.com> | 2017-08-10 13:48:35 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2017-08-11 23:08:29 +0900 |
commit | 633397eeef296584d3242d8a72790dcf11bb36fd (patch) | |
tree | 7233a8dc40446078be96d8a082788c98c5f1d6ef | |
parent | b4076dfd66f114263a1f70cf3ba73c2d55ccb3b0 (diff) |
ICU is disabled by Android.bp
By using vendor.cflags, SQLITE_ENABLE_ICU is on/off from Android.bp. No
need to def/undef it inside the source code.
Bug: 64514237
Test: BOARD_VNDK_VERSION=current m -j libsqlite libsqlite.vendor
Change-Id: If9771fa020e528445275281017e424a5bbc2ae99
-rw-r--r-- | android/Android.bp | 2 | ||||
-rw-r--r-- | android/sqlite3_android.cpp | 7 | ||||
-rw-r--r-- | dist/Android.bp | 3 | ||||
-rw-r--r-- | dist/Android.patch | 28 | ||||
-rw-r--r-- | dist/sqlite3.c | 9 |
5 files changed, 10 insertions, 39 deletions
diff --git a/android/Android.bp b/android/Android.bp index bbe6fed..d5a1312 100644 --- a/android/Android.bp +++ b/android/Android.bp @@ -2,6 +2,7 @@ cc_library_static { name: "libsqlite3_android", vendor_available: true, host_supported: true, + cflags: ["-DSQLITE_ENABLE_ICU"], srcs: [ "PhoneNumberUtils.cpp", "OldPhoneNumberUtils.cpp", @@ -15,6 +16,7 @@ cc_library_static { ], target: { vendor: { + cflags: ["-USQLITE_ENABLE_ICU"], exclude_shared_libs: ["libicuuc", "libicui18n"], }, }, diff --git a/android/sqlite3_android.cpp b/android/sqlite3_android.cpp index da40647..659ee6c 100644 --- a/android/sqlite3_android.cpp +++ b/android/sqlite3_android.cpp @@ -21,13 +21,6 @@ #include <string.h> #include <unistd.h> -// ICU is turned off when sqlite is built for VNDK -#ifndef __ANDROID_VNDK__ -#define SQLITE_ENABLE_ICU -#else -#undef SQLITE_ENABLE_ICU -#endif - #ifdef SQLITE_ENABLE_ICU #include <unicode/ucol.h> #include <unicode/uiter.h> diff --git a/dist/Android.bp b/dist/Android.bp index 75d03ab..95cd1ae 100644 --- a/dist/Android.bp +++ b/dist/Android.bp @@ -54,7 +54,6 @@ cc_defaults { target: { android: { cflags: [ - "-DSQLITE_ENABLE_ICU", "-DUSE_PREAD64", "-Dfdatasync=fdatasync", "-DHAVE_MALLOC_H=1", @@ -83,6 +82,7 @@ cc_library { "libicuuc", "libicui18n", ], + cflags: ["-DSQLITE_ENABLE_ICU"], // include android specific methods whole_static_libs: ["libsqlite3_android"], @@ -106,6 +106,7 @@ cc_library { enabled: true, }, vendor: { + cflags: ["-USQLITE_ENABLE_ICU"], exclude_shared_libs: ["libicuuc", "libicui18n"], }, }, diff --git a/dist/Android.patch b/dist/Android.patch index 8132ee2..95cde52 100644 --- a/dist/Android.patch +++ b/dist/Android.patch @@ -39,24 +39,8 @@ diff -r -u -d orig/shell.c ./shell.c diff -r -u -d orig/sqlite3.c ./sqlite3.c --- orig/sqlite3.c 2017-08-04 10:42:31.294648222 +0900 -+++ ./sqlite3.c 2017-08-10 00:35:18.935880997 +0900 -@@ -84,6 +84,15 @@ - #endif - - /* -+** When sqlite is built for the VNDK, ICU is disabled because -+** libicuuc.so and libicui18n.so aren't available then. -+** TODO(b/64514237): move this to Android.bp -+*/ -+#ifdef __ANDROID_VNDK__ -+#undef SQLITE_ENABLE_ICU -+#endif -+ -+/* - ** Include the header file used to customize the compiler options for MSVC. - ** This should be done first so that it can successfully prevent spurious - ** compiler warnings due to subsequent content in this file and other files -@@ -33618,7 +33627,7 @@ ++++ ./sqlite3.c 2017-08-10 13:27:29.784569745 +0900 +@@ -33618,7 +33618,7 @@ SimulateIOError( rc=1 ); if( rc!=0 ){ storeLastErrno((unixFile*)id, errno); @@ -65,7 +49,7 @@ diff -r -u -d orig/sqlite3.c ./sqlite3.c } *pSize = buf.st_size; -@@ -33654,7 +33663,7 @@ +@@ -33654,7 +33654,7 @@ struct stat buf; /* Used to hold return values of fstat() */ if( osFstat(pFile->h, &buf) ){ @@ -74,7 +58,7 @@ diff -r -u -d orig/sqlite3.c ./sqlite3.c } nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; -@@ -34262,7 +34271,7 @@ +@@ -34262,7 +34262,7 @@ ** with the same permissions. */ if( osFstat(pDbFd->h, &sStat) ){ @@ -83,7 +67,7 @@ diff -r -u -d orig/sqlite3.c ./sqlite3.c goto shm_open_err; } -@@ -116120,7 +116129,7 @@ +@@ -116120,7 +116120,7 @@ } if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ sqlite3SetString(pzErrMsg, db, "unsupported file format"); @@ -92,7 +76,7 @@ diff -r -u -d orig/sqlite3.c ./sqlite3.c goto initone_error_out; } -@@ -149914,13 +149923,25 @@ +@@ -149914,13 +149914,25 @@ ** module with sqlite. */ if( SQLITE_OK==rc diff --git a/dist/sqlite3.c b/dist/sqlite3.c index 3eaac07..59bba65 100644 --- a/dist/sqlite3.c +++ b/dist/sqlite3.c @@ -84,15 +84,6 @@ #endif /* -** When sqlite is built for the VNDK, ICU is disabled because -** libicuuc.so and libicui18n.so aren't available then. -** TODO(b/64514237): move this to Android.bp -*/ -#ifdef __ANDROID_VNDK__ -#undef SQLITE_ENABLE_ICU -#endif - -/* ** Include the header file used to customize the compiler options for MSVC. ** This should be done first so that it can successfully prevent spurious ** compiler warnings due to subsequent content in this file and other files |