16.4. Finding the SConstruct file in repositories

SCons will also search in repositories for the SConstruct file and any specified SConscript files. This poses a problem, though: how can SCons search a repository tree for an SConstruct file if the SConstruct file itself contains the information about the pathname of the repository? To solve this problem, SCons allows you to specify repository directories on the command line using the -Y option:

% scons -Q -Y /usr/repository1 -Y /usr/repository2
    

When looking for source or derived files, SCons will first search the repositories specified on the command line, and then search the repositories specified in the SConstruct or SConscript files.

Note that while other files are searched through the chain of repositories, SConstruct is special - it must be found either in the current directory or the first directory specified using the -Y (or the --repository or --srcdir synonyms) command line option, or the build will abort.