From owner-freebsd-ports Wed Feb 5 07:16:16 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA25441 for ports-outgoing; Wed, 5 Feb 1997 07:16:16 -0800 (PST) Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id HAA25341; Wed, 5 Feb 1997 07:16:10 -0800 (PST) Received: from rover.village.org [127.0.0.1] by rover.village.org with esmtp (Exim 0.56 #1) id E0vs94u-0000u5-00; Wed, 5 Feb 1997 08:16:04 -0700 To: obrien@NUXI.com (David O'Brien) Subject: Re: conditionally including Cc: freebsd-ports@freebsd.org (FreeBSD ports list), hackers@freebsd.org In-reply-to: Your message of "Wed, 05 Feb 1997 00:33:43 PST." <19970205003343.YB13323@dragon.nuxi.com> References: <19970205003343.YB13323@dragon.nuxi.com> <19970202135048.PN07710@dragon.nuxi.com> <199701280143.RAA06503@freefall.freebsd.org> Date: Wed, 05 Feb 1997 08:16:03 -0700 From: Warner Losh Message-Id: Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <19970205003343.YB13323@dragon.nuxi.com> David O'Brien writes: : Then what would you suggest? Are they really more different than all the : various sysVr4 that define __svr4__? How close is Solaris, UnixWare, and : Irix? Ummm, they don't all define svr4 in all versions. Solaris didn't define it until at least the 3.0 release of the C compilers. I'm not sure if the current gnu tools define this for all of these systems. And they all have sys/param.h :- : I'm just trying to find something that will cover all the 4.4BSD derived : OS's. What are the big divergances from each other that __44bsd__ : wouldn't cover (from an application standpoint)? Remember I'm trying to : catch things like sys_errlist[], termios, /var/mail, /usr/sbin/sendmail, : etc Better to include sys/param.h, from a portability standpoint, and check to see if BSD is defined and larger than a certain value. The hard part is knowing if sys/param.h will be there. : Everyone will acknowlege that for kernel stuff __FreeBSD__, etc. : should be used. But I still think __44bsd__ is fine where we would : already do the #if (BSD > xyx) test or defined(__FreeBSD__) || : defined(__NetBSD__) ,etc. Yes, but there are enough "dusty deck" systems out there that software authors will still need to do other checks. It would be better to find a foolproof way of knowing when sys/param.h is available (or at least when it generally isn't). Most of the examples that you sighted can be handled better by other means. Don't declare sys_errlist at all, rather use strerror() or #include (which is fairly standard). Don't use hard wired path names, but rather the standard ones defined in pathnames.h. You'll likely have to have a fallback for that strategy as well. Also, as time moves forward, some new systems will adopt parts of the 4.4 tree. Do you really want to have things like: #if defined(__bsd44__) || (defined(SOLARIS) && SOLARIS >= 207) ... in the sources? They quickly get out of hand. Many of the ports have 2-3 lines of ifdefs to include stdlib.h, when instead they should have a single #ifdef __STDC__ in its place. Had BSD 4.4 come out with this symbol, things would be a little different. However, it didn't think that it would be worth the portibility hassles at this point, since it would take time for this symbol to propigate to all flavors of BSD. 2.2 is almost out the door, OpenBSD 2.0 is on the streets (and will be for a while). Netbsd 1.2 is also on the streets and likely will be for a while too. I guess I'm just showing my years of riding heard on the OI/uib source tree which was generally portable to the point that the compile time (45 minutes to an hour) usually dominated the porting time (well, and sometimes it was the licenese manager third party code too). Warner