Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 18:47:28 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        arch@FreeBSD.org, bde@FreeBSD.org
Subject:   Re: Local driver include files.
Message-ID:  <Pine.BSF.4.21.0101231828090.35723-100000@besplex.bde.org>
In-Reply-To: <200101222012.f0MKCns65410@aslan.scsiguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 22 Jan 2001, Justin T. Gibbs wrote:

> When writing core driver code to run on several operating systems,
> the fact that we use -nostdinc becomes a real pain in the but.
> Take a look at sys/dev/aic7xxx/aic7xxx.c:
> 
> #ifdef  __linux__
> #include "aic7xxx_linux.h"
> #include "aic7xxx_inline.h"
> #include "aicasm/aicasm_insformat.h"
> #endif
> 
> #ifdef  __FreeBSD__
> #include <dev/aic7xxx/aic7xxx_freebsd.h>
> #include <dev/aic7xxx/aic7xxx_inline.h>
> #include <dev/aic7xxx/aicasm/aicasm_insformat.h>
> #endif
> 
> If we provided "-Ipath/to/file/being/compiled" this could
> be replaced with:
> 
> #include "aic7xxx_osm.h"
> #include "aic7xxx_inline.h"
> #include "aicasm/aicasm_insformat.h"
> 
> This is a much more scalable approach.

Except the size of the Makefile and most command lines generated by
it is O(number of path/to/file/being/compiled).

> I can understand the desire to fully document the path to
> an include file, but is this really too much to ask?

We attempt to enforce using full paths relative to $S to avoid
ambiguities.  This was mainly to avoid ambiguities for paths
with no slashes in them.  Ambiguities for other paths are less
likely.  They are probably most likely for alternative versions
of drivers.

BTW, the -current kernel Makefiles have already been hacked to add
-I$S/dev (not to mention -I$S/contrib/dev/acpica/Subsystem/Include)
to CFLAGS, so you don't need the above ifdefs in -current.  You still
need them in RELENG[3-4].

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101231828090.35723-100000>