diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-31 20:09:47 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-31 20:09:47 +0000 |
commit | a96627fd2467b74004f8950eb78ce8888ca97088 (patch) | |
tree | d4361b1b24262c188acae352a0ad0943cd62dfe9 /platform_tools/android/launcher | |
parent | cf5348f5aad19224f1175b8e2577019fb02636fd (diff) |
prepare skia for shared library build on android
R=borenet@google.com, djsollen@google.com
Committed: https://code.google.com/p/skia/source/detail?r=9378
Review URL: https://codereview.chromium.org/15855006
git-svn-id: http://skia.googlecode.com/svn/trunk@9379 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'platform_tools/android/launcher')
-rw-r--r-- | platform_tools/android/launcher/skia_launcher.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/platform_tools/android/launcher/skia_launcher.cpp b/platform_tools/android/launcher/skia_launcher.cpp index 231289d4e9..972382dc16 100644 --- a/platform_tools/android/launcher/skia_launcher.cpp +++ b/platform_tools/android/launcher/skia_launcher.cpp @@ -28,29 +28,6 @@ int launch_app(int (*app_main)(int, const char**), int argc, return (*app_main)(argc, argv); } -void* load_library(const char** argv, const char* libraryName) -{ - // attempt to lookup the location of the shared libraries - char libraryLocation[100]; - sprintf(libraryLocation, "%s/lib/lib%s.so", argv[0], libraryName); - if (!file_exists(libraryLocation)) { - printf("ERROR: Unable to find the appropriate library in the Skia App.\n"); - printf("ERROR: Did you provide the correct program_name?\n"); - usage(argv[0]); - return NULL; - } - - // load the appropriate library - void* appLibrary = dlopen(libraryLocation, RTLD_LOCAL | RTLD_LAZY); - if (!appLibrary) { - printf("ERROR: Unable to open the shared library.\n"); - printf("ERROR: %s", dlerror()); - return NULL; - } - - return appLibrary; -} - int main(int argc, const char** argv) { // check that the program name was specified @@ -67,16 +44,21 @@ int main(int argc, const char** argv) { return -1; } - // load the local skia shared library - void* skiaLibrary = load_library(argv, "libskia_android.so"); - if (NULL == skiaLibrary) - { + // attempt to lookup the location of the shared libraries + char libraryLocation[100]; + sprintf(libraryLocation, "%s/lib/lib%s.so", appLocation, argv[1]); + if (!file_exists(libraryLocation)) { + printf("ERROR: Unable to find the appropriate library in the Skia App.\n"); + printf("ERROR: Did you provide the correct program_name?\n"); + usage(argv[0]); return -1; } // load the appropriate library - void* appLibrary = load_library(argv, argv[1]); - if (NULL == appLibrary) { + void* appLibrary = dlopen(libraryLocation, RTLD_LOCAL | RTLD_LAZY); + if (!appLibrary) { + printf("ERROR: Unable to open the shared library.\n"); + printf("ERROR: %s", dlerror()); return -1; } |