The GNU C Library - Hierarchy Conventions

Node: Hierarchy Conventions Next: Porting to Unix Up: Porting

Layout of the `sysdeps' Directory Hierarchy

A GNU configuration name has three parts: the CPU type, the manufacturer's name, and the operating system. `configure' uses these to pick the list of system-dependent directories to look for. If the `--nfp' option is not passed to `configure', the directory `machine/fpu' is also used. The operating system often has a base operating system; for example, if the operating system is `sunos4.1', the base operating system is `unix/bsd'. The algorithm used to pick the list of directories is simple: `configure' makes a list of the base operating system, manufacturer, CPU type, and operating system, in that order. It then concatenates all these together with slashes in between, to produce a directory name; for example, the configuration `sparc-sun-sunos4.1' results in `unix/bsd/sun/sparc/sunos4.1'. `configure' then tries removing each element of the list in turn, so `unix/bsd/sparc' and `sun/sparc' are also tried, among others. Since the precise version number of the operating system is often not important, and it would be very inconvenient, for example, to have identical `sunos4.1.1' and `sunos4.1.2' directories, `configure' tries successively less specific operating system names by removing trailing suffixes starting with a period.

As an example, here is the complete list of directories that would be tried for the configuration `sparc-sun-sunos4.1' (without the `--nfp' option):

	sparc/fpu
	unix/bsd/sun/sunos4.1/sparc
	unix/bsd/sun/sunos4.1
	unix/bsd/sun/sunos4/sparc
	unix/bsd/sun/sunos4
	unix/bsd/sun/sunos/sparc
	unix/bsd/sun/sunos
	unix/bsd/sun/sparc
	unix/bsd/sun
	unix/bsd/sunos4.1/sparc
	unix/bsd/sunos4.1
	unix/bsd/sunos4/sparc
	unix/bsd/sunos4
	unix/bsd/sunos/sparc
	unix/bsd/sunos
	unix/bsd/sparc
	unix/bsd
	unix/sun/sunos4.1/sparc
	unix/sun/sunos4.1
	unix/sun/sunos4/sparc
	unix/sun/sunos4
	unix/sun/sunos/sparc
	unix/sun/sunos
	unix/sun/sparc
	unix/sun
	unix/sunos4.1/sparc
	unix/sunos4.1
	unix/sunos4/sparc
	unix/sunos4
	unix/sunos/sparc
	unix/sunos
	unix/sparc
	unix
	sun/sunos4.1/sparc
	sun/sunos4.1
	sun/sunos4/sparc
	sun/sunos4
	sun/sunos/sparc
	sun/sunos
	sun/sparc
	sun
	sunos4.1/sparc
	sunos4.1
	sunos4/sparc
	sunos4
	sunos/sparc
	sunos
	sparc

Different machine architectures are conventionally subdirectories at the top level of the `sysdeps' directory tree. For example, `sysdeps/sparc' and `sysdeps/m68k'. These contain files specific to those machine architectures, but not specific to any particular operating system. There might be subdirectories for specializations of those architectures, such as `sysdeps/m68k/68020'. Code which is specific to the floating-point coprocessor used with a particular machine should go in `sysdeps/machine/fpu'.

There are a few directories at the top level of the `sysdeps' hierarchy that are not for particular machine architectures.

`generic'
`stub'
As described above (see Porting), these are the two subdirectories that every configuration implicitly uses after all others.

`ieee754'
This directory is for code using the IEEE 754 floating-point format, where the C type float is IEEE 754 single-precision format, and double is IEEE 754 double-precision format. Usually this directory is referred to in the `Implies' file in a machine architecture-specific directory, such as `m68k/Implies'.

`posix'
This directory contains implementations of things in the library in terms of POSIX.1 functions. This includes some of the POSIX.1 functions themselves. Of course, POSIX.1 cannot be completely implemented in terms of itself, so a configuration using just `posix' cannot be complete.

`unix'
This is the directory for Unix-like things. See Porting to Unix. `unix' implies `posix'. There are some special-purpose subdirectories of `unix':

`unix/common'
This directory is for things common to both BSD and System V release 4. Both `unix/bsd' and `unix/sysv/sysv4' imply `unix/common'.

`unix/inet'
This directory is for socket and related functions on Unix systems. The `inet' top-level subdirectory is enabled by `unix/inet/Subdirs'. `unix/common' implies `unix/inet'.

`mach'
This is the directory for things based on the Mach microkernel from CMU (including the GNU operating system). Other basic operating systems (VMS, for example) would have their own directories at the top level of the `sysdeps' hierarchy, parallel to `unix' and `mach'.


Next: Porting to Unix Up: Porting