📄 am_edit
字号:
'cr48' => 'crystalsvg/48x48', 'cr64' => 'crystalsvg/64x64', 'cr128' => 'crystalsvg/128x128', 'crsc' => 'crystalsvg/scalable' ); $newfile =~ s@.*-($appname\.(png|xpm|mng|svgz|svg?))@$1@; if (! defined $dir_hash{$prefix}) { print STDERR "unknown icon prefix $prefix in $printname\n"; next; } my $dir = $dir_hash{$prefix} . "/" . $type_hash{$type}; if ($newfile =~ /-[^\.]/) { my $tmp = $newfile; $tmp =~ s/^([^-]+)-.*$/$1/; $dir = $dir . "/" . $tmp; $newfile =~ s/^[^-]+-//; } if (!defined $directories{$dir}) { $install .= "\t\$(mkinstalldirs) \$(DESTDIR)\$($destdir)/$dir\n"; $directories{$dir} = 1; } $install .= "\t\$(INSTALL_DATA) \$(srcdir)/$file \$(DESTDIR)\$($destdir)/$dir/$newfile\n"; $uninstall .= "\t-rm -f \$(DESTDIR)\$($destdir)/$dir/$newfile\n"; } } if (length($install)) { $target_adds{"install-data-am"} .= "install-kde-icons "; $target_adds{"uninstall-am"} .= "uninstall-kde-icons "; appendLines("install-kde-icons:\n" . $install . "\nuninstall-kde-icons:\n" . $uninstall); }}sub handle_POFILES($$){ my @pofiles = split(" ", $_[0]); my $lang = $_[1]; # Build rules for creating the gmo files my $tmp = ""; my $allgmofiles = ""; my $pofileLine = "POFILES ="; foreach $pofile (@pofiles) { $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension $tmp .= "$1.gmo: $pofile\n"; $tmp .= "\trm -f $1.gmo; \$(GMSGFMT) -o $1.gmo \$(srcdir)/$pofile\n"; $tmp .= "\ttest ! -f $1.gmo || touch $1.gmo\n"; $allgmofiles .= " $1.gmo"; $pofileLine .= " $1.po"; } appendLines ($tmp); my $lookup = 'POFILES\s*=([^\n]*)'; if ($MakefileData !~ /\n$lookup/) { appendLines("$pofileLine\nGMOFILES =$allgmofiles"); } else { substituteLine ($lookup, "$pofileLine\nGMOFILES =$allgmofiles"); } if ($allgmofiles) { # Add the "clean" rule so that the maintainer-clean does something appendLines ("clean-nls:\n\t-rm -f $allgmofiles\n"); $target_adds{"maintainer-clean"} .= "clean-nls "; $lookup = 'DISTFILES\s*=[ \t]*(.*)'; if ($MakefileData =~ /\n$lookup/) { $tmp = "DISTFILES = \$(GMOFILES) \$(POFILES) $1"; substituteLine ($lookup, $tmp); } } $target_adds{"install-data-am"} .= "install-nls "; $tmp = "install-nls:\n"; if ($lang) { $tmp .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES\n"; } $tmp .= "\t\@for base in "; foreach $pofile (@pofiles) { $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension $tmp .= "$1 "; } $tmp .= "; do \\\n"; if ($lang) { $tmp .= "\t echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n"; $tmp .= "\t if test -f \$\$base.gmo; then \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n"; $tmp .= "\t elif test -f \$(srcdir)/\$\$base.gmo; then \$(INSTALL_DATA) \$(srcdir)/\$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n"; $tmp .= "\t fi ;\\\n"; } else { $tmp .= "\t echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n"; $tmp .= "\t \$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES ; \\\n"; $tmp .= "\t if test -f \$\$base.gmo; then \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n"; $tmp .= "\t elif test -f \$(srcdir)/\$\$base.gmo; then \$(INSTALL_DATA) \$(srcdir)/\$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n"; $tmp .= "\t fi ;\\\n"; } $tmp .= "\tdone\n\n"; appendLines ($tmp); $target_adds{"uninstall"} .= "uninstall-nls "; $tmp = "uninstall-nls:\n"; foreach $pofile (@pofiles) { $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension if ($lang) { $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/$1.mo\n"; } else { $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$1/LC_MESSAGES/\$(PACKAGE).mo\n"; } } appendLines($tmp); $target_adds{"all"} .= "all-nls "; $tmp = "all-nls: \$(GMOFILES)\n"; appendLines($tmp); $target_adds{"distdir"} .= "distdir-nls "; $tmp = "distdir-nls:\$(GMOFILES)\n"; $tmp .= "\tfor file in \$(POFILES); do \\\n"; $tmp .= "\t cp \$(srcdir)/\$\$file \$(distdir); \\\n"; $tmp .= "\tdone\n"; $tmp .= "\tfor file in \$(GMOFILES); do \\\n"; $tmp .= "\t cp \$(srcdir)/\$\$file \$(distdir); \\\n"; $tmp .= "\tdone\n"; appendLines ($tmp); if (!$lang) { appendLines("merge:\n\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n"); } }#-----------------------------------------------------------------------------# Returns 0 if the line was processed - 1 otherwise.# Errors are logged in the global $errorflagssub tag_POFILES (){ my $lookup = 'POFILES\s*=([^\n]*)'; return 1 if ($MakefileData !~ /\n$lookup/); print STDOUT "POFILES processing <$1>\n" if ($verbose); my $tmp = $1; # make sure these are all gone. if ($MakefileData =~ /\n\.po\.gmo:\n/) { print STDERR "Warning: Found old .po.gmo rules in $printname. New po rules not added\n"; return 1; } # Either find the pofiles in the directory (AUTO) or use # only the specified po files. my $pofiles = ""; if ($tmp =~ /^\s*AUTO\s*$/) { opendir (THISDIR, "."); $pofiles = join(" ", grep(/\.po$/, readdir(THISDIR))); closedir (THISDIR); print STDOUT "pofiles found = $pofiles\n" if ($verbose); if (-f "charset" && -f "kdelibs.po") { handle_TOPLEVEL(); } } else { $tmp =~ s/\034/ /g; $pofiles = $tmp; } return 1 if (!$pofiles); # Nothing to do handle_POFILES($pofiles, $kdelang); return 0;}sub helper_LOCALINSTALL($){ my $lookup = "\035" . $_[0] . " *:[^\035]*\035\t"; my $copy = $MakefileData; $copy =~ s/\n/\035/g; if ($copy =~ /($lookup.*)$/) { $install = $1; $install =~ s/\035$_[0] *:[^\035]*\035//; my $emptyline = 0; while (! $emptyline ) { if ($install =~ /([^\035]*)\035(.*)/) { local $line = $1; $install = $2; if ($line !~ /^\s*$/ && $line !~ /^(\@.*\@)*\t/) { $emptyline = 1; } else { replaceDestDir($line); } } else { $emptyline = 1; } } }}sub tag_LOCALINSTALL (){ helper_LOCALINSTALL('install-exec-local'); helper_LOCALINSTALL('install-data-local'); helper_LOCALINSTALL('uninstall-local'); return 0;}sub replaceDestDir($) { local $line = $_[0]; if ( $line =~ /^\s*(\@.*\@)*\s*\$\(mkinstalldirs\)/ || $line =~ /^\s*(\@.*\@)*\s*\$\(INSTALL\S*\)/ || $line =~ /^\s*(\@.*\@)*\s*(-?rm.*) \S*$/) { $line =~ s/^(.*) ([^\s]+)\s*$/$1 \$(DESTDIR)$2/ if ($line !~ /\$\(DESTDIR\)/); } if ($line ne $_[0]) { $_[0] = quotemeta $_[0]; substituteLine($_[0], $line); }}#---------------------------------------------------------------------------# libtool is very hard to persuade it could use -Wl,--no-undefined for making# -no-undefined actually work# append $(KDE_NO_UNFINED) after every -no-undefined in LDFLAGS# this may go away if libtool ever does this on its ownsub tag_NO_UNDEFINED () { return if ($program !~ /_la$/); my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; $MakefileData =~ m/$lookup/; return if (!defined($1)); return if ($1 !~ /CXXLINK/); if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ ) { return; } $lookup = $program . '\_LDFLAGS(\s*)=(.*)-no-undefined(.*)'; if ($MakefileData =~ /\n$lookup\n/) { my $replace = $program . "\_LDFLAGS$1=$2-no-undefined \$(KDE_NO_UNDEFINED)$3"; substituteLine($lookup, $replace); }}sub tag_CLOSURE () { return if ($program !~ /_la$/); my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; $MakefileData =~ m/$lookup/; return if (!defined($1)); return if ($1 !~ /CXXLINK/); if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ && $MakefileData !~ /\n$program\_LDFLAGS\s*=.*KDE_PLUGIN/ ) { print STDERR "Report: $program contains undefined in $printname\n" if ($program =~ /^lib/ && $dryrun); return; } my $closure = $realname{$program} . ".closure"; my $lines = "$closure: \$($program\_OBJECTS) \$($program\_DEPENDENCIES)\n"; $lines .= "\t\@echo \"int main() {return 0;}\" > $program\_closure.$cxxsuffix\n"; $lines .= "\t\@\$\(LTCXXCOMPILE\) -c $program\_closure.$cxxsuffix\n"; $lines .= "\t\$\(CXXLINK\) $program\_closure.lo \$($program\_LDFLAGS) \$($program\_OBJECTS) \$($program\_LIBADD) \$(LIBS)\n"; $lines .= "\t\@rm -f $program\_closure.* $closure\n"; $lines .= "\t\@echo \"timestamp\" > $closure\n"; $lines .= "\n"; appendLines($lines); $lookup = $realname{$program} . ": (.*)"; if ($MakefileData =~ /\n$lookup\n/) { $lines = "\@KDE_USE_CLOSURE_TRUE@". $realname{$program} . ": $closure $1"; $lines .= "\n\@KDE_USE_CLOSURE_FALSE@" . $realname{$program} . ": $1"; substituteLine($lookup, $lines); } $closure_output .= " $closure";}sub tag_NMCHECK () { return if ($program !~ /_la$/); my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; $MakefileData =~ m/$lookup/; my $linkcmd = $1; return if (!defined($1)); return if ($linkcmd !~ /CXXLINK/ && $linkcmd !~ /LINK/); $lookup = $program . '_NMCHECK\s*=([^\n]*)'; if( $MakefileData !~ m/\n$lookup\n/ ) { return; } my $allowed = $1; $allowed =~ s/^ *//; $lookup = $program . '_NMCHECKWEAK\s*=([^\n]*)'; my $weak = ""; my $is_weak = 0; if( $MakefileData =~ m/\n$lookup\n/ ) { $weak = $1; $is_weak = 1; } $weak =~ s/^ *//; if( $is_weak ) { $weak = '--allowweak=\'' . $weak . '\' '; } my $nmline = "\@KDE_USE_NMCHECK_TRUE@\t\@\$(MAKE) \$(AM_MAKEFLAGS) nmcheck_$realname{$program} || ( rm -f $realname{$program}; exit 1 )"; $lookup = '(\t\$\(CXXLINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)'; if( $MakefileData =~ /\n$lookup\n/ ) { my $oldstuff = $1; substituteLine( $lookup, $oldstuff . "\n" . $nmline ); } $lookup = '(\t\$\(LINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)'; if( $MakefileData =~ /\n$lookup\n/ ) { my $oldstuff = $1; substituteLine( $lookup, $oldstuff . "\n" . $nmline ); } $nmline = "\@\$(top_srcdir)/admin/nmcheck $realname{$program} \'$allowed\' $weak"; appendLines( "\nnmcheck_$realname{$program}: $realname{$program} \n\t$nmline\n" ); $target_adds{ "nmcheck" } .= "nmcheck_$realname{$program} ";}sub tag_DIST () { my %foundfiles = (); opendir (THISDIR, "."); foreach $entry (readdir(THISDIR)) { next if ($entry eq "CVS" || $entry =~ /^\./ || $entry eq "Makefile" || $entry =~ /~$/ || $entry =~ /^\#.*\#$/); next if (! -f $entry); next if ($entry =~ /\.moc/ || $entry =~ /\.moc.$cppExt$/ || $entry =~ /\.lo$/ || $entry =~ /\.la$/ || $entry =~ /\.o/); next if ($entry =~ /\.all_$cppExt\.$cppExt$/); $foundfiles{$entry} = 1; } closedir (THISDIR); # doing this for MAINTAINERCLEANFILES would be wrong my @marks = ("EXTRA_DIST", "DIST_COMMON", '\S*_SOURCES', '\S*_HEADERS', 'CLEANFILES', 'DISTCLEANFILES', '\S*_OBJECTS'); foreach $mark (@marks) { while ($MakefileData =~ /\n($mark)\s*=[ \t]*([^\n]*)/g) { my $cleanfiles_str = $2; foreach $file (split('[\034\s]+', $cleanfiles_str)) { $file =~ s/\.\///; $foundfiles{$file} = 0 if (defined $foundfiles{$file}); } } } my @files = ("Makefile", "config.cache", "config.log", "stamp-h", "stamp-h1", "stamp-h1", "config.h", "Makefile", "config.status", "con
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -