Alien-SVN
view release on metacpan or search on metacpan
src/subversion/build/generator/gen_win.py view on Meta::CPAN
'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
### implement this from scratch using the algorithms described in
### http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt
myhash = hashlib_md5(data).hexdigest()
guid = ("{%s-%s-%s-%s-%s}" % (myhash[0:8], myhash[8:12],
myhash[12:16], myhash[16:20],
myhash[20:32])).upper()
return guid
def path(self, *paths):
"""Convert build path to msvc path and prepend root"""
return self.rootpath + msvc_path_join(*list(map(msvc_path, paths)))
def apath(self, path, *paths):
"""Convert build path to msvc path and prepend root if not absolute"""
### On Unix, os.path.isabs won't do the right thing if "item"
### contains backslashes or drive letters
if os.path.isabs(path):
return msvc_path_join(msvc_path(path), *list(map(msvc_path, paths)))
else:
return self.rootpath + msvc_path_join(msvc_path(path),
*list(map(msvc_path, paths)))
def get_install_targets(self):
"Generate the list of targets"
# Get list of targets to generate project files for
install_targets = self.graph.get_all_sources(gen_base.DT_INSTALL) \
+ self.projects
# Don't create projects for scripts
install_targets = [x for x in install_targets if not isinstance(x, gen_base.TargetScript)]
# Drop the libsvn_fs_base target and tests if we don't have BDB
if not self.bdb_lib:
install_targets = [x for x in install_targets if x.name != 'libsvn_fs_base']
install_targets = [x for x in install_targets if not (isinstance(x, gen_base.TargetExe)
and x.install == 'bdb-test')]
# Don't build serf when we don't have it or for 1.3+
if not self.serf_lib or (self.serf_ver_maj, self.serf_ver_min) >= (1, 3):
install_targets = [x for x in install_targets if x.name != 'serf']
# Drop the serf target if we don't have both serf and openssl
if not self.serf_lib:
install_targets = [x for x in install_targets if x.name != 'libsvn_ra_serf']
# Don't build zlib if we have an already compiled serf
if self.serf_lib and (self.serf_ver_maj, self.serf_ver_min) >= (1, 3):
install_targets = [x for x in install_targets if x.name != 'zlib']
# Drop the swig targets if we don't have swig
if not self.swig_path and not self.swig_libdir:
install_targets = [x for x in install_targets
if not (isinstance(x, gen_base.TargetSWIG)
or isinstance(x, gen_base.TargetSWIGLib)
or isinstance(x, gen_base.TargetSWIGProject))]
# Drop the Java targets if we don't have a JDK
if not self.jdk_path:
install_targets = [x for x in install_targets
if not (isinstance(x, gen_base.TargetJava)
or isinstance(x, gen_base.TargetJavaHeaders)
or x.name == '__JAVAHL__'
or x.name == '__JAVAHL_TESTS__'
or x.name == 'libsvnjavahl')]
dll_targets = []
for target in install_targets:
if isinstance(target, gen_base.TargetLib):
if target.msvc_fake:
install_targets.append(self.create_fake_target(target))
if target.msvc_export:
if self.disable_shared:
target.msvc_static = True
else:
( run in 0.581 second using v1.01-cache-2.11-cpan-39bf76dae61 )