måndag den 24 oktober 2011 klockan 00:11 skrev Mats Erik Andersson detta:
First off, renew the four files
{,config/}config.{guess,sub}
The present versions are six years old. They are incapable of working with GNU/kFreeBSD.
These are necessary changes (variations present also in [1]):
The correct conditionals in "addrs_ioctl.c" is
defined __GLIBC__ & ! defined __linux__
in order to catch GNU/kFreeBSD and to avoid NexentaCore. This MUST be changed, whether or not you decide to ignore OpenSolaris.
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)
diff -Naur iftop-1.0pre2.orig/addrs_ioctl.c iftop-1.0pre2/addrs_ioctl.c --- iftop-1.0pre2.orig/addrs_ioctl.c 2011-10-02 23:11:30.000000000 +0200 +++ iftop-1.0pre2/addrs_ioctl.c 2011-10-25 11:59:52.000000000 +0200 @@ -19,7 +19,7 @@ #include <netinet/in.h>
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \ - || ( defined __GNUC__ && ! defined __linux__ ) + || ( defined __GLIBC__ && ! defined __linux__ ) #include <sys/param.h> #include <sys/sysctl.h> #include <net/if_dl.h> @@ -81,7 +81,7 @@ } #else #if defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ \ - || ( defined __GNUC__ && ! defined __linux__ ) + || ( defined __GLIBC__ && ! defined __linux__ ) { int sysctlparam[6] = {CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0}; size_t needed = 0;
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.
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.
Best regards, Alexander
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