Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py	(revision 51135)
+++ setuptools/command/egg_info.py	(working copy)
@@ -3,7 +3,7 @@
 Create a distribution's .egg-info directory and contents"""
 
 # This module should be kept compatible with Python 2.3
-import os, re
+import os, re, shutil
 from setuptools import Command
 from distutils.errors import *
 from distutils import log
@@ -365,8 +365,25 @@
     )
     cmd.write_file("top-level names", filename, '\n'.join(pkgs)+'\n')
 
+def write_headers(cmd, basame, filename):
+    headers = cmd.distribution.headers
 
+    if not cmd.dry_run:
+        if os.path.exists(filename):
+            shutil.rmtree(filename)
 
+        if headers:
+            os.mkdir(filename)
+
+    if headers is not None:
+        for header in headers:
+            bn = os.path.basename(header)
+            cmd.write_or_delete_file(
+                    'header %s'%(bn,),
+                    os.path.join(filename, bn),
+                    open(header, 'r').read())
+
+
 def overwrite_arg(cmd, basename, filename):
     write_arg(cmd, basename, filename, True)
 
Index: setuptools/command/build_ext.py
===================================================================
--- setuptools/command/build_ext.py	(revision 51135)
+++ setuptools/command/build_ext.py	(working copy)
@@ -5,7 +5,7 @@
 except ImportError:
     _build_ext = _du_build_ext
 
-import os, sys
+import os, sys, shutil
 from distutils.file_util import copy_file
 from setuptools.extension import Library
 from distutils.ccompiler import new_compiler
@@ -14,6 +14,7 @@
 from distutils.sysconfig import _config_vars
 from distutils import log
 from distutils.errors import *
+import pkg_resources
 
 have_rtld = False
 use_stubs = False
@@ -43,11 +44,46 @@
     def run(self):
         """Build extensions in build directory, then copy if --inplace"""
         old_inplace, self.inplace = self.inplace, 0
+        old_include_dirs = self.include_dirs
+        self.include_dirs = list(old_include_dirs)
+        self.add_extra_includes()
         _build_ext.run(self)
+        self.remove_extra_includes()
         self.inplace = old_inplace
+        self.include_dirs = old_include_dirs
         if old_inplace:
             self.copy_extensions_to_source()
 
+    def add_extra_includes(self):
+        # XXX: This is a crude hack: extract all header files from meta-data and
+        # then create a temporary directory that contains all headers.
+        # 
+        header_map = {}
+        for dist in pkg_resources.working_set:
+            provider = pkg_resources.get_provider(dist.as_requirement())
+            if provider.has_metadata('include') \
+                    and provider.metadata_isdir('include'):
+                headers = provider.metadata_listdir('include')
+                for hn in headers:
+                    header_map[hn] = provider.get_metadata(
+                            'include/%s'%(hn,))
+
+        if not header_map:
+            return
+
+        include_dir = os.path.join(self.build_temp, 'egg-include')
+        if os.path.exists(include_dir):
+            shutil.rmtree(include_dir)
+        os.makedirs(include_dir)
+        for hn, contents in header_map.iteritems():
+            open(os.path.join(include_dir, hn), 'w').write(contents)
+        self.include_dirs.append(include_dir)
+
+    def remove_extra_includes(self):
+        include_dir = os.path.join(self.build_temp, 'egg-include')
+        if os.path.exists(include_dir):
+            shutil.rmtree(include_dir)
+
     def copy_extensions_to_source(self):
         build_py = self.get_finalized_command('build_py')
         for ext in self.extensions:
Index: setup.py
===================================================================
--- setup.py	(revision 51135)
+++ setup.py	(working copy)
@@ -70,6 +70,7 @@
             "top_level.txt = setuptools.command.egg_info:write_toplevel_names",
             "depends.txt = setuptools.command.egg_info:warn_depends_obsolete",
             "dependency_links.txt = setuptools.command.egg_info:overwrite_arg",
+            "include = setuptools.command.egg_info:write_headers",
         ],
         "console_scripts": [
              "easy_install = setuptools.command.easy_install:main",
Index: setuptools.egg-info/entry_points.txt
===================================================================
--- setuptools.egg-info/entry_points.txt	(revision 51135)
+++ setuptools.egg-info/entry_points.txt	(working copy)
@@ -25,10 +25,11 @@
 namespace_packages.txt = setuptools.command.egg_info:overwrite_arg
 entry_points.txt = setuptools.command.egg_info:write_entries
 depends.txt = setuptools.command.egg_info:warn_depends_obsolete
+include = setuptools.command.egg_info:write_headers
 
 [console_scripts]
 easy_install = setuptools.command.easy_install:main
-easy_install-2.3 = setuptools.command.easy_install:main
+easy_install-2.5 = setuptools.command.easy_install:main
 
 [distutils.commands]
 bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm
@@ -39,7 +40,6 @@
 saveopts = setuptools.command.saveopts:saveopts
 egg_info = setuptools.command.egg_info:egg_info
 register = setuptools.command.register:register
-upload = setuptools.command.upload:upload
 install_egg_info = setuptools.command.install_egg_info:install_egg_info
 alias = setuptools.command.alias:alias
 easy_install = setuptools.command.easy_install:easy_install
