refactor gyp to isolate freetype usage

R=bungeman@google.com

Review URL: https://codereview.chromium.org/19835002

git-svn-id: http://skia.googlecode.com/svn/trunk@10229 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/freetype.gyp b/gyp/freetype.gyp
index f72c29c..91fc0b3 100644
--- a/gyp/freetype.gyp
+++ b/gyp/freetype.gyp
@@ -2,6 +2,44 @@
   'targets': [
     {
       'target_name': 'freetype',
+      'type': 'none',
+      'conditions': [
+        [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
+          'direct_dependent_settings': {
+            'include_dirs' : [
+              '/usr/include/freetype2',
+            ],
+            'link_settings': {
+              'libraries': [
+                '-lfreetype',
+              ],
+              'defines': [
+                #The font host requires at least FreeType 2.3.0 at runtime.
+                'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020300',\
+                'SK_CAN_USE_DLOPEN=1',
+              ],
+            }
+          },
+        }],
+        [ 'skia_os in ["android", "nacl"]', {
+          'dependencies': [
+            'freetype_static'
+          ],
+          'export_dependent_settings': [
+            'freetype_static'
+          ],
+          'direct_dependent_settings': {
+            'defines': [
+              # Both Android and NaCl provide at least FreeType 2.4.0
+              'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
+              'SK_CAN_USE_DLOPEN=0',
+            ],
+          },
+        }],
+      ],
+    },
+    {
+      'target_name': 'freetype_static',
       'type': 'static_library',
       'standalone_static_library': 1,
       'sources': [