def libtool_disable_install_not_into_dot_libs_test(logger, file): '''libtool: install: error: cannot install `libexslt.la' to a directory not ending in /home/janneke/vc/gub/target/mingw/build/libxslt-1.1.24/libexslt/.libs''' loggedos.file_sub( logger, [(r'if test "\$inst_prefix_dir" = "\$destdir"; then', 'if false && test "$inst_prefix_dir" = "$destdir"; then'), (r' test "\$inst_prefix_dir" = "\$destdir" &&', ' false && test "$inst_prefix_dir" = "$destdir" &&')], file)
def fix_allow_undefined (logger, file): loggedos.file_sub (logger, [ # libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries ('^(allow_undefined_flag=.*)unsupported', '\\1'), # libtool: install: error: cannot install `libexslt.la' to a directory not ending in /home/janneke/vc/gub/target/mingw/build/libxslt-1.1.24/libexslt/.libs (r'if test "\$inst_prefix_dir" = "\$destdir";', 'if false;'),], file)
def libtool_disable_install_not_into_dot_libs_test (logger, file): '''libtool: install: error: cannot install `libexslt.la' to a directory not ending in /home/janneke/vc/gub/target/mingw/build/libxslt-1.1.24/libexslt/.libs''' loggedos.file_sub (logger, [ (r'if test "\$inst_prefix_dir" = "\$destdir"; then', 'if false && test "$inst_prefix_dir" = "$destdir"; then'), (r' test "\$inst_prefix_dir" = "\$destdir" &&', ' false && test "$inst_prefix_dir" = "$destdir" &&')], file)
def libtool_force_infer_tag (logger, tag, file): ''' libtool: compile: unable to infer tagged configuration ''' loggedos.file_sub (logger, [('^func_infer_tag ', '''func_infer_tag () { tagname=%(tag)s } old_func_infer_tag ''' % locals ())], file)
def libtool_force_infer_tag(logger, tag, file): ''' libtool: compile: unable to infer tagged configuration ''' loggedos.file_sub(logger, [('^func_infer_tag ', '''func_infer_tag () { tagname=%(tag)s } old_func_infer_tag ''' % locals())], file)
def add_CFLAGS_LDFLAGS_already(logger, file): loggedos.file_sub(logger, [('-L(NONE|no_x_libraries|/usr/lib)', self.expand('-L%(system_prefix)s/lib')), ('-I(NONE|no_x_includes|/usr/include)', self.expand('-I%(system_prefix)s/include')), ('(LD_LIBRARY_PATH=.*)', self.expand(r'\1:%(system_prefix)s/lib'))], file)
def fix_allow_undefined(logger, file): loggedos.file_sub( logger, [ # libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries ('^(allow_undefined_flag=.*)unsupported', '\\1'), # libtool: install: error: cannot install `libexslt.la' to a directory not ending in /home/janneke/vc/gub/target/mingw/build/libxslt-1.1.24/libexslt/.libs (r'if test "\$inst_prefix_dir" = "\$destdir";', 'if false;' ), ], file)
def pkgconfig_pc_fixup(self, root, file, prefix_dir): # avoid using libs from build platform, by adding # %(system_root)s if file.startswith('./'): file = file[2:] dir = os.path.dirname(file) if '%' in prefix_dir or not prefix_dir: barf loggedos.file_sub(gub_log.default_logger, [ ('(-I|-L) */usr', '''\\1%(root)s%(prefix_dir)s''' % locals()), ], '%(root)s/%(file)s' % locals())
def libtool_disable_rpath(logger, libtool, rpath, file): # Must also keep -rpath $libdir, because when build_arch == # target_arch we may run build-time executables. Either that, or # set LD_LIBRARY_PATH somewhere. loggedos.file_sub( logger, [( '^(hardcode_libdir_flag_spec)=".+"', # r'\1' (r'hardcode_libdir_flag_spec="' + '-Wl,-rpath -Wl,\$libdir' + (' %(rpath)s' % locals()).replace('\\$$', "'$'") + '"'))], file)
def fixup(logger, file): file = file.strip() if not file: return dir = os.path.split(file)[0] suffix = '/.libs' if re.search('\\.libs$', dir): suffix = '' loggedos.file_sub(logger, [ ("libdir='/usr/lib'", self.expand("libdir='%(dir)s%(suffix)s'", env=locals())), ], file)
def libtool_disable_rpath (logger, libtool, rpath, file): # Must also keep -rpath $libdir, because when build_arch == # target_arch we may run build-time executables. Either that, or # set LD_LIBRARY_PATH somewhere. loggedos.file_sub (logger, [('^(hardcode_libdir_flag_spec)=".+"', # r'\1' (r'hardcode_libdir_flag_spec="' + '-Wl,-rpath -Wl,\$libdir' + (' %(rpath)s' % locals ()).replace ('\\$$', "'$'") + '"') )], file)
def pkgconfig_pc_fixup (self, root, file, prefix_dir): # avoid using libs from build platform, by adding # %(system_root)s if file.startswith ('./'): file = file[2:] dir = os.path.dirname (file) if '%' in prefix_dir or not prefix_dir: barf loggedos.file_sub (logging.default_logger, [('(-I|-L) */usr', '''\\1%(root)s%(prefix_dir)s''' % locals () ),], '%(root)s/%(file)s' % locals ())
def libtool_la_fixup (self, root, file): # avoid using libs from build platform, by adding # %(system_root)s if file.startswith ('./'): file = file[2:] dir = os.path.dirname (file) loggedos.file_sub (logging.default_logger, [('^libdir=.*', """libdir='%(root)s/%(dir)s'""" % locals () ),], '%(root)s/%(file)s' % locals (), must_succeed=('tools/root' not in self.root and 'cross' not in dir and '/GUB' not in self.root))
def libtool_la_fixup(self, root, file): # avoid using libs from build platform, by adding # %(system_root)s if file.startswith('./'): file = file[2:] dir = os.path.dirname(file) loggedos.file_sub(gub_log.default_logger, [ ('^libdir=.*', """libdir='%(root)s/%(dir)s'""" % locals()), ], '%(root)s/%(file)s' % locals(), must_succeed=('tools/root' not in self.root and 'tools32/root' not in self.root and 'cross' not in dir and '/GUB' not in self.root))
def fixup (logger, file): file = file.strip () if not file: return dir = os.path.split (file)[0] suffix = '/.libs' if re.search ('\\.libs$', dir): suffix = '' loggedos.file_sub (logger, [("libdir='/usr/lib'", self.expand ("libdir='%(dir)s%(suffix)s'", env=locals ())), ], file)
def installed_la_fixup (logger, la): (dir, base) = os.path.split (la) base = base[3:-3] dir = re.sub (r"^\./", "/", dir) loggedos.file_sub (logger, [(''' *-L *[^\"\' ][^\"\' ]*''', ''), (self.expand ('''( |=|\')(/[^ ]*usr/lib|%(targetdir)s.*)/lib([^ \'/]*)\.(a|la|so)[^ \']*'''), '\\1-l\\3 '), ('^old_library=.*', self.expand ("""old_library='lib%(base)s.a'""", env=locals ())), ], la) if self.settings.platform.startswith ('mingw'): loggedos.file_sub (logger, [('library_names=.*', self.expand ("library_names='lib%(base)s.dll.a'", env=locals ()))], la)
def libtool_force_infer_tag(logger, tag, file): """ libtool: compile: unable to infer tagged configuration """ loggedos.file_sub( logger, [ ( "^func_infer_tag ", """func_infer_tag () { tagname=%(tag)s } old_func_infer_tag """ % locals(), ) ], file, )
def installed_la_fixup(logger, la): (dir, base) = os.path.split(la) base = base[3:-3] dir = re.sub(r"^\./", "/", dir) loggedos.file_sub(logger, [ (''' *-L *[^\"\' ][^\"\' ]*''', ''), (self.expand( '''( |=|\')(/[^ ]*usr/lib|%(targetdir)s.*)/lib([^ \'/]*)\.(a|la|so)[^ \']*''' ), '\\1-l\\3 '), ('^old_library=.*', self.expand("""old_library='lib%(base)s.a'""", env=locals())), ], la) if self.settings.platform.startswith('mingw'): loggedos.file_sub( logger, [('library_names=.*', self.expand("library_names='lib%(base)s.dll.a'", env=locals()))], la)
def asciify(logger, name): loggedos.file_sub(logger, [('\r*\n', '\r\n')], name)
def fix_prefix (logger, file_name): loggedos.file_sub (logger, [('/' + prefix + '/', '$PANGO_PREFIX/')], file_name)
def defer (logger, file): loggedos.file_sub (logger, [ (' (/etc/ld.so.conf)', self.expand (r'%(system_prefix)s/\1'))], file)
def defer (logger): if os.path.exists (self.expand ('%(configure_binary)s')): loggedos.file_sub (logger, [('cross_compiling=(maybe|no|yes)', 'cross_compiling=yes')], self.expand ('%(configure_binary)s'))
def add_CFLAGS_LDFLAGS_already (logger, file): loggedos.file_sub (logger, [ ('-L(NONE|no_x_libraries|/usr/lib)', self.expand ('-L%(system_prefix)s/lib')), ('-I(NONE|no_x_includes|/usr/include)', self.expand ('-I%(system_prefix)s/include')), ('(LD_LIBRARY_PATH=.*)', self.expand (r'\1:%(system_prefix)s/lib')) ], file)
def defer(logger): if os.path.exists(self.expand('%(configure_binary)s')): loggedos.file_sub(logger, [ ('cross_compiling=(maybe|no|yes)', 'cross_compiling=yes') ], self.expand('%(configure_binary)s'))
def escape2(logger, full_name): loggedos.file_sub(logger, [(r'(^|[^#])(#)(t|f)( |$)', r'\1\2\2\3\4')], full_name)
def defer(logger, file): loggedos.file_sub(logger, [(' (/etc/ld.so.conf)', self.expand(r'%(system_prefix)s/\1'))], file)
def defer(logger, i): loggedos.file_sub(logger, [ ('ac_compile_t1lib=1', 'ac_compile_t1lib=0'), ('-lpng ', '-lpng12 '), ('-lpng"', '-lpng12"'), ], i)
def libtool_disable_relink(logger, file): loggedos.file_sub(logger, [('need_relink=yes', 'need_relink=no')], file)
def escape2 (logger, full_name): loggedos.file_sub (logger, [(r'(^|[^#])(#)(t|f)( |$)',r'\1\2\2\3\4')], full_name)
def execute(self, logger): (re_pairs, name) = self.args loggedos.file_sub(logger, re_pairs, name, **self.kwargs)
def execute (self, logger): (re_pairs, name) = self.args loggedos.file_sub (logger, re_pairs, name, **self.kwargs)
def defer (logger, i): loggedos.file_sub (logger, [ ('ac_compile_t1lib=1', 'ac_compile_t1lib=0'), ('-lpng ', '-lpng12 '), ('-lpng"', '-lpng12"'), ], i)
def asciify (logger, name): loggedos.file_sub (logger, [('\r*\n', '\r\n')], name)
def libtool_fix_allow_undefined(logger, file): '''libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries''' loggedos.file_sub(logger, [('^(allow_undefined_flag=.*)unsupported', r'\1')], file)
def libtool_update_preserve_CC(logger, libtool, file): CC_re = '^CC="([^"]*)"' orig_CC = re.search('(?m)' + CC_re, open(file).read()).group(0) libtool_update(logger, libtool, file) loggedos.file_sub(logger, [(CC_re, orig_CC)], file)
def fix_prefix(logger, file_name): loggedos.file_sub(logger, [('/' + prefix + '/', '$PANGO_PREFIX/')], file_name)
def libtool_fix_allow_undefined(logger, file): """libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries""" loggedos.file_sub(logger, [("^(allow_undefined_flag=.*)unsupported", r"\1")], file)
def escape (logger, full_name): loggedos.file_sub (logger, [(r'(^|[^\\])([\\])(a|b|c|e|f|o)',r'\1\2\2\3')], full_name)
def libtool_disable_relink(logger, file): loggedos.file_sub(logger, [("need_relink=yes", "need_relink=no")], file)
def libtool_update_preserve_CC (logger, libtool, file): CC_re = '^CC="([^"]*)"' orig_CC = re.search ('(?m)' + CC_re, open (file).read ()).group (0) libtool_update (logger, libtool, file) loggedos.file_sub (logger, [(CC_re, orig_CC)], file)
def escape(logger, full_name): loggedos.file_sub(logger, [(r'(^|[^\\])([\\])(a|b|c|e|f|o)', r'\1\2\2\3')], full_name)