[haiku-commits] Re: haiku: hrev44293 - src/apps/webpositive

  • From: Matt Madia <mattmadia@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 9 Jul 2012 00:42:44 +0000

On 7/8/12, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

> For gcc 2  tthere is no WebPositive, so nothing can be added. For a gcc 2
> hybrid build a sub build process with gcc 4 is invoked, which builds the
> alternative gcc archive (which in turn is eventually unzipped to the image
> by the main jam). For a gcc 4 based image WebPositive can be added to the
> build directly. So both rules must be executed only for gcc 4. Note that the
> rules are declarative, so there is no clash and no need to check whether an
> image or an alternative gcc archive is built. There's a shorthand
> AddFilesToHaikuHybridImage which calls both rules and should be used here.

Hrmmm. I had trouble getting AddFilesToHaikuHybridImage to work as expected.
When building a gcc 2 hybrid, it was fine. Building a gcc 4 hybrid caused the
gcc 2 sub-jam process to fail, as it tried building webpositive.

Here's what I came up with, full patch attached:
==========================================
# WebPositive
if [ IsOptionalHaikuImagePackageAdded WebPositive ] {
        if $(TARGET_ARCH) != x86 {
                Echo "No optional package WebPositive available for 
$(TARGET_ARCH)" ;
        } else if $(HAIKU_GCC_VERSION[1]) < 4 && ! $(isHybridBuild) {
                Echo "No optional package WebPositive available for gcc2" ;
        } else if $(HAIKU_GCC_VERSION[1]) < 4 && $(isHybridBuild) {
                if $(HAIKU_PRIMARY_GCC) != 4 {
                        # if we are not the gcc4hybrid's sub-jam process
                        AddFilesToAlternativeGCCArchive apps : WebPositive ;
                        AddSymlinkToHaikuHybridImage home config settings 
deskbar Applications
                                : /boot/apps/WebPositive ;
                }
        } else if $(HAIKU_GCC_VERSION[1]) >= 4 {
                if $(HAIKU_PRIMARY_GCC) = 2  {
                        # if we are the gcc2hybrid's sub-jam process
                        AddFilesToHaikuHybridImage apps : WebPositive ;
                        AddSymlinkToHaikuHybridImage home config settings 
deskbar Applications
                                : /boot/apps/WebPositive ;
                } else {
                        # if we are not the gcc2hybrid's sub-jam process
                        AddFilesToHaikuImage apps : WebPositive ;
                        AddSymlinkToHaikuImage home config settings deskbar 
Applications
                                : /boot/apps/WebPositive ;
                }
        }
}
==========================================
As a reminder, HAIKU_PRIMARY_GCC is set only prior to invoking the
alternative gcc sub-jam process, "actions InvokeSubJam1" inside
HaikuImage.

I used that variable to make sure webpositive wasn't being added to
the gcc2 portion of a gcc4hybrid.


>> + InstallOptionalHaikuImagePackage $(HAIKU_WEBKIT_FILE)
>> + : $(baseURL)/$(HAIKU_WEBKIT_FILE)
>> + : common ;
>
> This should just be declared as an optional package and as a dependency for
> WebPositive in OptionalPackageDependencies.

Done, though I didn't work on placing the libs in the proper lib vs.
lib/gcc4 folder.Maybe $(HAIKU_WEBKIT_FILE) could be handled more like
ICU.
E.g., separate HAIKU_WEBKIT_FILE into HAIKU_WEBKIT_LIBS and
HAIKU_WEBKIT_DEVEL_PACKAGE and then pass the correct directory to
InstallOptionalHaikuImagePackage $(HAIKU_WEBKIT_LIBS) ...

> An actual problem will be
> the dependencies for WebKit, though. E.g. if Curl is declared as a
> dependency, the gcc 2 package would be installed. The easiest work-around
> for the time being might be splitting the Curl package in packages CurlGCC2
> and CurlGCC4 and adding CurlGCC4 as a dependency for WebKit. To keep things
> simple for other packages that depend on Curl a pseudo package Curl could be
> introduced which would depend on CurlGCC2 or CurlGCC4 depending on the
> current gcc. The same goes for Curl's dependency (OpenSSL) and recursively
> all other WebKit dependencies.

I didn't touch this part yet. Getting web+ built by the system won't
improve or worsen
the current situation. Though it does need to be improved. I've some
free time coming
up at the end of the month, but I'm not sure if I'd want to work on
that or other build
system tasks[1] (the latter i'd need to pick your brain about).

--mmadia

1: //www.freelists.org/post/haiku-development/R1a4-possible,13

Other related posts: