--src
       |--share
       |--posix
       |--winapi
       |--SYSV
       |--GNU
       |--BSD
       |--solaris
       |--aix
       |--gnu
       |--linux
       |--darwin
       |--freebsd
       |--windows
       |--wince


* 95%+ of the code will be the same across solaris/linux/etc
  And remember this includes all the X11 code.
* Of the remaining 5%, most of it is best dealt with via ifdef
  because its a few line delta in a large file.
  I'd guess 2% of the code might merit a separate source file.

So whilst these may exist in ports that doesn't mean they should all exist
in mainline. I suggest to keep src/solaris (for historical reasons) as
meaing "src shared across the unix/X11 family" and others in mainline
only for the core supported platforms, which will add macosx in JDK 8,
largely because of client code differences

Ports would add their own platform dir if they need to, or add ifdefs in 
src/solaris
if that's easier.

-phil.



On 11/29/2011 8:36 AM, Steve Poole wrote:
On Mon, 2011-11-28 at 17:20 +0100, Fredrik Öhrström wrote:
2011-11-28 16:46, Ulf Zibis skrev:
I guess you meant:
--shared
--posix
        |--SYSV
        |    |--solaris
        |    |--aix
        |
        |--gnu
        |    |--linux
        |    |
        |--BSD
             |--darwin
             |--freebsd

--winapi
      |--win32
      |--wince

against current ...
--share
--linux
--solaris
--windows

The directory structure ought to be more flat than
the possible combinations that form a product.

For example if:
HOST_API = posix winapi
HOST_OS = solaris aix gnu linux darwin freebsd windows wince
HOST_OS_PEDIGREE = SYSV GNU BSD

then the directories are stored flat under src:

--src
      |--share
      |--posix
      |--winapi
      |--SYSV
      |--GNU
      |--BSD
      |--solaris
      |--aix
      |--gnu
      |--linux
      |--darwin
      |--freebsd
      |--windows
      |--wince

I think that make sense. This is one of these discussions in which there
is no simple answer. Trying to architect a directory structure to match
all the possible combinations (now and for the future) is likely just to
make things even more complicated.

This approach is simple and makes it easy for new platforms to just drop
in.

Then, when compiling, the union of the directories and files below
the selected src subdirectories, form the source of the product.
For example:
     share,posix,BSD,darwin
     share,posix,GNU,linux
     share,posix,GNU,gnu
     share,winapi,windows

This gives less confusion about which subdirs to src/posix
are configuration directories, and which are posix directories with code.

I do like this approach -especially if the union of directories per
platform is well documented and visible. That would really help
understand the impact when someone has to change a file in one of these
subdirectories.

//Fredrik



Reply via email to