Beispiel #1
0
def find_lt_names_msvc(self,libname,is_static=False):
	lt_names=['lib%s.la'%libname,'%s.la'%libname,]
	for path in self.env['LIBPATH']:
		for la in lt_names:
			laf=os.path.join(path,la)
			dll=None
			if os.path.exists(laf):
				ltdict=Utils.read_la_file(laf)
				lt_libdir=None
				if ltdict.get('libdir',''):
					lt_libdir=ltdict['libdir']
				if not is_static and ltdict.get('library_names',''):
					dllnames=ltdict['library_names'].split()
					dll=dllnames[0].lower()
					dll=re.sub('\.dll$','',dll)
					return(lt_libdir,dll,False)
				elif ltdict.get('old_library',''):
					olib=ltdict['old_library']
					if os.path.exists(os.path.join(path,olib)):
						return(path,olib,True)
					elif lt_libdir!=''and os.path.exists(os.path.join(lt_libdir,olib)):
						return(lt_libdir,olib,True)
					else:
						return(None,olib,True)
				else:
					raise self.errors.WafError('invalid libtool object file: %s'%laf)
	return(None,None,None)
Beispiel #2
0
def find_lt_names_msvc(self,libname,is_static=False):
	lt_names=['lib%s.la'%libname,'%s.la'%libname,]
	for path in self.env['LIBPATH']:
		for la in lt_names:
			laf=os.path.join(path,la)
			dll=None
			if os.path.exists(laf):
				ltdict=Utils.read_la_file(laf)
				lt_libdir=None
				if ltdict.get('libdir',''):
					lt_libdir=ltdict['libdir']
				if not is_static and ltdict.get('library_names',''):
					dllnames=ltdict['library_names'].split()
					dll=dllnames[0].lower()
					dll=re.sub('\.dll$','',dll)
					return(lt_libdir,dll,False)
				elif ltdict.get('old_library',''):
					olib=ltdict['old_library']
					if os.path.exists(os.path.join(path,olib)):
						return(path,olib,True)
					elif lt_libdir!=''and os.path.exists(os.path.join(lt_libdir,olib)):
						return(lt_libdir,olib,True)
					else:
						return(None,olib,True)
				else:
					raise Errors.WafError('invalid libtool object file: %s'%laf)
	return(None,None,None)
Beispiel #3
0
def find_lt_names_msvc(self, libname, is_static=False):
	"""
	Win32/MSVC specific code to glean out information from libtool la files.
	this function is not attached to the task_gen class
	"""
	lt_names=[
		'lib%s.la' % libname,
		'%s.la' % libname,
	]

	for path in self.env['LIBPATH']:
		for la in lt_names:
			laf=os.path.join(path,la)
			dll=None
			if os.path.exists(laf):
				ltdict = Utils.read_la_file(laf)
				lt_libdir=None
				if ltdict.get('libdir', ''):
					lt_libdir = ltdict['libdir']
				if not is_static and ltdict.get('library_names', ''):
					dllnames=ltdict['library_names'].split()
					dll=dllnames[0].lower()
					dll=re.sub('\.dll$', '', dll)
					return (lt_libdir, dll, False)
				elif ltdict.get('old_library', ''):
					olib=ltdict['old_library']
					if os.path.exists(os.path.join(path,olib)):
						return (path, olib, True)
					elif lt_libdir != '' and os.path.exists(os.path.join(lt_libdir,olib)):
						return (lt_libdir, olib, True)
					else:
						return (None, olib, True)
				else:
					raise self.errors.WafError('invalid libtool object file: %s' % laf)
	return (None, None, None)
Beispiel #4
0
def find_lt_names_msvc(self, libname, is_static=False):
    """
	Win32/MSVC specific code to glean out information from libtool la files.
	this function is not attached to the task_gen class
	"""
    lt_names = ["lib%s.la" % libname, "%s.la" % libname]

    for path in self.env["LIBPATH"]:
        for la in lt_names:
            laf = os.path.join(path, la)
            dll = None
            if os.path.exists(laf):
                ltdict = Utils.read_la_file(laf)
                lt_libdir = None
                if ltdict.get("libdir", ""):
                    lt_libdir = ltdict["libdir"]
                if not is_static and ltdict.get("library_names", ""):
                    dllnames = ltdict["library_names"].split()
                    dll = dllnames[0].lower()
                    dll = re.sub("\.dll$", "", dll)
                    return (lt_libdir, dll, False)
                elif ltdict.get("old_library", ""):
                    olib = ltdict["old_library"]
                    if os.path.exists(os.path.join(path, olib)):
                        return (path, olib, True)
                    elif lt_libdir != "" and os.path.exists(os.path.join(lt_libdir, olib)):
                        return (lt_libdir, olib, True)
                    else:
                        return (None, olib, True)
                else:
                    raise self.errors.WafError("invalid libtool object file: %s" % laf)
    return (None, None, None)
Beispiel #5
0
def find_lt_names_msvc(self, libname, is_static=False):
	"""
	Win32/MSVC specific code to glean out information from libtool la files.
	this function is not attached to the task_gen class
	"""
	lt_names=[
		'lib%s.la' % libname,
		'%s.la' % libname,
	]

	for path in self.env['LIBPATH']:
		for la in lt_names:
			laf=os.path.join(path,la)
			dll=None
			if os.path.exists(laf):
				ltdict = Utils.read_la_file(laf)
				lt_libdir=None
				if ltdict.get('libdir', ''):
					lt_libdir = ltdict['libdir']
				if not is_static and ltdict.get('library_names', ''):
					dllnames=ltdict['library_names'].split()
					dll=dllnames[0].lower()
					dll=re.sub('\.dll$', '', dll)
					return (lt_libdir, dll, False)
				elif ltdict.get('old_library', ''):
					olib=ltdict['old_library']
					if os.path.exists(os.path.join(path,olib)):
						return (path, olib, True)
					elif lt_libdir != '' and os.path.exists(os.path.join(lt_libdir,olib)):
						return (lt_libdir, olib, True)
					else:
						return (None, olib, True)
				else:
					raise self.errors.WafError('invalid libtool object file: %s' % laf)
	return (None, None, None)
Beispiel #6
0
def find_lt_names_msvc(self, libname, is_static=False):
    """
    Win32/MSVC specific code to glean out information from libtool la files.
    this function is not attached to the task_gen class. Returns a triplet:
    (library absolute path, library name without extension, whether the library is static)
    """
    lt_names = ["lib%s.la" % libname, "%s.la" % libname]

    for path in self.env.LIBPATH:
        for la in lt_names:
            laf = os.path.join(path, la)
            dll = None
            if os.path.exists(laf):
                ltdict = Utils.read_la_file(laf)
                lt_libdir = None
                if ltdict.get("libdir", ""):
                    lt_libdir = ltdict["libdir"]
                if not is_static and ltdict.get("library_names", ""):
                    dllnames = ltdict["library_names"].split()
                    dll = dllnames[0].lower()
                    dll = re.sub(r"\.dll$", "", dll)
                    return (lt_libdir, dll, False)
                elif ltdict.get("old_library", ""):
                    olib = ltdict["old_library"]
                    if os.path.exists(os.path.join(path, olib)):
                        return (path, olib, True)
                    elif lt_libdir != "" and os.path.exists(
                        os.path.join(lt_libdir, olib)
                    ):
                        return (lt_libdir, olib, True)
                    else:
                        return (None, olib, True)
                else:
                    raise self.errors.WafError("invalid libtool object file: %s" % laf)
    return (None, None, None)