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
diff --git a/Makefile b/Makefile
index a3f946f..eb49dcc 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@
                  pathops_unittest \
                  SampleApp \
                  SkiaAndroidApp \
-                 skia_lib \
+                 skia_base_libs \
                  tests \
                  tools
 
diff --git a/gyp/FileReaderApp.gyp b/gyp/FileReaderApp.gyp
index f590ffe..bcd0f0d 100644
--- a/gyp/FileReaderApp.gyp
+++ b/gyp/FileReaderApp.gyp
@@ -18,7 +18,8 @@
         '../src/utils/mac/SkOSWindow_Mac.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'views.gyp:views',
         'xml.gyp:xml',
       ],
diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp
index 59d2f84..5531605 100644
--- a/gyp/SampleApp.gyp
+++ b/gyp/SampleApp.gyp
@@ -142,7 +142,9 @@
         '../samplecode/SampleFontCache.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'views.gyp:views',
         'animator.gyp:animator',
         'xml.gyp:xml',
diff --git a/gyp/SimpleCocoaApp.gyp b/gyp/SimpleCocoaApp.gyp
index 6d7b925..3e17ad5 100644
--- a/gyp/SimpleCocoaApp.gyp
+++ b/gyp/SimpleCocoaApp.gyp
@@ -25,7 +25,7 @@
 
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
         'views.gyp:views',
         'xml.gyp:xml',
       ],
diff --git a/gyp/SimpleiOSApp.gyp b/gyp/SimpleiOSApp.gyp
index cb00f81..3678e7c 100644
--- a/gyp/SimpleiOSApp.gyp
+++ b/gyp/SimpleiOSApp.gyp
@@ -28,7 +28,9 @@
         '../experimental/SimpleiOSApp/SimpleiOSApp-Info.plist',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'views.gyp:views',
         'xml.gyp:xml',
       ],
diff --git a/gyp/bench.gyp b/gyp/bench.gyp
index 49e6c2c..be768f0 100644
--- a/gyp/bench.gyp
+++ b/gyp/bench.gyp
@@ -17,7 +17,9 @@
         'bench.gypi'
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'bench_timer',
       ],
       'conditions': [
@@ -48,7 +50,7 @@
         '../src/gpu',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
       ],
       'conditions': [
         [ 'skia_os not in ["mac", "ios"]', {
diff --git a/gyp/common.gypi b/gyp/common.gypi
index 2be8bb8..d3e1498 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -39,15 +39,6 @@
         }],
       ],
     },
-    # Validate the 'skia_os' setting against 'skia_shared_lib', because shared
-    # library build is only supported on Android.
-    'variables': {
-      'conditions': [
-        [ 'skia_os != "android" and skia_shared_lib', {
-          'error': '<!(Skia shared lib build only currently supported on Android.)',
-        }],
-      ],
-    },
     'includes': [
       'common_conditions.gypi',
     ],
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 64e7c13..fda1222 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -326,17 +326,6 @@
           [ 'skia_profile_enabled == 1', {
             'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
           }],
-          [ 'skia_shared_lib', {
-            'cflags': [
-              '-fPIC',
-            ],
-            'defines': [
-              'GR_DLL=1',
-              'GR_IMPLEMENTATION=1',
-              'SKIA_DLL',
-              'SKIA_IMPLEMENTATION=1',
-            ],
-          }],
           [ 'skia_arch_type == "arm" and arm_thumb == 1', {
             'cflags': [
               '-mthumb',
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index ac937bd..4f9f542 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -90,7 +90,6 @@
       'skia_osx_sdkroot%': '',
       'skia_profile_enabled%': 0,
       'skia_win_debuggers_path%': '',
-      'skia_shared_lib%': 0,
     },
 
     'conditions': [
@@ -122,7 +121,6 @@
     'skia_gpu%': '<(skia_gpu)',
     'skia_osx_sdkroot%': '<(skia_osx_sdkroot)',
     'skia_profile_enabled%': '<(skia_profile_enabled)',
-    'skia_shared_lib%': '<(skia_shared_lib)',
     'skia_static_initializers%': '<(skia_static_initializers)',
     'ios_sdk_version%': '6.0',
     'skia_win_debuggers_path%': '<(skia_win_debuggers_path)',
diff --git a/gyp/core.gyp b/gyp/core.gyp
index d018cbe..9e0792b 100644
--- a/gyp/core.gyp
+++ b/gyp/core.gyp
@@ -76,11 +76,6 @@
             'config/win',
           ],
         }],
-        [ 'skia_os == "android"', {
-          'sources': [
-            '../src/core/SkPaintOptionsAndroid.cpp',
-          ],
-        }],
         [ 'skia_os == "android" and skia_arch_type == "arm" and armv7 == 1', {
           # The code in SkUtilsArm.cpp can be used on an ARM-based Linux system, not only Android.
           'sources': [
@@ -125,6 +120,9 @@
           }],
         ],
       },
+      'dependencies': [
+        'opts.gyp:opts'
+      ],
     },
   ],
 }
diff --git a/gyp/debugger.gyp b/gyp/debugger.gyp
index 9ea300d..b935fb0 100644
--- a/gyp/debugger.gyp
+++ b/gyp/debugger.gyp
@@ -94,12 +94,17 @@
         '../debugger/SkObjectParser.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'images.gyp:images',
+        'effects.gyp:effects',
         'bench.gyp:bench_timer',
         'tools.gyp:picture_renderer',
       ],
       'conditions': [
         [ 'skia_os == "nacl"', {
+          'dependencies': [
+            'utils.gyp:utils', # For SkBase64.h
+          ],
           'include_dirs': [
             '../src/utils',
           ],
diff --git a/gyp/effects.gyp b/gyp/effects.gyp
index 91458eb..e110c9f 100644
--- a/gyp/effects.gyp
+++ b/gyp/effects.gyp
@@ -9,10 +9,7 @@
         'effects.gypi',
       ],
       'include_dirs': [
-        '../include/config',
-        '../include/core',
         '../include/effects',
-        '../include/utils',
         '../src/core',
       ],
       'direct_dependent_settings': {
@@ -20,13 +17,15 @@
           '../include/effects',
         ],
       },
+      'dependencies': [
+        'skia_base_libs.gyp:skia_base_libs',
+      ],
       'sources': [
         'effects.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
       ],
       'conditions': [
         ['skia_gpu == 1', {
           'include_dirs': [
-            '../include/gpu',
             '../src/gpu',
           ],
         }],
diff --git a/gyp/flags.gyp b/gyp/flags.gyp
index e80b0a3..aa83ea9 100644
--- a/gyp/flags.gyp
+++ b/gyp/flags.gyp
@@ -10,7 +10,8 @@
         '../tools/flags/SkCommandLineFlags.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'core.gyp:core',
       ],
       'direct_dependent_settings': {
         'include_dirs': [
diff --git a/gyp/gm.gyp b/gyp/gm.gyp
index a8b1533..fa413c3 100644
--- a/gyp/gm.gyp
+++ b/gyp/gm.gyp
@@ -16,7 +16,7 @@
         '../gm/gm_expectations.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
         'core.gyp:core',
         'images.gyp:images',
         'jsoncpp.gyp:jsoncpp',
@@ -57,11 +57,14 @@
         '../src/pipe/utils/SamplePipeControllers.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'flags.gyp:flags',
         'gm.gyp:gm_expectations',
+        'images.gyp:images',
         'jsoncpp.gyp:jsoncpp',
         'pdf.gyp:pdf',
+        'utils.gyp:utils',
       ],
       'conditions': [
         ['skia_os == "mac"', {
diff --git a/gyp/most.gyp b/gyp/most.gyp
index 1ad25ef..d32987f 100644
--- a/gyp/most.gyp
+++ b/gyp/most.gyp
@@ -10,7 +10,7 @@
       'type': 'none',
       'dependencies': [
         # The minimal set of static libraries for basic Skia functionality.
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
 
         'bench.gyp:bench',
         'gm.gyp:gm',
diff --git a/gyp/nacl.gyp b/gyp/nacl.gyp
index 3dd4c8e..484570b 100644
--- a/gyp/nacl.gyp
+++ b/gyp/nacl.gyp
@@ -5,7 +5,7 @@
       'target_name': 'nacl_interface',
       'type': 'static_library',
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
       ],
       'include_dirs': [
         # For SkThreadUtils.h
diff --git a/gyp/pathops_unittest.gyp b/gyp/pathops_unittest.gyp
index c7c32ef..a3ae936 100644
--- a/gyp/pathops_unittest.gyp
+++ b/gyp/pathops_unittest.gyp
@@ -27,8 +27,11 @@
         '../tests/Test.h',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'flags.gyp:flags',
+        'images.gyp:images',
+        'utils.gyp:utils',
       ],
       'conditions': [
         [ 'skia_gpu == 1', {
diff --git a/gyp/pdf.gyp b/gyp/pdf.gyp
index 31b48db..0e75914 100644
--- a/gyp/pdf.gyp
+++ b/gyp/pdf.gyp
@@ -6,7 +6,7 @@
       'type': 'static_library',
       'standalone_static_library': 1,
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
         'zlib.gyp:zlib',
       ],
       'include_dirs': [
diff --git a/gyp/pixman_test.gyp b/gyp/pixman_test.gyp
index a571dd7..64c5a9c 100644
--- a/gyp/pixman_test.gyp
+++ b/gyp/pixman_test.gyp
@@ -118,8 +118,10 @@
         '../../../pixman/pixman/pixman.h',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'experimental.gyp:experimental',
+        'images.gyp:images',
         'pdf.gyp:pdf',
         'views.gyp:views',
         'xml.gyp:xml',
diff --git a/gyp/ports.gyp b/gyp/ports.gyp
index 3422b8e..fc9bb9b 100644
--- a/gyp/ports.gyp
+++ b/gyp/ports.gyp
@@ -6,17 +6,18 @@
       'product_name': 'skia_ports',
       'type': 'static_library',
       'standalone_static_library': 1,
+      'dependencies': [
+        'core.gyp:core',
+        'sfnt.gyp:sfnt',
+        'utils.gyp:utils',
+      ],
       'include_dirs': [
-        '../include/config',
-        '../include/core',
         '../include/effects',
         '../include/images',
         '../include/ports',
-        '../include/utils',
         '../include/xml',
         '../src/core',
         '../src/lazy',
-        '../src/sfnt',
         '../src/utils',
       ],
       'sources': [
diff --git a/gyp/sfnt.gyp b/gyp/sfnt.gyp
index cc21b22..438f33e 100644
--- a/gyp/sfnt.gyp
+++ b/gyp/sfnt.gyp
@@ -5,9 +5,10 @@
       'product_name': 'skia_sfnt',
       'type': 'static_library',
       'standalone_static_library': 1,
+      'dependencies': [
+        'core.gyp:core',
+      ],
       'include_dirs': [
-        '../include/config',
-        '../include/core',
         '../src/sfnt',
       ],
       'sources': [
diff --git a/gyp/shapeops_demo.gyp b/gyp/shapeops_demo.gyp
index 83836ee..4537c01 100644
--- a/gyp/shapeops_demo.gyp
+++ b/gyp/shapeops_demo.gyp
@@ -69,7 +69,9 @@
         '../experimental/Intersection/TriangleUtilities.h',
      ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'views.gyp:views',
         'xml.gyp:xml',
       ],
diff --git a/gyp/shapeops_edge.gyp b/gyp/shapeops_edge.gyp
index e4e7d72..8c67cf7 100644
--- a/gyp/shapeops_edge.gyp
+++ b/gyp/shapeops_edge.gyp
@@ -115,7 +115,9 @@
         '../experimental/Intersection/thingsToDo.txt',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
       ],
       'conditions': [
         [ 'skia_gpu == 1', {
diff --git a/gyp/shapeops_tool.gyp b/gyp/shapeops_tool.gyp
index 35caccb..3b1408a 100644
--- a/gyp/shapeops_tool.gyp
+++ b/gyp/shapeops_tool.gyp
@@ -15,15 +15,23 @@
         '../experimental/Intersection/AddTestOutput/main.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'core.gyp:core',
+        'effects.gyp:effects',
         'experimental.gyp:experimental',
+        'images.gyp:images',
+        'ports.gyp:ports',
         'pdf.gyp:pdf',
+        'utils.gyp:utils',
       ],
       'conditions': [
         [ 'skia_gpu == 1', {
           'include_dirs': [
             '../src/gpu',
           ],
+          'dependencies': [
+            'gpu.gyp:gr',
+            'gpu.gyp:skgr',
+          ],
         }],
       ],
     },
diff --git a/gyp/skia_base_libs.gyp b/gyp/skia_base_libs.gyp
new file mode 100644
index 0000000..83cc7c7
--- /dev/null
+++ b/gyp/skia_base_libs.gyp
@@ -0,0 +1,52 @@
+# The minimal set of static libraries for basic Skia functionality.
+{
+  'variables': {
+    'component_libs': [
+      'core.gyp:core',
+      'opts.gyp:opts',
+      'ports.gyp:ports',
+      'utils.gyp:utils',
+    ],
+    'conditions': [
+      [ 'skia_arch_type == "x86" and skia_os != "android"', {
+        'component_libs': [
+          'opts.gyp:opts_ssse3',
+        ],
+      }],
+      [ 'arm_neon == 1', {
+        'component_libs': [
+          'opts.gyp:opts_neon',
+        ],
+      }],
+      [ 'skia_gpu', {
+        'component_libs': [
+          'gpu.gyp:gr',
+          'gpu.gyp:skgr',
+        ],
+      }],
+      [ 'skia_os == "nacl"', {
+        'component_libs': [
+          'freetype.gyp:freetype',
+        ],
+      }],
+    ],
+  },
+  'targets': [
+    {
+      'target_name': 'skia_base_libs',
+      'type': 'none',
+      'dependencies': [
+        '<@(component_libs)',
+      ],
+      'export_dependent_settings': [
+        '<@(component_libs)',
+      ],
+    },
+  ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/gyp/skia_lib.gyp b/gyp/skia_lib.gyp
deleted file mode 100644
index f85c5ad..0000000
--- a/gyp/skia_lib.gyp
+++ /dev/null
@@ -1,72 +0,0 @@
-# The minimal set of static libraries for basic Skia functionality.
-
-{
-  'variables': {
-    'component_libs': [
-      'core.gyp:core',
-      'effects.gyp:effects',
-      'images.gyp:images',
-      'opts.gyp:opts',
-      'ports.gyp:ports',
-      'sfnt.gyp:sfnt',
-      'utils.gyp:utils',
-    ],
-    'conditions': [
-      [ 'skia_arch_type == "x86" and skia_os != "android"', {
-        'component_libs': [
-          'opts.gyp:opts_ssse3',
-        ],
-      }],
-      [ 'arm_neon == 1', {
-        'component_libs': [
-          'opts.gyp:opts_neon',
-        ],
-      }],
-      [ 'skia_gpu', {
-        'component_libs': [
-          'gpu.gyp:gr',
-          'gpu.gyp:skgr',
-        ],
-      }],
-      [ 'skia_os == "nacl"', {
-        'component_libs': [
-          'freetype.gyp:freetype',
-        ],
-      }],
-    ],
-  },
-  'targets': [
-    {
-      'target_name': 'skia_lib',
-      'conditions': [
-        [ 'skia_shared_lib', {
-          'conditions': [
-            [ 'skia_os == "android"', {
-              # The name skia will confuse the linker on android into using the system's libskia.so
-              # instead of the one packaged with the apk. We simply choose a different name to fix
-              # this.
-              'product_name': 'skia_android',
-            }, {
-              'product_name': 'skia',
-            }],
-          ],
-          'type': 'shared_library',
-        }, {
-          'type': 'none',
-        }],
-      ],
-      'dependencies': [
-        '<@(component_libs)',
-      ],
-      'export_dependent_settings': [
-        '<@(component_libs)',
-      ],
-    },
-  ],
-}
-
-# Local Variables:
-# tab-width:2
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/gyp/tests.gyp b/gyp/tests.gyp
index 557fea5..10a4ba4 100644
--- a/gyp/tests.gyp
+++ b/gyp/tests.gyp
@@ -128,11 +128,15 @@
         '../src/pipe/utils/SamplePipeControllers.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'flags.gyp:flags',
         'experimental.gyp:experimental',
+        'images.gyp:images',
         'pdf.gyp:pdf',
         'tools.gyp:picture_utils',
+        'utils.gyp:utils',
+        'sfnt.gyp:sfnt',
       ],
       'conditions': [
         [ 'skia_gpu == 1', {
diff --git a/gyp/tools.gyp b/gyp/tools.gyp
index 25aa1db..ede028a 100644
--- a/gyp/tools.gyp
+++ b/gyp/tools.gyp
@@ -37,7 +37,9 @@
         '../tools/skdiff_utils.h',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
       ],
     },
     {
@@ -53,7 +55,9 @@
         '../tools/skdiff_utils.h',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
       ],
     },
     {
@@ -63,8 +67,10 @@
         '../tools/skhello.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'flags.gyp:flags',
+        'images.gyp:images',
       ],
     },
     {
@@ -78,9 +84,11 @@
         '../src/utils/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'flags.gyp:flags',
         'gm.gyp:gm_expectations',
+        'images.gyp:images',
         'jsoncpp.gyp:jsoncpp',
         'utils.gyp:utils',
       ],
@@ -94,7 +102,7 @@
         '../src/utils/SkLua.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
         'effects.gyp:effects',
         'utils.gyp:utils',
         'images.gyp:images',
@@ -115,9 +123,10 @@
         '../src/pipe/utils/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
         'tools.gyp:picture_renderer',
         'tools.gyp:picture_utils',
+        'ports.gyp:ports',
         'flags.gyp:flags',
       ],
     },
@@ -137,10 +146,12 @@
         '../src/lazy/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
         'tools.gyp:picture_utils',
         'tools.gyp:picture_renderer',
         'bench.gyp:bench_timer',
+        'ports.gyp:ports',
         'flags.gyp:flags',
       ],
     },
@@ -163,7 +174,9 @@
         '../src/utils/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'tools.gyp:picture_utils',
         'flags.gyp:flags',
       ],
@@ -176,6 +189,9 @@
           },
         ],
       ],
+      'export_dependent_settings': [
+        'images.gyp:images',
+      ],
     },
     {
       'target_name': 'render_pdfs',
@@ -190,8 +206,11 @@
         '../src/utils/',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'core.gyp:core',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'pdf.gyp:pdf',
+        'ports.gyp:ports',
         'tools.gyp:picture_utils',
       ],
       'conditions': [
@@ -238,7 +257,7 @@
         '../tools/picture_utils.h',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
       ],
       'direct_dependent_settings': {
         'include_dirs': [
@@ -253,7 +272,9 @@
         '../tools/pinspect.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
       ],
     },
     {
@@ -275,7 +296,9 @@
         '../debugger/SkObjectParser.cpp',
       ],
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'effects.gyp:effects',
+        'images.gyp:images',
         'tools.gyp:picture_utils',
       ],
     },
diff --git a/gyp/xps.gyp b/gyp/xps.gyp
index 29d5e07..3768742 100644
--- a/gyp/xps.gyp
+++ b/gyp/xps.gyp
@@ -6,7 +6,8 @@
       'type': 'static_library',
       'standalone_static_library': 1,
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
+        'skia_base_libs.gyp:skia_base_libs',
+        'images.gyp:images',
         'sfnt.gyp:sfnt',
       ],
       'include_dirs': [
diff --git a/platform_tools/android/app/src/com/skia/SkiaIntentService.java b/platform_tools/android/app/src/com/skia/SkiaIntentService.java
index 68d336e..e2707f7 100644
--- a/platform_tools/android/app/src/com/skia/SkiaIntentService.java
+++ b/platform_tools/android/app/src/com/skia/SkiaIntentService.java
@@ -16,7 +16,7 @@
   public SkiaIntentService() {
       super("SkiaIntentService");
   }
-
+  
   @Override
   public IBinder onBind(Intent arg0) {
       return null;
@@ -25,12 +25,12 @@
   public void onCreate() {
       super.onCreate();
   }
-
+  
   @Override
   public void onDestroy() {
       super.onDestroy();
   }
-
+  
   @Override
   public void onHandleIntent(Intent intent) {
 
@@ -51,11 +51,10 @@
       String cmd = bundle.getString("args").trim();
       String[] args = cmd.split("\\s+");
       Log.d("skia", "Executing Command: " + cmd);
-
+          
       // Load the requested library
       String lib = args[0];
       try {
-          System.loadLibrary("skia_android");
           System.loadLibrary(lib);
       } catch (UnsatisfiedLinkError e) {
           Log.e("skia", "Library " + lib +
@@ -63,7 +62,7 @@
           SkiaReturn(-1, returnRepeats);
           throw e;
       }
-
+      
       // JNI call to run the program
       int retval = run(args);
       SkiaReturn(retval, returnRepeats);
diff --git a/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java b/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java
index 62f81a5..4b5e7d6 100644
--- a/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java
+++ b/platform_tools/android/app/src/com/skia/SkiaSampleActivity.java
@@ -42,7 +42,6 @@
         mSlideList = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1);
 
         try {
-            System.loadLibrary("skia_android");
             System.loadLibrary("SampleApp");
 
             LinearLayout holder = (LinearLayout) findViewById(R.id.holder);
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index e5cea6e..b955bea 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -126,7 +126,6 @@
   DEFINES="${DEFINES} skia_os=android"
   DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.."
   DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}"
-  DEFINES="${DEFINES} skia_shared_lib=1"
 
   # Setup the build variation depending on the target device
   TARGET_DEVICE="$1"
diff --git a/platform_tools/android/gyp/skia_android.gypi b/platform_tools/android/gyp/skia_android.gypi
index 72dc942..43c59c1 100644
--- a/platform_tools/android/gyp/skia_android.gypi
+++ b/platform_tools/android/gyp/skia_android.gypi
@@ -4,7 +4,6 @@
       'target_name': 'CopySkiaAppDeps',
       'type': 'none',
       'dependencies': [
-        'skia_lib.gyp:skia_lib',
         'SampleApp.gyp:SampleApp',
         'bench.gyp:bench',
         'gm.gyp:gm',
@@ -57,7 +56,6 @@
             '<(PRODUCT_DIR)/lib.target/libtests.so',
             '<(PRODUCT_DIR)/lib.target/libpathops_unittest.so',
             '<(PRODUCT_DIR)/lib.target/gdbserver',
-            '<(PRODUCT_DIR)/lib.target/libskia_android.so',
           ],
         },
       ],
diff --git a/platform_tools/android/launcher/skia_launcher.cpp b/platform_tools/android/launcher/skia_launcher.cpp
index 231289d..972382d 100644
--- a/platform_tools/android/launcher/skia_launcher.cpp
+++ b/platform_tools/android/launcher/skia_launcher.cpp
@@ -28,29 +28,6 @@
     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 @@
         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;
     }