[Iftop-users] Re: Portability to GNU/kFreeBSD

Mats Erik Andersson debian at gisladisker.se
Wed, 26 Oct 2011 21:56:14 +0200


Dear Alexander and all you with interest in Iftop,

onsdag den 26 oktober 2011 klockan 12:22 skrev Alexander Reichle-Schmehl detta:
> Hi Mats!
> 
> Am 25.10.2011 21:01, schrieb Mats Erik Andersson:
> 
> > I feel compelled to clarify the changes needed to get a valid
> > and buildable support for GNU/kFreeBSD:
> > 
> >     * config.guess, config.sub, config/config.guess, config/config.sub
> >       are outdated and must be renewed.
> > 
> >     * The patch below must be used to insert correct conditionals.
> >       The originals are misconceived. (I am myself to blame for that,
> >       but they were sufficient for the Debian package improvements,
> >       my original target!) One could argue that
> > 
> >           defined __GLIBC__ && defined __FreeBSD_kernel__
> > 
> >       is even more precise, as it avoids capturing GNU/Hurd,
> >       but the check on __GLIBC__ alone is preferred for user land,
> >       so __FreeBSD_kernel__ is best avoided.
> >
> > Make an informed choice from this additional points,
> > 
> >   Mats Erik Andersson, Debian Maintainer (but not for this software)
> 
> Well, I am the maintainer of the package, and you see me quite confused.
>  I uploaded 1.0pre2 (relabeled as 1.0~pre2 due do Debian's version
> comparison scheme) about a week ago to Debian's experimental branch,
> without any further changes to the source (but with update
> config/config.{guess,sub} files).  And the package got build on our
> kfreebsd Architectures without any problems.

Yes, this observation is to be expected of two reasons:

  * The Debian rules file installs by itself all the files

      {,config/}config.{guess,sub}

    bringing copies in from the up-to-date version present
    in a contemporary Debian system! Compiling from the
    original tar archive on GNU/kFreeBSD will fail due
    to the outdated support files, however, since its build
    system does not recognise the target system "*kfreebsd*"
    sufficiently well.

  * The conditional clause

       defined __GNUC__ && ! defined __linux__

    is too coarse since it captures everything that is being
    compiled using Gcc, but is not using a Linux kernel. Thus
    FreeBSD and OpenBSD, etcetera, are erroneously included,
    and also GNU/kFreeBSD and GNU/Hurd. I wrote this conditional
    for the Debian package before I had gained enough experience
    to pin-point the optimal mechanism, during my first time of
    porting software to GNU/kFreeBSD.

    My suggestion is to use

       defined __GLIBC__ && ! defined __linux__

    which captures every setup which is compiling against Glibc
    and is not using Linux. (I.e., previous Gcc versus Glibc now).
    Thus GNU/Hurd and GNU/kFreeBSD are captured (and the obsolete
    GNU/kNetBSD) but hardly anything else.

    The most specific conditional would be

       defined __GLIBC__ && defined __FreeBSD_kernel__

    capturing exactly a Glibc setting with OS kernel from FreeBSD,
    i.e., only GNU/kFreeBSD. What does speak against its use,
    is the practice among porters to prefer either, not both.
    On the other hand

       defined __FreeBSD_kernel__

    captures only GNU/kFreeBSD in today's known systems, but again
    porters prefer __GLIBC__ when user land is targeted.

> 
> I haven't checked the package on the specific architectures, but the
> buildlogs look fine:
> https://buildd.debian.org/status/package.php?p=iftop&suite=experimental.
>  Only hurd-i386 failed to build.

The failure for GNU/Hurd is natural and is not worrying,
but Robert Millan (long time DD) is comfortable with both
of GNU/kFreeBSD and GNU/Hurd and he will be delighted in
passing a top-notch and final statement in this matter!

Best regards,
  Mats Erik Andersson, DM