setup.py revision 2508
290N/A# The contents of this file are subject to the terms of the 290N/A# Common Development and Distribution License (the "License"). 290N/A# You may not use this file except in compliance with the License. 290N/A# See the License for the specific language governing permissions 290N/A# and limitations under the License. 290N/A# When distributing Covered Code, include this CDDL HEADER in each 290N/A# If applicable, add the following below this CDDL HEADER, with the 290N/A# fields enclosed by brackets "[]" replaced with your own identifying 290N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2339N/A# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 534N/A# Unbuffer stdout and stderr. This helps to ensure that subprocess output 534N/A# is properly interleaved with output from this program. 1674N/A# A list of source, destination tuples of modules which should be hardlinked 1674N/A# together if the os supports it and otherwise copied. 2339N/A# Runs lint on the extension module source code 2339N/A # Make string shell-friendly 2339N/A # Insert tests directory onto sys.path so any custom checkers 2339N/A # assumes pylint is accessible on the sys.path 2339N/A # For some reason, the load-plugins option, when used in the 2339N/A # rcfile, does not work, so we put it here instead, to load 2339N/A # Unfortunately, pylint seems pretty fragile and will crash if 2339N/A # we try to run it over all the current pkg source. Hence for 2339N/A # now we only run it over a subset of the source. As source 2339N/A # files are made pylint clean they should be added to the 290N/A# Runs lint on the extension module source code 290N/A # Make string shell-friendly 290N/A # assumes lint is on the $PATH 2339N/A# Runs both C and Python lint 2339N/A # Make string shell-friendly 506N/A # PRIVATE_BUILD set in the environment tells us to put the build 506N/A # directory into the .pyc files, rather than the final 506N/A # installation directory. 506N/A # This is used when installing scripts, below, but it isn't a 506N/A # standard distutils variable. 395N/A At the end of the install function, we need to rename some files 849N/A because distutils provides no way to rename files as they are 849N/A placed in their install locations. 883N/A Also, make sure that cherrypy and other external dependencies 395N/A # make scripts executable 1208N/A "Please retrieve the file " \
395N/A # remove a partial download or error message from proxy 395N/A # extractall doesn't exist until python 2.5 1191N/A # If there are patches, apply them now. 849N/A """ Run python's compiler over the file, and discard the results. 849N/A Arrange to generate an exception if the file does not compile. 849N/A This is needed because distutil's own use of pycompile (in the 849N/A distutils.utils module) is broken, and doesn't stop on error. """ 2242N/A # Assume it's a tuple of (filename, lineno, col, code) 2508N/A# On Solaris, ld inserts the full argument to the -o option into the symbol 2508N/A# table. This means that the resulting object will be different depending on 2508N/A# the path at which the workspace lives, and not just on the interesting content 2508N/A# In order to work around that bug (7076871), we create a new compiler class 2508N/A# that looks at the argument indicating the output file, chdirs to its 2508N/A# directory, and runs the real link with the output file set to just the base 2508N/A# Unfortunately, distutils isn't too customizable in this regard, so we have to 2508N/A# twiddle with a couple of the names in the distutils.ccompiler namespace: we 2508N/A# have to add a new entry to the compiler_class dict, and we have to override 2508N/A# the new_compiler() function to point to our own. Luckily, our copy of 2508N/A# new_compiler() gets to be very simple, since we always know what we want to 2508N/A 'unixccompiler',
'MyUnixCCompiler',
2508N/A 'standard Unix-style compiler with a link stage modified for Solaris' 2508N/A # Gather the timestamps of the .py files in the gate, so we can 2508N/A # force the mtimes of the built and delivered copies to be 2508N/A # consistent across builds, causing their corresponding .pyc 2508N/A # files to be unchanged unless the .py file content changed. 383N/A # override the build_module method to do VERSION substitution on pkg/__init__.py 422N/A # Grab the previously-built version out of the build 422N/A # If the versions haven't changed, there's no need to 383N/A print "doing version substitution: ", v
849N/A # Will raise a DistutilsError on failure. 2508N/A # If the timestamp on the source file (coming from mercurial if 2508N/A # unchanged, or from the filesystem if changed) doesn't match 2508N/A # the filesystem timestamp on the destination, then force the 2508N/A # copy to make sure the right data is in place. 2508N/A # If we copied the file, then we need to go and readjust the 2508N/A # timestamp on the file to match what we have in our database. 1101N/A # list of options stored in initialize_options below. The first entry 1101N/A # in each tuple must be the exact name of a member variable. 1715N/A (
"archivedir=",
'a',
"archive failed tests <dir>"),
1513N/A (
"baselinefile=",
'b',
"baseline file <file>"),
1513N/A (
"coverage",
"c",
"collect code coverage data"),
448N/A (
"genbaseline",
'g',
"generate test baseline"),
1513N/A (
"only=",
"o",
"only <regex>"),
448N/A (
"parseable",
'p',
"parseable output"),
2272N/A (
"port=",
"z",
"lowest port to start a depot on"),
1101N/A (
"timing",
"t",
"timing file <file>"),
1513N/A (
"verbosemode",
'v',
"run tests in verbose mode"),
2340N/A (
"enableguitests",
'u',
"enable IPS GUI tests, disabled by default"),
1715N/A (
"stoponerr",
'x',
"stop when a baseline mismatch occurs"),
1715N/A (
"debugoutput",
'd',
"emit debugging output"),
1716N/A (
"showonexpectedfail",
'f',
1715N/A "show all failure info, even for expected fails"),
1715N/A (
"startattest=",
's',
"start at indicated test"),
2499N/A (
"jobs=",
'j',
"number of parallel processes to use"),
2499N/A (
"quiet",
"q",
"use the dots as the output format"),
290N/A# These are set to real values based on the platform, down below 383N/A# all builds of IPS should have manpages 395N/A # Solaris-specific extensions are added here 395N/A # Unix platforms which the elf extension has been ported to 395N/A # are specified here, so they are built automatically 395N/A # Solaris has built-in md library and Solaris-specific arch extension 395N/A # All others use OpenSSL and cross-platform arch module