[openbeos] Re: optional packages and gcc

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Mon, 21 Jan 2008 02:26:49 +0100

On 2008-01-20 at 22:15:22 [+0100], François Revol <revol@xxxxxxx> wrote:
> It's nice to have packages installed to the image, but with gcc4 builds
> most don't work.

Well, earlier or later the gcc 2 packages will work under gcc 4 Haiku, too.

> How about installing them depending on gcc version ?

I did actually consider that when introducing that build system feature and 
decided that it would be best to handle platform and gcc dependency where 
the optional packages are declared. Separate rules didn't strike me as 
particularly beneficial, since usually one wants to add a symlink and has 
to guard that rule invocation, too.

Our optional package declarations should look like:

if [ IsOptionalHaikuImagePackageAdded Foo ]
        && $(TARGET_ARCH) = x86 && $(TARGET_GCC_VERSION[1]) = 2 {
        InstallOptionalHaikuImagePackage Foo
                : http://foo.com/foo-x86-gcc2.zip
                : apps
        ;
        AddSymlinkToHaikuImage home config be Applications
                : /boot/apps/Foo/Foo ;
}

Which becomes fancier, when versions for more than one platform and/or 
compiler are available:

if [ IsOptionalHaikuImagePackageAdded Foo ]
        && ( $(TARGET_ARCH) = x86 && $(TARGET_GCC_VERSION[1]) in 2 3 4
                || $(TARGET_ARCH) in ppc m68k && $(TARGET_GCC_VERSION[1]) = 4 ) 
{
        InstallOptionalHaikuImagePackage Foo
                : 
http://foo.com/foo-$(TARGET_ARCH)-gcc$(TARGET_GCC_VERSION[1]).zip
                : apps
        ;
        AddSymlinkToHaikuImage home config be Applications
                : /boot/apps/Foo/Foo ;
}

Or if the URL/package naming is supoptimal:

if [ IsOptionalHaikuImagePackageAdded Foo ]
        && ( $(TARGET_ARCH) = x86 && $(TARGET_GCC_VERSION[1]) in 2 3 4
                || $(TARGET_ARCH) in ppc m68k && $(TARGET_GCC_VERSION[1]) = 4 ) 
{
        local x86_2 = legacy-foo-1.0.3.zip ;
        local x86_3 = foo-gcc4-1.0.4.zip ;
        local x86_4 = $(x86_3) ;
        local ppc_4 = foo-ppc-1.0.4.zip ;
        local m86k_4 = foo-m86k-1.0.4.zip ;
        InstallOptionalHaikuImagePackage Foo
                : http://foo.com/$($(TARGET_ARCH)_$(TARGET_GCC_VERSION[1]))
                : apps
        ;
        AddSymlinkToHaikuImage home config be Applications
                : /boot/apps/Foo/Foo ;
}

CU, Ingo

Other related posts: