Changeset 29993 in webkit


Ignore:
Timestamp:
Feb 4, 2008 10:27:44 PM (16 years ago)
Author:
mrowe@apple.com
Message:

2008-02-04 Jan Michael Alonzo <jmalonzo@unpluggable.com>

Reviewed by Mark Rowe.

http://bugs.webkit.org/show_bug.cgi?id=16618
[GTK] build-webkit and run-webkit-tests autootools support

  • configure.ac: make the option name of icon database consistent with the rest of webkit (from -icon-database to icondatabase)

2008-02-04 Jan Michael Alonzo <jmalonzo@unpluggable.com>

Reviewed by Mark Rowe.

http://bugs.webkit.org/show_bug.cgi?id=16618
[GTK] build-webkit and run-webkit-tests autootools support

  • Scripts/build-webkit: added --database and --icondatabase options
  • Scripts/run-launcher:
  • Scripts/run-webkit-tests:
  • Scripts/webkitdirs.pm:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r29986 r29993  
     12008-02-04  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
     2
     3        Reviewed by Mark Rowe.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=16618
     6        [GTK] build-webkit and run-webkit-tests autootools support
     7
     8        * configure.ac: make the option name of icon database consistent
     9          with the rest of webkit (from -icon-database to icondatabase)
     10
    1112008-02-04  Rodney Dawes  <dobey@wayofthemonkey.com>
    212
  • trunk/WebKitTools/ChangeLog

    r29992 r29993  
     12008-02-04  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
     2
     3        Reviewed by Mark Rowe.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=16618
     6        [GTK] build-webkit and run-webkit-tests autootools support
     7
     8        * Scripts/build-webkit: added --database and --icondatabase options
     9        * Scripts/run-launcher:
     10        * Scripts/run-webkit-tests:
     11        * Scripts/webkitdirs.pm:
     12
    1132008-02-04  Oliver Hunt  <oliver@apple.com>
    214
  • trunk/WebKitTools/Scripts/build-webkit

    r29854 r29993  
    4040my $originalWorkingDirectory = getcwd();
    4141
     42my $databaseSupport = 1;
     43my $icondatabaseSupport = 1;
    4244my $svgSupport = 1;
    4345my $svgExperimentalSupport = 0;
     
    5961Usage: $programName [options] [options to pass to build system]
    6062  --help                        Show this help message
     63  --[no-]database               Toggle Database Support (default: $databaseSupport)
     64  --[no-]icondatabase           Toggle Icon database support (default: $icondatabaseSupport)
    6165  --[no-]svg                    Toggle SVG support (default: $svgSupport)
    6266  --[no-]svg-experimental       Toggle SVG experimental features support (default: $svgExperimentalSupport,
     
    7478EOF
    7579
    76 GetOptions('svg!' => \$svgSupport,
     80GetOptions('database!' => \$databaseSupport,
     81           'icondatabase!' => \$icondatabaseSupport,
     82           'svg!' => \$svgSupport,
    7783           'svg-experimental!' => \$svgExperimentalSupport,
    7884           'svg-animation!' => \$svgAnimationSupport,
     
    133139
    134140my $productDir = productDir();
    135 my @options = XcodeOptions();
    136141my @overrideFeatureDefinesOption = ();
    137142
    138 if ($clean) {
    139     push(@options, "-alltargets");
    140     push(@options, "clean");
    141 }
    142 
    143 push @overrideFeatureDefinesOption, "ENABLE_DATABASE";
    144 push @overrideFeatureDefinesOption, "ENABLE_ICONDATABASE";
     143push @overrideFeatureDefinesOption, "ENABLE_DATABASE" if $databaseSupport;
     144push @overrideFeatureDefinesOption, "ENABLE_ICONDATABASE" if $icondatabaseSupport;
    145145push @overrideFeatureDefinesOption, "ENABLE_SVG" if $svgSupport;
    146146push @overrideFeatureDefinesOption, "ENABLE_SVG_ANIMATION" if $svgAnimationSupport;
     
    173173}
    174174
     175my @options = ();
     176
     177if ($clean && isOSX()) {
     178    push(@options, "-alltargets");
     179    push(@options, "clean");
     180}
     181
     182# enable autotool options accordingly
     183if ($ENV{WEBKITAUTOTOOLS}) {
     184    push @options, autotoolsFlag($databaseSupport, "database");
     185    push @options, autotoolsFlag($icondatabaseSupport, "icondatabase");
     186    push @options, autotoolsFlag($svgSupport, "svg");
     187    push @options, autotoolsFlag($svgAnimationSupport, "svg-animation");
     188    push @options, autotoolsFlag($svgFiltersSupport, "svg-filters");
     189    push @options, autotoolsFlag($svgForeignObjectSupport, "svg-foreign-object");
     190    push @options, autotoolsFlag($svgFontsSupport, "svg-fonts");
     191    push @options, autotoolsFlag($svgAsImageSupport, "svg-as-image");
     192    push @options, autotoolsFlag($svgUseSupport, "svg-use-element");
     193    push @options, autotoolsFlag($xpathSupport, "xpath");
     194    push @options, autotoolsFlag($xsltSupport, "xslt");
     195    push @options, autotoolsFlag($videoSupport, "video");
     196    push @options, autotoolsFlag($coverageSupport, "coverage");
     197}
     198
    175199if (isOSX()) {
     200
     201    push(@options, XcodeOptions());
     202
    176203    # Copy library and header from WebKitLibraries to a findable place in the product directory.
    177204    my $srcLib = "WebKitLibraries/libWebKitSystemInterfaceTiger.a";
     
    215242}
    216243
    217 if (isGtk() && isDarwin() && !$ENV{QMAKESPEC}) {
     244if (isGtk() && isDarwin() && !$ENV{WEBKITAUTOTOOLS} && !$ENV{QMAKESPEC}) {
    218245    # The qmake from Trolltech's binary "QT for Mac" distribution tries to
    219246    # create xcode projects, not Makefiles
     
    234261    chdir $dir or die;
    235262    my $result = 0;
     263
    236264    if (isGtk()) {
    237265        if ($dir ne "WebKit") {
     
    239267            next;
    240268        }
    241 
    242         $result = buildQMakeGtkProject($dir, $clean);
     269       
     270        $result = buildGtkProject($dir, $clean,  @options);
    243271    } elsif (isQt()) {
    244272        if ($dir ne "WebKit") {
  • trunk/WebKitTools/Scripts/run-launcher

    r29081 r29993  
    3939setConfiguration();
    4040my $productDir = productDir();
    41 my $libDir = catdir(productDir(), 'lib');
    4241my $launcherPath = productDir();
    4342my @args = @ARGV;
     
    4645checkFrameworks();
    4746
    48 if (isGtk()) {
    49   $launcherPath = catdir($launcherPath, "WebKitTools", "GtkLauncher", "GtkLauncher");
    50   # Strip --gtk from the arg-list, since otherwise GtkLauncher will try to
    51   # interpret it as a URL.
    52   @args = grep(!/^(--gtk)$/, @args);
    53 } elsif (isQt()) {
    54   $launcherPath = catdir($launcherPath, "bin", "QtLauncher");
     47# Set paths according to the build system used
     48if (!$ENV{WEBKITAUTOTOOLS}) {
     49    my $libDir = catdir(productDir(), 'lib');
     50
     51    if (isGtk()) {
     52        $launcherPath = catdir($launcherPath, "WebKitTools", "GtkLauncher", "GtkLauncher");
     53        # Strip --gtk from the arg-list, since otherwise GtkLauncher will try to
     54        # interpret it as a URL.
     55        @args = grep(!/^(--gtk)$/, @args);
     56    } elsif (isQt()) {
     57        $launcherPath = catdir($launcherPath, "bin", "QtLauncher");
     58    }
     59
     60    # Set up LD_LIBRARY_PATH to point to the product directory.
     61    print "Starting webkit launcher with LD_LIBRARY_PATH set to point to built WebKit in $libDir.\n";
     62   
     63    $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} ? "$libDir:$ENV{LD_LIBRARY_PATH}" : $libDir;
    5564} else {
    56   die;
     65
     66    if (isGtk()) {
     67        $launcherPath = catdir($launcherPath, "Programs", "GtkLauncher");
     68        @args = grep(!/^(--gtk)$/, @args);
     69    }
     70
     71    print "Starting webkit launcher.\n";
    5772}
    58 
    59 # Set up LD_LIBRARY_PATH to point to the product directory.
    60 print "Starting webkit launcher with LD_LIBRARY_PATH set to point to built WebKit in $libDir.\n";
    61 
    62 $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} ? "$libDir:$ENV{LD_LIBRARY_PATH}" : $libDir;
    6373
    6474exec $launcherPath, @args or die;
  • trunk/WebKitTools/Scripts/run-webkit-tests

    r29880 r29993  
    265265my $productDir = productDir();
    266266$productDir .= "/bin" if (isQt());
    267 $productDir .= "/WebKitTools/DumpRenderTree/gtk" if isGtk();
     267
     268if (isGtk()) {
     269    if ($ENV{WEBKITAUTOTOOLS}) {
     270        $productDir .= "/Programs";
     271    } else {
     272        $productDir .= "/WebKitTools/DumpRenderTree/gtk";
     273    }
     274}
    268275
    269276chdirWebKit();
  • trunk/WebKitTools/Scripts/webkitdirs.pm

    r29589 r29993  
    395395
    396396    if (isGtk() and $path =~ /WebCore/) {
    397         $path .= "/../lib/libWebKitGtk.so";
    398     }
    399 
    400     open NM, "-|", "nm", $path or die;
     397        $path .= "/../lib/libWebKitGtk.so" if !$ENV{WEBKITAUTOTOOLS};
     398        $path .= "/../.libs/libWebKitGtk.so" if $ENV{WEBKITAUTOTOOLS};
     399    }
     400
    401401    my $hasSVGSupport = 0;
    402     while (<NM>) {
    403         $hasSVGSupport = 1 if /SVGElement/;
    404     }
    405     close NM;
     402    if (-e $path) {
     403        open NM, "-|", "nm", $path or die;
     404        while (<NM>) {
     405            $hasSVGSupport = 1 if /SVGElement/;
     406        }
     407        close NM;
     408    }
    406409    return $hasSVGSupport;
    407410}
     
    717720}
    718721
     722sub autotoolsFlag($$)
     723{
     724    my ($flag, $feature) = @_;
     725    my $prefix = $flag ? "--enable" : "--disable";
     726
     727    return $prefix . '-' . $feature;
     728}
     729
     730sub buildAutotoolsProject($@)
     731{
     732    my ($clean, @buildArgs) = @_;
     733
     734    my $make = 'make';
     735    my $dir = productDir();
     736    my $config = passedConfiguration() || configuration();
     737    my $prefix = $ENV{"WebKitInstallationPrefix"};
     738
     739    # check if configuration is Debug
     740    if ($config =~ m/debug/i) {
     741        push @buildArgs, "--enable-debug";
     742    } else {
     743        push @buildArgs, "--disable-debug";
     744    }
     745
     746    if (! -d $dir) {
     747        system "mkdir", "-p", "$dir";
     748        if (! -d $dir) {
     749            die "Failed to create build directory " . $dir;
     750        }
     751    }
     752
     753    chdir $dir or die "Failed to cd into " . $dir . "\n";
     754
     755    my $result;
     756    if ($clean) {
     757        $result = system $make, "distclean";
     758        return $result;
     759    }
     760
     761    print "Calling configure in " . $dir . "\n\n";
     762    print "Installation directory: $prefix\n" if(defined($prefix));
     763     
     764    $result = system "$sourceDir/autogen.sh", @buildArgs;
     765    if ($result ne 0) {
     766        die "Failed to setup build environment using 'autotools'!\n";
     767    }
     768
     769    $result = system $make;
     770    if ($result ne 0) {
     771        die "\nFailed to build WebKit using '$make'!\n";
     772    }
     773
     774    chdir ".." or die;
     775    return $result;
     776}
     777
    719778sub buildQMakeProject($@)
    720779{
     
    790849}
    791850
    792 sub buildQMakeGtkProject($$)
    793 {
    794     my ($project, $clean) = @_;
     851sub buildGtkProject($$@)
     852{
     853    my ($project, $clean, @buildArgs) = @_;
    795854
    796855    if ($project ne "WebKit") {
    797         die "The Gtk portbuilds JavaScriptCore/WebCore/WebKitQt in one shot! Only call it for 'WebKit'.\n";
    798     }
    799 
    800     my @buildArgs = ("CONFIG+=gtk-port");
    801     push @buildArgs, "CONFIG-=qt";
    802 
    803     return buildQMakeProject($clean, @buildArgs);
     856        die "The Gtk port builds JavaScriptCore, WebCore and WebKit in one shot! Only call it for 'WebKit'.\n";
     857    }
     858
     859    if ($ENV{WEBKITAUTOTOOLS}) {
     860        return buildAutotoolsProject($clean, @buildArgs);
     861    } else {
     862        my @buildArgs = {"CONFIG+=gtk-port"};
     863        push @buildArgs, "CONFIG-=qt";
     864        return buildQMakeProject($clean, @buildArgs);
     865    }
    804866}
    805867
  • trunk/configure.ac

    r29961 r29993  
    219219# check whether to build with icon database support
    220220AC_MSG_CHECKING([whether to enable icon database support])
    221 AC_ARG_ENABLE(icon_database,
    222               AC_HELP_STRING([--enable-icon-database],
     221AC_ARG_ENABLE(icondatabase,
     222              AC_HELP_STRING([--enable-icondatabase],
    223223                             [enable icon database [default=no]]),
    224               [],[enable_icon_database="no"])
    225 AC_MSG_RESULT([$enable_icon_database])
     224              [],[enable_icondatabase="no"])
     225AC_MSG_RESULT([$enable_icondatabase])
    226226
    227227# check whether to enable HTML5 audio/video support
     
    355355
    356356# check if sqlite 3 is available
    357 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
     357if test "$enable_icondatabase" = "yes" || test "$enable_database" = "yes"; then
    358358   PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
    359359   AC_SUBST([SQLITE3_CFLAGS])
     
    419419AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
    420420AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
    421 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
     421AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icondatabase" = "yes"])
    422422AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
    423423AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
     
    452452 HTML5 client-side storage support : $enable_database
    453453 HTML5 video element support       : $enable_video
    454  Icon database support             : $enable_icon_database
     454 Icon database support             : $enable_icondatabase
    455455 SVG support                       : $enable_svg
    456456 SVG animation support             : $enable_svg_animation
Note: See TracChangeset for help on using the changeset viewer.