Alien-SVN
view release on metacpan or search on metacpan
src/subversion/build/generator/gen_win.py view on Meta::CPAN
self.sqlite_path = 'sqlite-amalgamation'
self.skip_sections = { 'mod_dav_svn': None,
'mod_authz_svn': None,
'mod_dontdothat' : None,
'libsvn_auth_kwallet': None,
'libsvn_auth_gnome_keyring': None }
# Instrumentation options
self.disable_shared = None
self.static_apr = None
self.static_openssl = None
self.instrument_apr_pools = None
self.instrument_purify_quantify = None
self.configure_apr_util = None
self.sasl_path = None
# NLS options
self.enable_nls = None
# ML (assembler) is disabled by default; use --enable-ml to detect
self.enable_ml = None
for opt, val in options:
if opt == '--with-berkeley-db':
self.bdb_path = val
elif opt == '--with-apr':
self.apr_path = val
elif opt == '--with-apr-util':
self.apr_util_path = val
elif opt == '--with-apr-iconv':
self.apr_iconv_path = val
elif opt == '--with-serf':
self.serf_path = val
elif opt == '--with-httpd':
self.httpd_path = val
del self.skip_sections['mod_dav_svn']
del self.skip_sections['mod_authz_svn']
del self.skip_sections['mod_dontdothat']
elif opt == '--with-libintl':
self.libintl_path = val
self.enable_nls = 1
elif opt == '--with-jdk':
self.jdk_path = val
elif opt == '--with-junit':
self.junit_path = val
elif opt == '--with-zlib':
self.zlib_path = val
elif opt == '--with-swig':
self.swig_path = val
elif opt == '--with-sqlite':
self.sqlite_path = val
elif opt == '--with-sasl':
self.sasl_path = val
elif opt == '--with-openssl':
self.openssl_path = val
elif opt == '--enable-purify':
self.instrument_purify_quantify = 1
self.instrument_apr_pools = 1
elif opt == '--enable-quantify':
self.instrument_purify_quantify = 1
elif opt == '--enable-pool-debug':
self.instrument_apr_pools = 1
elif opt == '--enable-nls':
self.enable_nls = 1
elif opt == '--enable-bdb-in-apr-util':
self.configure_apr_util = 1
elif opt == '--enable-ml':
self.enable_ml = 1
elif opt == '--disable-shared':
self.disable_shared = 1
elif opt == '--with-static-apr':
self.static_apr = 1
elif opt == '--with-static-openssl':
self.static_openssl = 1
elif opt == '--vsnet-version':
if val == '2002' or re.match('7(\.\d+)?$', val):
self.vs_version = '2002'
self.sln_version = '7.00'
self.vcproj_version = '7.00'
self.vcproj_extension = '.vcproj'
elif val == '2003' or re.match('8(\.\d+)?$', val):
self.vs_version = '2003'
self.sln_version = '8.00'
self.vcproj_version = '7.10'
self.vcproj_extension = '.vcproj'
elif val == '2005' or re.match('9(\.\d+)?$', val):
self.vs_version = '2005'
self.sln_version = '9.00'
self.vcproj_version = '8.00'
self.vcproj_extension = '.vcproj'
elif val == '2008' or re.match('10(\.\d+)?$', val):
self.vs_version = '2008'
self.sln_version = '10.00'
self.vcproj_version = '9.00'
self.vcproj_extension = '.vcproj'
elif val == '2010':
self.vs_version = '2010'
self.sln_version = '11.00'
self.vcproj_version = '10.0'
self.vcproj_extension = '.vcxproj'
elif val == '2012' or val == '11':
self.vs_version = '2012'
self.sln_version = '12.00'
self.vcproj_version = '11.0'
self.vcproj_extension = '.vcxproj'
elif val == '2013' or val == '12':
self.vs_version = '2013'
self.sln_version = '12.00'
self.vcproj_version = '12.0'
self.vcproj_extension = '.vcxproj'
elif re.match('^1\d+$', val):
self.vs_version = val
self.sln_version = '12.00'
self.vcproj_version = val + '.0'
self.vcproj_extension = '.vcxproj'
else:
print('WARNING: Unknown VS.NET version "%s",'
' assuming "%s"\n' % (val, '7.00'))
def __init__(self, fname, verfname, options):
src/subversion/build/generator/gen_win.py view on Meta::CPAN
def __init__(self, fname, verfname, options, subdir):
"""
Do some Windows specific setup
Build the list of Platforms & Configurations &
create the necessary paths
"""
# Initialize parent
GeneratorBase.__init__(self, fname, verfname, options)
if self.bdb_lib is not None:
print("Found %s.lib or %sd.lib in %s\n" % (self.bdb_lib, self.bdb_lib,
self.bdb_path))
else:
print("BDB not found, BDB fs will not be built\n")
if subdir == 'vcnet-vcproj':
print('Generating for Visual Studio %s\n' % self.vs_version)
# Find the right Ruby include and libraries dirs and
# library name to link SWIG bindings with
self._find_ruby()
# Find the right Perl library name to link SWIG bindings with
self._find_perl()
# Find the right Python include and libraries dirs for SWIG bindings
self._find_python()
# Find the installed SWIG version to adjust swig options
self._find_swig()
# Find the installed Java Development Kit
self._find_jdk()
# Find APR and APR-util version
self._find_apr()
self._find_apr_util()
# Find Sqlite
self._find_sqlite()
# Look for ZLib and ML
if self.zlib_path:
self._find_zlib()
self._find_ml()
# Find serf and its dependencies
if self.serf_path:
self._find_serf()
#Make some files for the installer so that we don't need to
#require sed or some other command to do it
### GJS: don't do this right now
if 0:
buf = open(os.path.join("packages","win32-innosetup","svn.iss.in"), 'rb').read()
buf = buf.replace("@VERSION@", "0.16.1+").replace("@RELEASE@", "4365")
buf = buf.replace("@DBBINDLL@", self.dbbindll)
svnissrel = os.path.join("packages","win32-innosetup","svn.iss.release")
svnissdeb = os.path.join("packages","win32-innosetup","svn.iss.debug")
if self.write_file_if_changed(svnissrel, buf.replace("@CONFIG@", "Release")):
print('Wrote %s' % svnissrel)
if self.write_file_if_changed(svnissdeb, buf.replace("@CONFIG@", "Debug")):
print('Wrote %s' % svnissdeb)
#Make the project files directory if it doesn't exist
#TODO win32 might not be the best path as win64 stuff will go here too
self.projfilesdir=os.path.join("build","win32",subdir)
self.rootpath = self.find_rootpath()
if not os.path.exists(self.projfilesdir):
os.makedirs(self.projfilesdir)
# Generate the build_zlib.bat file
if self.zlib_path:
data = {'zlib_path': os.path.relpath(self.zlib_path, self.projfilesdir),
'zlib_version': self.zlib_version,
'use_ml': self.have_ml and 1 or None}
bat = os.path.join(self.projfilesdir, 'build_zlib.bat')
self.write_with_template(bat, 'templates/build_zlib.ezt', data)
# Generate the build_locale.bat file
pofiles = []
if self.enable_nls:
for po in os.listdir(os.path.join('subversion', 'po')):
if fnmatch.fnmatch(po, '*.po'):
pofiles.append(POFile(po[:-3]))
data = {'pofiles': pofiles}
self.write_with_template(os.path.join(self.projfilesdir,
'build_locale.bat'),
'templates/build_locale.ezt', data)
#Here we can add additional platforms to compile for
self.platforms = ['Win32']
# VC 2002 and VC 2003 only allow a single platform per project file
if subdir == 'vcnet-vcproj':
if self.vcproj_version != '7.00' and self.vcproj_version != '7.10':
self.platforms = ['Win32','x64']
#Here we can add additional modes to compile for
self.configs = ['Debug','Release']
if self.swig_libdir:
# Generate SWIG header wrappers and external runtime
for swig in (generator.swig.header_wrappers,
generator.swig.checkout_swig_header,
generator.swig.external_runtime):
swig.Generator(self.conf, self.swig_exe).write()
else:
print("%s not found; skipping SWIG file generation..." % self.swig_exe)
def find_rootpath(self):
"Gets the root path as understand by the project system"
return os.path.relpath('.', self.projfilesdir) + "\\"
def makeguid(self, data):
"Generate a windows style GUID"
### blah. this function can generate invalid GUIDs. leave it for now,
### but we need to fix it. we can wrap the apr UUID functions, or
( run in 0.501 second using v1.01-cache-2.11-cpan-02777c243ea )