add libpng source to repo and make Unix build use it
http://codereview.appspot.com/4572067



git-svn-id: http://skia.googlecode.com/svn/trunk/gyp@1591 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/images.gyp b/images.gyp
index fef7aae..7f2c8a4 100644
--- a/images.gyp
+++ b/images.gyp
@@ -84,17 +84,19 @@
             '../src/images/SkJpegUtility.cpp',
             '../src/images/SkMovie_gif.cpp',
           ],
+          # libpng stuff:
+          # Any targets that depend on this target should link in libpng and
+          # our code that calls it.
+          # See http://code.google.com/p/gyp/wiki/InputFormatReference#Dependent_Settings
+          'dependencies' : [
+            'libpng.gyp:libpng',
+          ],
           'link_settings': {
-            # Any targets that depend on this target should link in libpng and
-            # our code that calls it.
-            # See http://code.google.com/p/gyp/wiki/InputFormatReference#Dependent_Settings
             'sources': [
               '../src/images/SkImageDecoder_libpng.cpp',
             ],
-            'libraries': [
-              '-lpng',
-            ],
           },
+          # end libpng stuff
         }],
 
       ],
diff --git a/libpng.gyp b/libpng.gyp
new file mode 100644
index 0000000..07e89df
--- /dev/null
+++ b/libpng.gyp
@@ -0,0 +1,48 @@
+# Gyp config to build libpng as needed for Skia.
+{
+  'targets': [
+    {
+      'target_name': 'libpng',
+      'type': 'static_library',
+      'include_dirs': [
+        '../third_party/libpng',
+      ],
+      'sources': [
+        '../third_party/libpng/png.h',
+        '../third_party/libpng/pngconf.h',
+        '../third_party/libpng/pngdebug.h',
+        '../third_party/libpng/pnginfo.h',
+        '../third_party/libpng/pnglibconf.h',
+        '../third_party/libpng/pngpriv.h',
+        '../third_party/libpng/pngstruct.h',
+
+        '../third_party/libpng/png.c',
+        '../third_party/libpng/pngerror.c',
+        '../third_party/libpng/pngget.c',
+        '../third_party/libpng/pngmem.c',
+        '../third_party/libpng/pngpread.c',
+        '../third_party/libpng/pngread.c',
+        '../third_party/libpng/pngrio.c',
+        '../third_party/libpng/pngrtran.c',
+        '../third_party/libpng/pngrutil.c',
+        '../third_party/libpng/pngset.c',
+        '../third_party/libpng/pngtrans.c',
+        '../third_party/libpng/pngwio.c',
+        '../third_party/libpng/pngwrite.c',
+        '../third_party/libpng/pngwtran.c',
+        '../third_party/libpng/pngwutil.c',
+      ],
+      'all_dependent_settings': {
+        'include_dirs': [
+          '../third_party/libpng',
+        ],
+      },
+    },
+  ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2: