Exemplo n.º 1
0
 def __init__(self, name, checkhead, checklib, libs=None):
     if libs is None:
         libs = [dll.name_to_root(name)]
     self.name = name
     self.inc_dir = None
     self.lib_dir = None
     self.libs = libs
     self.found = 0
     self.checklib = checklib
     self.checkhead = checkhead
     self.cflags = ''
Exemplo n.º 2
0
 def __init__(self, name, libs=None):
     if libs is None:
         libs = dll.libraries(name)
     self.name = 'COPYLIB_' + dll.name_to_root(name)
     self.inc_dir = None
     self.lib_dir = '_'
     self.libs = libs
     self.found = 1  # Alway found to make its COPYLIB work
     self.cflags = ''
     self.lib_name = name
     self.file_name_test = dll.tester(name)
Exemplo n.º 3
0
 def __init__(self, name, libs=None):
     if libs is None:
         libs = dll.libraries(name)
     self.name = 'COPYLIB_' + dll.name_to_root(name)
     self.inc_dir = None
     self.lib_dir = '_'
     self.libs = libs
     self.found = 1  # Alway found to make its COPYLIB work
     self.cflags = ''
     self.lib_name = name
     self.file_name_test = dll.tester(name)
Exemplo n.º 4
0
 def __init__(self, name, checkhead, checklib, libs=None):
     if libs is None:
         libs = [dll.name_to_root(name)]
     self.name = name
     self.inc_dir = None
     self.lib_dir = None
     self.libs = libs
     self.found = 0
     self.checklib = checklib
     self.checkhead = checkhead
     self.cflags = ''
Exemplo n.º 5
0
 def __init__(self, name=None, inc_dir_rel=None, lib_dir_rel=None, libs=None, cflags=None):
     if libs is None:
         if name is None:
             libs = []
         else:
             libs = [dll.name_to_root(name)]
     if cflags is None:
         cflags = ''
     self.libs = libs
     self.inc_dir = None
     self.lib_dir = None
     if inc_dir_rel is not None:
         self.inc_dir = '%s/%s' % (test_dir, inc_dir_rel)
     if lib_dir_rel is not None:
         self.lib_dir = '%s/%s' % (test_dir, lib_dir_rel)
     self.cflags = cflags
Exemplo n.º 6
0
 def __init__(self,
              name=None,
              inc_dir_rel=None,
              lib_dir_rel=None,
              libs=None,
              cflags=None):
     if libs is None:
         if name is None:
             libs = []
         else:
             libs = [dll.name_to_root(name)]
     if cflags is None:
         cflags = ''
     self.libs = libs
     self.inc_dir = None
     self.lib_dir = None
     if inc_dir_rel is not None:
         self.inc_dir = '%s/%s' % (test_dir, inc_dir_rel)
     if lib_dir_rel is not None:
         self.lib_dir = '%s/%s' % (test_dir, lib_dir_rel)
     self.cflags = cflags
Exemplo n.º 7
0
 def __init__(self, name, envname, exename, minver, msys, defaultlibs=None):
     if defaultlibs is None:
         defaultlibs = [dll.name_to_root(name)]
     self.name = name
     try:
         command = os.environ[envname]
     except KeyError:
         command = exename
     else:
         drv, pth = os.path.splitdrive(command)
         if drv:
             command = '/' + drv[0] + pth
     self.lib_dir = ''
     self.inc_dir = ''
     self.libs = []
     self.cflags = ''
     try:
         config = msys.run_shell_command(
             [command, '--version', '--cflags', '--libs'])
         ver, flags = config.split('\n', 1)
         self.ver = ver.strip()
         flags = flags.split()
         if minver and self.ver < minver:
             err = 'WARNING: requires %s version %s (%s found)' % (
                 self.name, self.ver, minver)
             raise ValueError, err
         self.found = 1
         self.cflags = ''
         for f in flags:
             if f[:2] in ('-I', '-L'):
                 self.cflags += f[:2] + msys.msys_to_windows(f[2:]) + ' '
             elif f[:2] in ('-l', '-D'):
                 self.cflags += f + ' '
             elif f[:3] == '-Wl':
                 self.cflags += '-Xlinker ' + f + ' '
     except:
         print_('WARNING: "%s" failed!' % command)
         self.found = 0
         self.ver = '0'
         self.libs = defaultlibs
Exemplo n.º 8
0
 def __init__(self, name, envname, exename, minver, msys, defaultlibs=None):
     if defaultlibs is None:
         defaultlibs = [dll.name_to_root(name)]
     self.name = name
     try:
         command = os.environ[envname]
     except KeyError:
         command = exename
     else:
         drv, pth = os.path.splitdrive(command)
         if drv:
             command = '/' + drv[0] + pth
     self.lib_dir = ''
     self.inc_dir = ''
     self.libs = []
     self.cflags = ''
     try:
         config = msys.run_shell_command([command, '--version', '--cflags', '--libs'])
         ver, flags = config.split('\n', 1)
         self.ver = ver.strip()
         flags = flags.split()
         if minver and self.ver < minver:
             err= 'WARNING: requires %s version %s (%s found)' % (self.name, self.ver, minver)
             raise ValueError(err)
         self.found = 1
         self.cflags = ''
         for f in flags:
             if f[:2] in ('-I', '-L'):
                 self.cflags += f[:2] + msys.msys_to_windows(f[2:]) + ' '
             elif f[:2] in ('-l', '-D'):
                 self.cflags += f + ' '
             elif f[:3] == '-Wl':
                 self.cflags += '-Xlinker ' + f + ' '
     except:
         print_('WARNING: "%s" failed!' % command)
         self.found = 0
         self.ver = '0'
         self.libs = defaultlibs
Exemplo n.º 9
0
 def test_dll_match(self):
     """Ensure DLLs match with dll.py."""
     for name in dll.regexs:
         self.failUnless('COPYLIB_' + dll.name_to_root(name) in dependencies, name)
Exemplo n.º 10
0
 def test_dll_match(self):
     """Ensure DLLs match with dll.py."""
     for name in dll.regexs:
         self.failUnless(
             'COPYLIB_' + dll.name_to_root(name) in dependencies, name)
Exemplo n.º 11
0
 def test():
     dll.name_to_root('*')
Exemplo n.º 12
0
 def test_found(self):
     """Ensure name -> file root name works for at least one case"""
     self.failUnlessEqual(dll.name_to_root('FONT'), 'SDL_ttf')
Exemplo n.º 13
0
 def test():
     dll.name_to_root('*')
Exemplo n.º 14
0
 def test_found(self):
     """Ensure name -> file root name works for at least one case"""
     self.failUnlessEqual(dll.name_to_root('FONT'), 'SDL_ttf')