aclocal command in Linux with Examples

aclocal command in Linux is used to automatically generate aclocal.m4 files from file. automake in Linux contain a lot of autoconf macros that can be used in the different packages. These macros must be defined in the aclocal.m4. If not, then it can’t be accessed by the autoconf.
The aclocal command first scans for macro definitions in the .m4 files in its default directory (/usr/share/aclocal on some systems) and also in the file acinclude.m4 after which it scans for macros used in the file. It will generate an aclocal.m4 file that contains definitions of all the m4 macros required by autoconf.


aclocal [, OPTION/]... [, SRCDIR/]


  • –acdir=dir : This option is used to search macro files in directory dir instead of the default directory.
  • –help: Display the help message and then exits.

  • -I DIRECTORY: Add the directory DIR to the list of directories searched for the .m4 files.
  • –system-acdir=dir: Shows the directory holding third party system wide files.
  • –output=FILE: Cause the output to be put into specified FILE instead of aclocal.m4.
  • –diff: Runs the command diff on m4 files that might be changed.
  • –verbose: It prints the names of the files it examines.

  • –print-ac-dir: Prints the name of the directory to be searched for m4 files, then exit.
  • –force: Always updates the output file.
  • –dry-run: Pretends to update the files.
  • –version: Shows the version number and then exits.

  • -W or –warnings: Reports the warning’s falling in the category.

    The warning categories are:

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.