The binder takes the name of an ALI file as its argument and needs to locate source files as well as other ALI files to verify object consistency.
For source files, it follows exactly the same search rules as
(see Search Paths and the Run-Time Library (RTL)). For ALI files the
directories searched are:
gnatbindcommand line, in the order given.
ADA_OBJECTS_PATHenvironment variable. Construct this value exactly as the
PATHenvironment variable: a list of directory names separated by colons (semicolons when working with the NT version of GNAT).
ADA_PRJ_OBJECTS_FILE is normally set by gnatmake or by the gnat
driver when project files are used. It should not normally be set
by other means.
In the binder the switch -I is used to specify both source and library file paths. Use -aI instead if you want to specify source paths only, and -aO if you want to specify library paths only. This means that for the binder -Idir is equivalent to -aIdir -aOdir. The binder generates the bind file (a C language source file) in the current working directory.
Interfaces and their
children make up the GNAT Run-Time Library, together with the package
GNAT and its children, which contain a set of useful additional
library functions provided by GNAT. The sources for these units are
needed by the compiler and are kept together in one directory. The ALI
files and object files generated by compiling the RTL are needed by the
binder and the linker and are kept together in one directory, typically
different from the directory containing the sources. In a normal
installation, you need not specify these directory names when compiling
or binding. Either the environment variables or the built-in defaults
cause these files to be found.
Besides simplifying access to the RTL, a major use of search paths is in compiling sources from multiple directories. This can make development environments much more flexible.