ACLOCALPATHoptmymacrosusrlocalshareaclocal
ACLOCAL_PATHopt is a variant of the standard ACLOCAL_PATH environment variable used by the GNU Autotools suite, particularly by the aclocal command part of Automake. ACLOCAL_PATH typically specifies directories that aclocal scans for M4 macro definitions when generating aclocal.m4. The “opt” suffix indicates that the variable can be used to supply an optional or supplementary set of macro directories without overriding the primary ACLOCAL_PATH setting. In practice, when aclocal is invoked, it first resolves any environment variable named ACLOCAL_PATH or ACLOCAL_PATHopt; if both are set, the tool processes the directories in the order of precedence defined by the build system—usually the primary ACLOCAL_PATH value preceding the optional value. This allows developers to add project‑specific or third‑party macros that are not part of the standard macro pool, while keeping the base macro search path intact.
Usage involves exporting the variable in the shell or in a Makefile, for example:
export ACLOCAL_PATHopt="/usr/local/share/aclocal:/opt/macro/lib"
Running aclocal –install will then import macros from those paths. The optional nature of ACLOCAL_PATHopt makes