From owner-freebsd-ports Thu Feb 6 20:41:30 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id UAA03537 for ports-outgoing; Thu, 6 Feb 1997 20:41:30 -0800 (PST) Received: from po1.glue.umd.edu (root@po1.glue.umd.edu [129.2.128.44]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA03532; Thu, 6 Feb 1997 20:41:27 -0800 (PST) Received: from skipper.eng.umd.edu (skipper.eng.umd.edu [129.2.103.24]) by po1.glue.umd.edu (8.8.5/8.7.3) with ESMTP id XAA18669; Thu, 6 Feb 1997 23:41:12 -0500 (EST) Received: from localhost (chuckr@localhost) by skipper.eng.umd.edu (8.8.5/8.7.3) with SMTP id XAA05269; Thu, 6 Feb 1997 23:41:11 -0500 (EST) X-Authentication-Warning: skipper.eng.umd.edu: chuckr owned process doing -bs Date: Thu, 6 Feb 1997 23:41:05 -0500 (EST) From: Chuck Robey X-Sender: chuckr@skipper.eng.umd.edu To: Bruce Evans cc: freebsd-ports@FreeBSD.org, hackers@FreeBSD.org, imp@village.org, obrien@NUXI.com Subject: Re: conditionally including In-Reply-To: <199702070423.PAA19335@godzilla.zeta.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-ports@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 7 Feb 1997, Bruce Evans wrote: > >> But they certainly should accept anything with __FooBSD__ or BSD >= mmm > >> or __FooBSD_version >= nnn. That would give 100-line ifdefs to support > >> 100 OS's. It's also useless for communicating what is different in > >> FooBSD. > > > >I don't disagree, I'm just saying that flatly including sys/param.h with > >no qualifiers means that it will be a fatal error on any machine that > >doesn't have a sys/param.h, so that's not acceptable. > > The application authors should already have a way of handling the possible > nonexistence of sys/param.h, and it is unlikely to be the same as ours. > If not, then they should refuse to add anything involving sys/param.h. I've talked to a fair sampling of authors of unix applications, and most would be overjoyed if we presented them with a method that was both safe for them to use on any platform, and guaranteed to DTRT on Free|Open|NetBSD. If they had a BSD make, it would be simple, likewise if they used the GNU make, but SYSV make is a backwards child. I want to find _something_ that would could use _and_ advertise to the outside world. Just making it work under FreeBSD is trivial, because our make supports the #if exists syntax. That's the reason I would like the __FreeBSD__, __OpenBSD__, and __NetBSD__, because it works. I know it's as elegant as my dirty laundry. I haven't seen any other method that works. All your comments have been correct, I think, but I still haven't seen anyone make any other suggestion that works. Works, I mean, on FreeBSD and all the other platforms, not just the BSD world. > > >non-fatal in nature to systems without sys/param.h. The method I suggest > >above is messy, but (and _please_ correct me if I'm wrong) it has the sole > >benefit of being the only one I've seen that is non-fatal on systems that > >don't have a sys/param.h. > > I forget what it is. > > The only method that is (almost) guaranteed to work is a test involving > an identifier that is defined outside of the the application, perhaps in > bsd.ports.mk, e.g., > > #ifdef HAVE_SYS_PARAM_H > #include > #endif > > This breaks if the identifier already has a different meaning to the > application (not likely) and is inconvenient if the application and/or > other supported targets already have a different spelling for the > identifier. > > Bruce > ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@eng.umd.edu | communications topic, C programming, and Unix. 9120 Edmonston Ct #302 | Greenbelt, MD 20770 | I run Journey2 and picnic, both FreeBSD (301) 220-2114 | version 3.0 current -- and great FUN! ----------------------------+-----------------------------------------------