⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webkitdirs.pm

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 PM
📖 第 1 页 / 共 3 页
字号:
            return "$baseProductDir/$libraryName.intermediate/$configuration/$libraryName.intermediate/$libraryName.lib";        }    }    die "Unsupported platform, can't determine built library locations.";}# Check to see that all the frameworks are built.sub checkFrameworks{    return if isCygwin();    my @frameworks = ("JavaScriptCore", "WebCore");    push(@frameworks, "WebKit") if isAppleMacWebKit();    for my $framework (@frameworks) {        my $path = builtDylibPathForName($framework);        die "Can't find built framework at \"$path\".\n" unless -x $path;    }}sub hasSVGSupport{    return 0 if isCygwin();    my $path = shift;    if (isQt()) {        return 1;    }    my $hasSVGSupport = 0;    if (-e $path) {        open NM, "-|", "nm", $path or die;        while (<NM>) {            $hasSVGSupport = 1 if /SVGElement/;        }        close NM;    }    return $hasSVGSupport;}sub removeLibraryDependingOnSVG{    my $frameworkName = shift;    my $shouldHaveSVG = shift;    my $path = builtDylibPathForName($frameworkName);    return unless -x $path;    my $hasSVG = hasSVGSupport($path);    system "rm -f $path" if ($shouldHaveSVG xor $hasSVG);}sub checkWebCoreSVGSupport{    my $required = shift;    my $framework = "WebCore";    my $path = builtDylibPathForName($framework);    my $hasSVG = hasSVGSupport($path);    if ($required && !$hasSVG) {        die "$framework at \"$path\" does not include SVG Support, please run build-webkit --svg\n";    }    return $hasSVG;}sub hasAcceleratedCompositingSupport{    return 0 if isCygwin() || isQt();    my $path = shift;    my $useAcceleratedCompositing = 0;    if (-e $path) {        open NM, "-|", "nm", $path or die;        while (<NM>) {            $useAcceleratedCompositing = 1 if /GraphicsLayer/;        }        close NM;    }    return $useAcceleratedCompositing;}sub checkWebCoreAcceleratedCompositingSupport{    my $required = shift;    my $framework = "WebCore";    my $path = builtDylibPathForName($framework);    my $hasAcceleratedCompositing = hasAcceleratedCompositingSupport($path);    if ($required && !$hasAcceleratedCompositing) {        die "$framework at \"$path\" does not use accelerated compositing\n";    }    return $hasAcceleratedCompositing;}sub has3DTransformsSupport{    return 0 if isCygwin() || isQt();    my $path = shift;    my $has3DTransformsSupport = 0;    if (-e $path) {        open NM, "-|", "nm", $path or die;        while (<NM>) {            $has3DTransformsSupport = 1 if /WebCoreHas3DTransforms/;        }        close NM;    }    return $has3DTransformsSupport;}sub checkWebCore3DTransformsSupport{    my $required = shift;    my $framework = "WebCore";    my $path = builtDylibPathForName($framework);    my $has3DTransforms = has3DTransformsSupport($path);    if ($required && !$has3DTransforms) {        die "$framework at \"$path\" does not include 3D Transforms Support, please run build-webkit --3d-transforms\n";    }    return $has3DTransforms;}sub hasWMLSupport{    return 0 if isCygwin();    my $path = shift;    if (isQt()) {        # FIXME: Check built library for WML support, just like Gtk does it below.        return 0;    }    my $hasWMLSupport = 0;    if (-e $path) {        open NM, "-|", "nm", $path or die;        while (<NM>) {            $hasWMLSupport = 1 if /WMLElement/;        }        close NM;    }    return $hasWMLSupport;}sub removeLibraryDependingOnWML{    my $frameworkName = shift;    my $shouldHaveWML = shift;    my $path = builtDylibPathForName($frameworkName);    return unless -x $path;    my $hasWML = hasWMLSupport($path);    system "rm -f $path" if ($shouldHaveWML xor $hasWML);}sub checkWebCoreWMLSupport{    my $required = shift;    my $framework = "WebCore";    my $path = builtDylibPathForName($framework);    my $hasWML = hasWMLSupport($path);    if ($required && !$hasWML) {        die "$framework at \"$path\" does not include WML Support, please run build-webkit --wml\n";    }    return $hasWML;}sub isQt(){    determineIsQt();    return $isQt;}sub checkForArgumentAndRemoveFromARGV{    my $argToCheck = shift;    foreach my $opt (@ARGV) {        if ($opt =~ /^$argToCheck$/i ) {            @ARGV = grep(!/^$argToCheck$/i, @ARGV);            return 1;        }    }    return 0;}sub determineIsQt(){    return if defined($isQt);    # Allow override in case QTDIR is not set.    if (checkForArgumentAndRemoveFromARGV("--qt")) {        $isQt = 1;        return;    }    # The presence of QTDIR only means Qt if --gtk is not on the command-line    if (isGtk()) {        $isQt = 0;        return;    }        $isQt = defined($ENV{'QTDIR'});}sub isGtk(){    determineIsGtk();    return $isGtk;}sub determineIsGtk(){    return if defined($isGtk);    $isGtk = checkForArgumentAndRemoveFromARGV("--gtk");}sub isWx(){    determineIsWx();    return $isWx;}sub determineIsWx(){    return if defined($isWx);    $isWx = checkForArgumentAndRemoveFromARGV("--wx");}sub getWxArgs(){    if (!@wxArgs) {        @wxArgs = ("");        my $rawWxArgs = "";        foreach my $opt (@ARGV) {            if ($opt =~ /^--wx-args/i ) {                @ARGV = grep(!/^--wx-args/i, @ARGV);                $rawWxArgs = $opt;                $rawWxArgs =~ s/--wx-args=//i;            }        }        @wxArgs = split(/,/, $rawWxArgs);    }    return @wxArgs;}# Determine if this is debian, ubuntu, linspire, or something similar.sub isDebianBased(){    return -e "/etc/debian_version";}sub isChromium(){    determineIsChromium();    return $isChromium;}sub determineIsChromium(){    return if defined($isChromium);    $isChromium = checkForArgumentAndRemoveFromARGV("--chromium");}sub isCygwin(){    return ($^O eq "cygwin") || 0;}sub isDarwin(){    return ($^O eq "darwin") || 0;}sub isAppleWebKit(){    return !(isQt() or isGtk() or isWx() or isChromium());}sub isAppleMacWebKit(){    return isAppleWebKit() && isDarwin();}sub isAppleWinWebKit(){    return isAppleWebKit() && isCygwin();}sub isPerianInstalled(){    if (!isAppleWebKit()) {        return 0;    }    if (-d "/Library/QuickTime/Perian.component") {        return 1;    }    if (-d "$ENV{HOME}/Library/QuickTime/Perian.component") {        return 1;    }    return 0;}sub determineOSXVersion(){    return if $osXVersion;    if (!isDarwin()) {        $osXVersion = -1;        return;    }    my $version = `sw_vers -productVersion`;    my @splitVersion = split(/\./, $version);    @splitVersion >= 2 or die "Invalid version $version";    $osXVersion = {            "major" => $splitVersion[0],            "minor" => $splitVersion[1],            "subminor" => (defined($splitVersion[2]) ? $splitVersion[2] : 0),    };}sub osXVersion(){    determineOSXVersion();    return $osXVersion;}sub isTiger(){    return isDarwin() && osXVersion()->{"minor"} == 4;}sub isLeopard(){    return isDarwin() && osXVersion()->{"minor"} == 5;}sub isSnowLeopard(){    return isDarwin() && osXVersion()->{"minor"} == 6;}sub relativeScriptsDir(){    my $scriptDir = File::Spec->catpath("", File::Spec->abs2rel(dirname($0), getcwd()), "");    if ($scriptDir eq "") {        $scriptDir = ".";    }    return $scriptDir;}sub launcherPath(){    my $relativeScriptsPath = relativeScriptsDir();    if (isGtk() || isQt()) {        return "$relativeScriptsPath/run-launcher";    } elsif (isAppleWebKit()) {        return "$relativeScriptsPath/run-safari";    }}sub launcherName(){    if (isGtk()) {        return "GtkLauncher";    } elsif (isQt()) {        return "QtLauncher";    } elsif (isAppleWebKit()) {        return "Safari";    }}sub checkRequiredSystemConfig{    if (isDarwin()) {        chomp(my $productVersion = `sw_vers -productVersion`);        if ($productVersion lt "10.4") {            print "*************************************************************\n";            print "Mac OS X Version 10.4.0 or later is required to build WebKit.\n";            print "You have " . $productVersion . ", thus the build will most likely fail.\n";            print "*************************************************************\n";        }        my $xcodeVersion = `xcodebuild -version`;        if ($xcodeVersion !~ /DevToolsCore-(\d+)/ || $1 < 747) {            print "*************************************************************\n";            print "Xcode Version 2.3 or later is required to build WebKit.\n";            print "You have an earlier version of Xcode, thus the build will\n";            print "most likely fail.  The latest Xcode is available from the web:\n";            print "http://developer.apple.com/tools/xcode\n";            print "*************************************************************\n";        }    } elsif (isGtk() or isQt() or isWx()) {        my @cmds = qw(flex bison gperf);        my @missing = ();        foreach my $cmd (@cmds) {            if (not `$cmd --version`) {                push @missing, $cmd;            }        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -