Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / lib / python2.4 / distutils / command / install_headers.py
CommitLineData
920dae64
AT
1"""distutils.command.install_headers
2
3Implements the Distutils 'install_headers' command, to install C/C++ header
4files to the Python include directory."""
5
6# This module should be kept compatible with Python 2.1.
7
8__revision__ = "$Id: install_headers.py,v 1.11 2004/11/10 22:23:15 loewis Exp $"
9
10import os
11from distutils.core import Command
12
13
14class install_headers (Command):
15
16 description = "install C/C++ header files"
17
18 user_options = [('install-dir=', 'd',
19 "directory to install header files to"),
20 ('force', 'f',
21 "force installation (overwrite existing files)"),
22 ]
23
24 boolean_options = ['force']
25
26 def initialize_options (self):
27 self.install_dir = None
28 self.force = 0
29 self.outfiles = []
30
31 def finalize_options (self):
32 self.set_undefined_options('install',
33 ('install_headers', 'install_dir'),
34 ('force', 'force'))
35
36
37 def run (self):
38 headers = self.distribution.headers
39 if not headers:
40 return
41
42 self.mkpath(self.install_dir)
43 for header in headers:
44 (out, _) = self.copy_file(header, self.install_dir)
45 self.outfiles.append(out)
46
47 def get_inputs (self):
48 return self.distribution.headers or []
49
50 def get_outputs (self):
51 return self.outfiles
52
53# class install_headers